2009-01-16 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2009-01-16  Marek Safar  <marek.safar@gmail.com>
2
3         * nullable.cs (LiftedBinaryOperator): Check for all possible null
4         expressions.
5
6 2009-01-15  Marek Safar  <marek.safar@gmail.com>
7
8         A fix for bug #466634
9         * statement.cs: Add reference for nested storey when only this
10         is captured.
11
12 2009-01-15  Marek Safar  <marek.safar@gmail.com>
13
14         A fix for bug #466474
15         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
16         was specified.
17
18 2009-01-15  Marek Safar  <marek.safar@gmail.com>
19
20         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
21         Fixed nested stories parent referencing process. Also fixes #463985.
22
23 2009-01-06  Marek Safar  <marek.safar@gmail.com>
24
25         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
26         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
27         implementation. Also fixes #463108.
28
29 2009-01-05  Marek Safar  <marek.safar@gmail.com>
30
31         A fix for bug #416109
32         * decl.cs: Issue correct CLSAttribute warning location.
33
34 2009-01-05  Marek Safar  <marek.safar@gmail.com>
35
36         A fix for bug #456775
37         * attribute.cs: Use attribute owner scope when resolving attribute
38         arguments.
39
40 2009-01-05  Marek Safar  <marek.safar@gmail.com>
41
42         A fix for bug #457257
43         * decl.cs: Fixed incorrect member declaring type comparison.
44
45 2009-01-05  Marek Safar  <marek.safar@gmail.com>
46
47         A fix for bug #460896
48         * driver.cs: Handle /RES resources as embeddable.
49
50 2009-01-05  Marek Safar  <marek.safar@gmail.com>
51
52         A fix for bug #462515
53         * ecore.cs: Report inacessible members upwards.
54
55 2009-01-05  Marek Safar  <marek.safar@gmail.com>
56
57         A fix for bug #463190, #463192
58         * decl.cs, namespace.cs: Also import internal extension classes.
59
60 2009-01-04  Marek Safar  <marek.safar@gmail.com>
61
62         A fix for bug #463415
63         * generic.cs: Use right index for RemoveDependentTypes.
64
65 2009-01-02  Marek Safar  <marek.safar@gmail.com>
66
67         A fix for bug #463196
68         * expression.cs: Fixed enum to null comparison.
69
70 2009-01-02  Marek Safar  <marek.safar@gmail.com>
71
72         A fix for bug #463121
73         * nullable.cs: Fixed nullable user equality operator comparison.
74
75 2009-01-02  Marek Safar  <marek.safar@gmail.com>
76
77         A fix for bug #462950
78         * class.cs, decl.cs: Use full explicit name when defining automatic
79         property backing field.
80
81 2009-01-02  Marek Safar  <marek.safar@gmail.com>
82
83         A fix for bug #462592
84         * pending.cs: Emit type arguments for generic proxy method.
85
86 2008-12-30  Marek Safar  <marek.safar@gmail.com>
87
88         * expression.cs (As): Mutate all type arguments.
89
90 2008-12-29  Marek Safar  <marek.safar@gmail.com>
91
92         A fix for bug #462622
93         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
94         context.
95
96 2008-12-29  Marek Safar  <marek.safar@gmail.com>
97
98         A fix for bug #450782
99         * ecore.cs: Consider more variables of form V.I to be fixed.
100
101 2008-12-29  Marek Safar  <marek.safar@gmail.com>
102
103         A fix for bug #460712
104         * typemanager.cs: Core types could be imported.
105
106 2008-12-28  Marek Safar  <marek.safar@gmail.com>
107
108         A fix for bugs #460847, #460772, #458049, #457339, #447807
109         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
110         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
111         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
112         user lambdas used inside query clauses.
113
114 2008-12-18  Marek Safar  <marek.safar@gmail.com>
115
116         A fix for bug #460229
117         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
118
119 2008-12-18  Marek Safar  <marek.safar@gmail.com>
120
121         A fix for bug #459952
122         * decl.cs, namespace.cs: Use common CheckAccessLevel.
123
124 2008-12-18  Marek Safar  <marek.safar@gmail.com>
125
126         A fix for bug #459630
127         * convert.cs: Enum to valuetype conversion is not allowed.
128
129 2008-12-18  Marek Safar  <marek.safar@gmail.com>
130
131         A fix for bug #457087
132         * generic.cs: Don't crash when constraint comes from type
133         declaration.
134
135 2008-12-16  Marek Safar  <marek.safar@gmail.com>
136
137         A fix for bug #459221
138         * anonymous.cs, statement.cs: Delay only captured this
139         initialization.
140
141 2008-12-12  Marek Safar  <marek.safar@gmail.com>
142
143         A fix for bug #457489
144         * anonymous.cs, statement.cs: Split anonymous storey instantiation
145         and initialization to capture scope initializers correctly.
146
147 2008-12-11  Marek Safar  <marek.safar@gmail.com>
148
149         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
150         ParameterReference refactoring.
151
152 2008-12-03  Marek Safar  <marek.safar@gmail.com>
153
154         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
155         to be imported from any assembly.
156
157 2008-12-03  Marek Safar  <marek.safar@gmail.com>
158
159         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
160         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
161         from anonymous method and lambda expression.
162
163 2008-12-01  Marek Safar  <marek.safar@gmail.com>
164
165         A fix for bug #448560
166         * expression.cs (As): Box any generic type arguments to be
167         verifiable.
168
169 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
170
171         Add tripwire for implicit conversion bugs
172         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
173         for CS1501 error.
174         (MethodGroupExpr.OverloadResolve): Add sanity check between
175         IsApplicable and VerifyArgumentsCompat.
176         (VerifyArgumentsCompat): Report CS1501 where appropriate.
177
178 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
179
180         Fix build break in System.Data_test
181         * convert.cs (ImplicitConversionExists): Move NullLiteral
182         conversions ...
183         (ImplicitStandardConversionExists): ... here.
184
185 2008-11-28  Marek Safar  <marek.safar@gmail.com>
186
187         * literal.cs: Emit correctly explicit null to nullable cast.
188
189 2008-11-28  Marek Safar  <marek.safar@gmail.com>
190
191         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
192         resolve.
193
194 2008-11-28  Marek Safar  <marek.safar@gmail.com>
195
196         A fix for bug #449005
197         * convert.cs, nullable.cs: Use only one implicit nullable
198         conversion.
199
200 2008-11-27  Marek Safar  <marek.safar@gmail.com>
201
202         * convert.cs, literal.cs: More Convert cleanup is needed.
203
204 2008-11-27  Marek Safar  <marek.safar@gmail.com>
205
206         * decl.cs, class.cs: Fixed misleading error message.
207
208 2008-11-26  Marek Safar  <marek.safar@gmail.com>
209
210         A fix for bug #449005
211         * nullable.cs (EmitEquality): Disable optimization for user operator
212         operands.
213
214 2008-11-25  Marek Safar  <marek.safar@gmail.com>
215
216         A fix for bug #447027
217         * anonymous.cs (HoistedVariable): Cache also outer access to deal
218         with context variables stored as expression instances.
219
220 2008-11-25  Marek Safar  <marek.safar@gmail.com>
221
222         A fix for bug #447027
223         * delegate.cs: Fixed delegate VerifyMethod logic.
224
225 2008-11-24  Marek Safar  <marek.safar@gmail.com>
226
227         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
228         but not verifiable.
229
230 2008-11-21  Marek Safar  <marek.safar@gmail.com>
231
232         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
233         member type resolve to follow normal flow, instead of random
234         property access.
235
236 2008-11-21  Marek Safar  <marek.safar@gmail.com>
237
238         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
239         type.
240
241 2008-11-21  Marek Safar  <marek.safar@gmail.com>
242
243         * const.cs: Emit decimal array constant as literal.
244
245 2008-11-20  Marek Safar  <marek.safar@gmail.com>
246
247         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
248
249 2008-11-19  Marek Safar  <marek.safar@gmail.com>
250
251         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
252         into real property (saves 8 MB for corlib compilation).
253
254 2008-11-19  Marek Safar  <marek.safar@gmail.com>
255
256         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
257         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
258         generic-mcs.cs: Small cleanup of TypeArguments.
259
260 2008-11-18  Marek Safar  <marek.safar@gmail.com>
261
262         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
263         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
264         of ConstructedType expression, renamed to GenericTypeExpr.
265
266 2008-11-17  Marek Safar  <marek.safar@gmail.com>
267
268         A fix for bug #445303
269         * location.cs (IsConditionalDefined): Handle undefined global
270         defines.
271
272 2008-11-17  Marek Safar  <marek.safar@gmail.com>
273
274         A fix for bug #444678
275         * expression.cs (TryReduceConstant): Always create new constant
276         instance.
277
278 2008-11-17  Marek Safar  <marek.safar@gmail.com>
279
280         A fix for bug #444673
281         * ecore.cs: Ignore open generic types when used as generic type
282         instance fields.
283
284 2008-11-17  Marek Safar  <marek.safar@gmail.com>
285
286         A fix for bug #445458
287         * expression.cs, cs-parser.jay: Don't crash when an expression
288         statement is null.
289
290 2008-11-17  Marek Safar  <marek.safar@gmail.com>
291
292         A fix for bug #445464
293         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
294         inside unbound type.
295
296 2008-11-14  Jb Evain  <jbevain@novell.com>
297
298         * driver.cs: ignore empty -nowarn argument such as
299         the one in -nowarn:12,13,,.
300
301 2008-11-13  Marek Safar  <marek.safar@gmail.com>
302
303         A fix for bug #444271
304         * anonymous.cs: Rescan parent storeys when best candidate was
305         undone.
306
307 2008-11-13  Marek Safar  <marek.safar@gmail.com>
308
309         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
310         useless UnboundTypeExpression.
311         
312         * attribute.cs: Do check obsolete attribute on generic types.
313
314 2008-11-12  Marek Safar  <marek.safar@gmail.com>
315
316         A fix for bugs #425680, #400139
317         * ecore.cs, expression.cs: Trying to do some almost_matched_members
318         refactoring.
319
320 2008-11-11  Marek Safar  <marek.safar@gmail.com>
321
322         A fix for bug #435747
323         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
324         compound value types assignment. Few micro optimizations added.
325
326 2008-11-10  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #442610
329         * anonymous.cs (MutateConstructor): More SRE hacking.
330
331 2008-11-10  Marek Safar  <marek.safar@gmail.com>
332
333         A fix for bug #442579
334         * ecore.cs: Also initialize expanded form of a method with 1 params
335         parameter.
336
337 2008-11-06  Marek Safar  <marek.safar@gmail.com>
338
339         * expression.cs (UnaryMutator): Do early l-side check.
340
341 2008-11-05  Miguel de Icaza  <miguel@novell.com>
342
343         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
344         Init, otherwise we would crash later on when checking for friend
345         assemblies. 
346
347         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
348         Otherwise we never get any meaningful information as to what
349         failed. 
350
351 2008-11-05  Marek Safar  <marek.safar@gmail.com>
352
353         A fix for bug #436318
354         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
355
356 2008-11-05  Miguel de Icaza  <miguel@novell.com>
357
358         * namespace.cs: Turns out that it was a really bad idea to hide
359         the errors for namespaces not found here in eval mode.    
360
361         * eval.cs: When we process using clauses, only enter those into
362         the list of valid using clauses after they have been validated.   
363
364         The above change gives the proper semantics: it does not
365         senselessly report the same errors with broken using statements by
366         never storing them in the first place when they are invalid.
367
368 2008-11-05  Marek Safar  <marek.safar@gmail.com>
369
370         A fix for bug #421839
371         * cs-parser.jay: Remove expression from coalesce rule to force lower
372         priority than the assignment operator.
373
374 2008-11-05  Marek Safar  <marek.safar@gmail.com>
375
376         A fix for bug #437875
377         * nullable.cs: Compile correctly method group operand used with null
378         coalescing operator.
379
380 2008-11-04  Marek Safar  <marek.safar@gmail.com>
381
382         A fix for bug #434589
383         * expression.cs (Binary): Ignore lifted conversions when at least
384         one operand is of reference type.
385
386 2008-11-04  Marek Safar  <marek.safar@gmail.com>
387
388         * cs-parser.jay: Better syntax error report.
389
390 2008-11-03  Marek Safar  <marek.safar@gmail.com>
391
392         A fix for bug #436792
393         * cs-parser.jay: Use GetLocation to access location.
394
395 2008-11-03  Marek Safar  <marek.safar@gmail.com>
396
397         A fix for bug #440774
398         * cs-parser.jay: Also set current_array_type when parsing local
399         variables types.
400
401 2008-11-03  Marek Safar  <marek.safar@gmail.com>
402
403         A fix for bug #440785
404         * expression.cs (As): Don't resolve self modifing expression
405         multiple times.
406
407 2008-11-03  Marek Safar  <marek.safar@gmail.com>
408
409         A fix for bug #439447
410         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
411
412 2008-11-03  Marek Safar  <marek.safar@gmail.com>
413
414         A fix for bug #437571
415         * cs-parser.jay: Fixes internal error for invalid expression
416         statements.
417
418 2008-10-17  Marek Safar  <marek.safar@gmail.com>
419
420         * ecore.cs: Resolve correctly ambiguous params delegate methods.
421
422 2008-10-17  Marek Safar  <marek.safar@gmail.com>
423
424         * generic.cs, anonymous.cs: Simplified GetDeclarations.
425
426 2008-10-17  Marek Safar  <marek.safar@gmail.com>
427
428         * cs-tokenizer.cs: More precise cast parsing.
429
430 2008-10-16  Martin Baulig  <martin@ximian.com>
431
432         * anonymous.cs (AnonymousMethodStorey): Put back the
433         `hoisted_locals' hashtable and use it in EmitType().
434
435 2008-10-15  Marek Safar  <marek.safar@gmail.com>
436
437         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
438         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
439         ~5MB for corlib.
440
441 2008-10-14  Marek Safar  <marek.safar@gmail.com>
442
443         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
444
445 2008-10-14  Marek Safar  <marek.safar@gmail.com>
446
447         * statement.cs: Mutate scope initializers.
448
449 2008-10-14  Marek Safar  <marek.safar@gmail.com>
450
451         * expression.cs: Use typeless value for This constant.
452         
453         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
454
455 2008-10-14  Marek Safar  <marek.safar@gmail.com>
456
457         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
458         tokenizer.
459
460 2008-10-13  Marek Safar  <marek.safar@gmail.com>
461
462         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
463         type to type cast.
464
465 2008-10-13  Marek Safar  <marek.safar@gmail.com>
466
467         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
468         parser and tokenizer. Fixes many ambiguities including #433258.
469
470 2008-10-10  Marek Safar  <marek.safar@gmail.com>
471
472         * cs-parser.jay: Fixed missing accessor recovery.
473
474 2008-10-10  Marek Safar  <marek.safar@gmail.com>
475
476         A fix for bug #433701
477         * expression.cs: Better error message.
478
479 2008-10-10  Marek Safar  <marek.safar@gmail.com>
480
481         * cs-parser.jay, expression.cs: Start reporting real parser errors.
482         
483         * Makefile: Disabled unused debug symbols.
484
485         Also fixes: #320556, #321097, #321656, #321876, #351316
486
487 2008-10-09  Miguel de Icaza  <miguel@novell.com>
488
489         * eval.cs: rename "<interactive>" to "{interactive}", to work
490         around a requirement in the compiler that this be a valid
491         filename, and in Windows it is not (433886).
492
493 2008-10-09  Marek Safar  <marek.safar@gmail.com>
494
495         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
496
497 2008-10-08  Marek Safar  <marek.safar@gmail.com>
498
499         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
500         cs-parser.jay: Generic type declaration and type arguments cleanup.
501
502 2008-10-05  Marek Safar  <marek.safar@gmail.com>
503
504         * cs-parser.jay: Allow parsing weird array creation construct.
505
506 2008-10-05  Marek Safar  <marek.safar@gmail.com>
507
508         * cs-parser.jay: Conflicts reduction.
509
510 2008-10-04  Marek Safar  <marek.safar@gmail.com>
511
512         * cs-parser.jay: Conflicts reduction.
513
514 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
515
516         Fix #398325
517         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
518         property.  Add a 'count' hint about the use of the shared vector.
519         Ensure that we don't leak out dirty bits.
520         (UsageVector.MergeChild): Throw away information about variables
521         in child vectors.
522         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
523
524 2008-10-03  Marek Safar  <marek.safar@gmail.com>
525
526         A fix for bug #431746
527         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
528         parameters when iterator is created.
529
530 2008-10-03  Marek Safar  <marek.safar@gmail.com>
531
532         A fix for bug #431827
533         * expression.cs: Fixed right based pointer arithmetic operations
534         emit.
535
536 2008-10-03  Marek Safar  <marek.safar@gmail.com>
537
538         A fix for bug #353779
539         * assign.cs, expression.cs: Fixed compound assignment conversions.
540
541 2008-10-02  Marek Safar  <marek.safar@gmail.com>
542
543         A fix for bug #375262
544         * statement.cs: Refactor ArrayForeach to be usable with string
545         indexer. Optimized single dimentional arrays foreach.
546
547 2008-10-02  Marek Safar  <marek.safar@gmail.com>
548
549         A fix for bug #431255
550         * anonymous.cs, expression.cs: Removed broken optimization.
551
552 2008-10-01  Marek Safar  <marek.safar@gmail.com>
553
554         * anonymous.cs: Use full type parameters of parent generic
555         containers. Removed unnecessary AddParentStoreyReference call.
556
557 2008-10-01  Marek Safar  <marek.safar@gmail.com>
558
559         A fix for bug #324702
560         * class.cs: Use better shorter names for explicit interface member
561         implementations.
562
563         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
564
565 2008-10-01  Marek Safar  <marek.safar@gmail.com>
566         
567         * expression.cs: Use new interface to check fixed expression.
568
569 2008-10-01  Marek Safar  <marek.safar@gmail.com>
570
571         A fix for bug #421101
572         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
573         interface to check for fixed fixed-buffers.
574
575 2008-10-01  Marek Safar  <marek.safar@gmail.com>
576
577         A fix for bug #429264
578         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
579         
580         * delegate.cs: Removed unnecessary casts.
581
582 2008-09-30  Marek Safar  <marek.safar@gmail.com>
583
584         A fix for bug #352151
585         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
586         class.cs: Fixed already defined explicit interface members check.
587
588 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
589
590         cs-tokenizer.cs: Fix typo.
591
592 2008-09-28  Miguel de Icaza  <miguel@novell.com>
593
594         * eval.cs (InteractiveBase): The quit command now just sets a
595         flag, instead of calling Environment.Exit(), it is milder on
596         embedded hosts. 
597
598         CompiledMethod is now in Mono.CSharp, not nested inside
599         the Evaluator, it was inconvenient to use.
600
601 2008-09-27  Miguel de Icaza  <miguel@novell.com>
602
603         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
604         code to be invoked without having to reparse.
605
606 2008-09-27  Miguel de Icaza  <miguel@novell.com>
607
608         * ecore.cs: The recent changes to FieldExpr broke this as well.
609         Fixes LINQ queries in the interactive shell.
610
611         * Multiple files: indentation fixing for the Mono coding
612         guidelines for the switch statement.
613
614         * eval.cs: Make the Evaluator API thread safe.
615
616 2008-09-26  Marek Safar  <marek.safar@gmail.com>
617
618         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
619         constructor parsing.
620
621 2008-09-26  Marek Safar  <marek.safar@gmail.com>
622
623         A fix for bug #325326
624         * statement.cs: Check possible mistaken empty statement using
625         explicit blocks only.
626
627 2008-09-25  Miguel de Icaza  <miguel@novell.com>
628
629         * eval.cs (LoadAssembly, ReferenceAssembly): Call
630         RootNamespace.ComputeNamespaces to update the internal list of
631         namespaces, this is no longer done for us.
632
633         (InteractiveBase): Use the Evaluator APIs instead of calling into
634         Driver directly
635
636 2008-09-25  Marek Safar  <marek.safar@gmail.com>
637
638         A fix for bug #429264
639         * expression.cs: Missing mutator for access to multidimensional
640         arrays.
641
642 2008-09-25  Marek Safar  <marek.safar@gmail.com>
643
644         * class.cs, statement: Emit DebuggerHidden attribute for iterator
645         entry wrapper.
646         
647         * driver.cs: Missing input argument check.
648
649 2008-09-25  Marek Safar  <marek.safar@gmail.com>
650
651         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
652         expression.cs, statement.cs, rootcontext.cs, class.cs, 
653         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
654         DefineMembers.
655
656 2008-09-24  Miguel de Icaza  <miguel@novell.com>
657
658         * ecore.cs (FieldExpr): Only initialize eclass when we return a
659         fully constructed FieldExpr, fixes the regression introduced in
660         the last commit.
661         
662         * ecore.cs, expression.cs: Plug back the eclass initialization as
663         otherwise it regresses `csharp'. 
664
665 2008-09-24  Marek Safar  <marek.safar@gmail.com>
666
667         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
668         ecore.cs, attribute.cs: Moved obsolete method checks from emit
669         phase to resolve phase. It resolves problems with expression trees
670         and fixes bugs #323796, #325156.
671
672 2008-09-23  Marek Safar  <marek.safar@gmail.com>
673
674         * codegen.cs: Report better error when symbol writer is missing.
675
676 2008-09-23  Marek Safar  <marek.safar@gmail.com>
677
678         * codegen.cs: Set .NET symbol writer.
679         
680         * decl.cs: Guard against null generic arguments.
681         
682         * report.cs: Don't report exactly same additional details.
683
684 2008-09-22  Marek Safar  <marek.safar@gmail.com>
685
686         A fix for bug #324917
687         * cs-parser.jay: Add missing multidimensional non-expression type
688         ranks.
689         
690 2008-09-22  Marek Safar  <marek.safar@gmail.com>
691
692         A fix for bug #428191
693         * anonymous.cs: Create an outer generic fields also for non-storey
694         anonymous methods.
695
696 2008-09-22  Marek Safar  <marek.safar@gmail.com>
697
698         A fix for bug #378294
699         * class.cs: Make fixed size buffers gmcs feature only.
700
701 2008-09-22  Marek Safar  <marek.safar@gmail.com>
702
703         A fix for bug #355622, #324993
704         * assign.cs, const.cs, class.cs: Create new EmitContext for each
705         field initializer.
706
707 2008-09-19  Marek Safar  <marek.safar@gmail.com>
708
709         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
710         error reporting.
711
712 2008-09-19  Marek Safar  <marek.safar@gmail.com>
713
714         A fix for bug #416110
715         * generic.cs: Struct constraint results in default ctor and
716         ValueType base type constraint to be set.
717
718 2008-09-19  Marek Safar  <marek.safar@gmail.com>
719
720         A fix for bug #423791
721         * generic.cs: Fixed params output type type-inference.
722
723 2008-09-19  Marek Safar  <marek.safar@gmail.com>
724
725         * cs-parser.jay, expression.cs: Fixed few expression crashes.
726         
727 2008-09-19  Marek Safar  <marek.safar@gmail.com>
728
729         * cs-tokenizer.cs: Don't break on extra partial modifier.
730
731 2008-09-19  Marek Safar  <marek.safar@gmail.com>
732
733         A fix for bug #427592
734         * generic.cs: Use common parameter resolve method.
735
736 2008-09-18  Marek Safar  <marek.safar@gmail.com>
737
738         A fix for bug #414758
739         * expression.cs, ecore.cs: Fixed crash when accessing non-static
740         property.
741
742 2008-09-18  Marek Safar  <marek.safar@gmail.com>
743
744         * driver.cs, namespace.cs: Read types and namespaces after all
745         requested assemblies are loaded, fixes issues with System.Core
746         auto-reference, and #419888.
747
748 2008-09-18  Marek Safar  <marek.safar@gmail.com>
749
750         A fix for bug #417705
751         * cs-parser.jay: Fixed as/is operator expression split.
752
753 2008-09-18  Marek Safar  <marek.safar@gmail.com>
754
755         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
756         Fixed expression tree representation of empty new expression and
757         new initializer expression.
758
759 2008-09-18  Miguel de Icaza  <miguel@novell.com>
760
761         * eval.cs: Remove warning, keep reference to driver around.
762
763         * Hide fields that do not need to be public.
764
765 2008-09-17  Marek Safar  <marek.safar@gmail.com>
766
767         A fix for bug #426385
768         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
769         conversion for array elements.
770
771 2008-09-17  Marek Safar  <marek.safar@gmail.com>
772
773         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
774         void parsing conflicts.
775
776 2008-09-15  Marek Safar  <marek.safar@gmail.com>
777
778         A fix for bug #425601
779         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
780         System.Core only when there is no custom ExtensionAttribute
781         implementation.
782
783 2008-09-15  Miguel de Icaza  <miguel@novell.com>
784
785         * namespace.cs: Do not report CS0246 (name
786
787 2008-09-12  Marek Safar  <marek.safar@gmail.com>
788
789         A fix for bug #425669
790         * generic.cs: Don't cache generic static anonymous method 
791         containers.
792
793 2008-09-12  Marek Safar  <marek.safar@gmail.com>
794
795         * generic.cs, class.cs, delegate.cs: Check recursive inherited
796         conflicting constraints.
797
798 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
799
800         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
801         mcs too.
802
803 2008-09-12  Marek Safar  <marek.safar@gmail.com>
804
805         * literal.cs, convert.cs, expression.cs, statement.cs: More null
806         to null pointer conversion fixes.
807
808 2008-09-11  Marek Safar  <marek.safar@gmail.com>
809
810         * cs-parser.jay, expression.cs: An implicitly typed local variable
811         declarator cannot use an array initializer.
812
813 2008-09-11  Marek Safar  <marek.safar@gmail.com>
814
815         * cs-parser.jay: Reduced number of printed tokens, add sorting.
816
817 2008-09-11  Marek Safar  <marek.safar@gmail.com>
818
819         * generic.cs (InflatedConstraints): Don't crash when constraints
820         are different.
821         
822         * cs-parser.jay: const_declarator is a block.
823
824         * constant.cs: Check for not allowed NaN conversions.
825
826 2008-09-10  Miguel de Icaza  <miguel@novell.com>
827
828         * driver.cs: Drop --shell argument, the compiler is no longer a
829         REPL. 
830
831         * eval.cs: Move most of the code that deals with evaluation into
832         this file and document the public API from repl.cs
833
834         * repl.cs: Remove from here.
835         
836 2008-09-10  Marek Safar  <marek.safar@gmail.com>
837
838         A fix for bug #424684
839         * generic.cs: Generic class constraints must come first.
840
841 2008-09-09  Miguel de Icaza  <miguel@novell.com>
842
843         * cs-parser.jay: Improve error reporting for syntax errors in
844         statements and expressions, we now report the expected tokens
845         instead of reporting the useless "; expected".
846
847         Drop the strings from the token declaration, it turns out that
848         they did not do what I thought they did.  Instead they were adding
849         two sets of tokens to the tables.
850
851 2008-09-09  Marek Safar  <marek.safar@gmail.com>
852
853         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
854         delegate.cs: Share special type check.
855
856 2008-09-09  Marek Safar  <marek.safar@gmail.com>
857
858         A fix for bug #423981
859         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
860
861 2008-09-09  Marek Safar  <marek.safar@gmail.com>
862
863         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
864         ConvertImplicitly.
865
866 2008-09-09  Marek Safar  <marek.safar@gmail.com>
867
868         A fix for bugs: #324750, #335946
869         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
870         lookup rule to determine ?-based tokens.
871
872 2008-09-08  Miguel de Icaza  <miguel@novell.com>
873
874         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
875         expressions (like event adding or removing) end up here, so we
876         need to treat those as statements.
877
878         Add LoadAssembly method.
879
880 2008-09-04  Miguel de Icaza  <miguel@novell.com>
881
882         * repl.cs: Add Time method.
883
884 2008-09-05  Marek Safar  <marek.safar@gmail.com>
885
886         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
887
888 2008-09-05  Miguel de Icaza  <miguel@novell.com>
889
890         * repl.cs: Add workaround for old compilers.
891
892 2008-09-04  Jb Evain  <jbevain@novell.com>
893
894         * repl.cs (PrettyPrint): pretty print everything that
895         implements IDictionary, as well as IEnumerables. Also,
896         add a quit helper property.
897
898 2008-09-04  Marek Safar  <marek.safar@gmail.com>
899
900         * constant.cs: Better error reporting for decimal literals.
901         
902         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
903         field attributes.
904         
905 2008-09-04  Marek Safar  <marek.safar@gmail.com>
906                         Miguel de Icaza  <miguel@novell.com>
907
908         A fix for bug #422951
909         * assign.cs (Assign.DoResolve): Perform the type conversions
910         checks before we attempt to initialize `New' initializers. 
911
912 2008-09-04  Marek Safar  <marek.safar@gmail.com>
913
914         A fix for bug #422853
915         * delegate.cs (DelegateCreation): Add special handling for
916         EmptyExpression.Null instance expression which is just another
917         hack for undecided member instance exression.
918
919 2008-09-04  Marek Safar  <marek.safar@gmail.com>
920
921         * expression.cs, ecore.cs: Emit full expression tree for reduced
922         binary expressions.
923
924 2008-09-04  Marek Safar  <marek.safar@gmail.com>
925
926         * expression.cs (This): Guard against multi-resolving.
927         
928         * ecore.cs, statement.cs (Throw): Simplified.
929         
930         * flowanalysis.cs: Also verify event fields.
931
932 2008-09-04  Miguel de Icaza  <miguel@novell.com>
933
934         * assign.cs (Assign.DoResolve): Perform the type conversions
935         checks before we attempt to initialize `New' initializers. 
936
937         * repl.cs (PrettyPrint): Add Hashtable prettyprint
938
939         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
940         public. 
941
942         * repl.cs: Update help.
943
944 2008-09-03  Miguel de Icaza  <miguel@novell.com>
945
946         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
947         handling of the default config handling, including the special
948         treatment of System.Core assembly. 
949
950         Fixes the REPL processing for LINQ.
951
952 2008-09-03  Marek Safar  <marek.safar@gmail.com>
953
954         A fix for bug #422507
955         * expression.cs (UnboxCast): Add missing child expression mutator.
956
957 2008-09-03  Marek Safar  <marek.safar@gmail.com>
958
959         * driver.cs: Don't self reference System.Core assembly.
960
961 2008-09-03  Marek Safar  <marek.safar@gmail.com>
962
963         A fix for bug #422507
964         * expression.cs (StringConcat): Add missing type mutator.
965
966 2008-09-03  Marek Safar  <marek.safar@gmail.com>
967
968         * generic.cs (TypeInferenceContext): Follow equality rule for
969         constructed type lower bound type inference.
970
971 2008-09-02  Miguel de Icaza  <miguel@novell.com>
972
973         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
974         <dblank@cs.brynmawr.edu> which updates the cursor position on
975         refresh.
976         
977 2008-09-02  Marek Safar  <marek.safar@gmail.com>
978
979         A fix for bug #367145
980         * driver.cs: Fixed import of extension methods when using -noconfig
981         option.
982
983 2008-09-02  Marek Safar  <marek.safar@gmail.com>
984
985         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
986         version from non-generic implementation instead.
987
988 2008-09-01  Marek Safar  <marek.safar@gmail.com>
989
990         A fix for bug #418908
991         * class.cs: Use AddScopeStatement for field initializers.
992
993 2008-09-01  Marek Safar  <marek.safar@gmail.com>
994
995         A fix for bug #415385
996         * ecore.cs, convert.cs: Do method group conversion for equal group types.
997
998 2008-09-01  Marek Safar  <marek.safar@gmail.com>
999
1000         A fix for bug #421736
1001         * iterators.cs: Don't crash on unreachable iterators.
1002
1003 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1004
1005         A fix for bug #421628
1006         * parameter.cs, attribute.cs: Clone also parameter attributes.
1007
1008 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1009
1010         * namespace.cs (LookupType): In EvalMode, try to replace
1011         the TypeBuilder from our cache with a Type as Reflection.Emit does
1012         not  like to mix code from older assemblies emitted and new
1013         assemblies emitted. 
1014
1015         This sounds like a serious Mono bug that prevents multiple
1016         assemblies to be generated and consumed at the same time.
1017
1018         * cs-parser.jay (push_current_class): Do not make interactive
1019         classes internal or private, make them public as we currently
1020         generate each new class in a new assembly.   
1021
1022 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1023
1024         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1025         remove types that are entered into the global namespace during
1026         parsing so that we can remove them on failure.
1027  
1028         * cs-parser.jay: Parsing: we now keep track of types that are
1029         entered into global variables and queue those in case the parsing
1030         or resolution fail.
1031  
1032         This happens in a few situations: during partial-input, we invoke
1033         the parser repeatedly for example with the string "class X", this
1034         would cause X to be registed, and we need to remove this
1035         registration so that another parse attempt later with say "class X {"
1036         would actually work.
1037  
1038         Additionally, if there is an error in the resolution phase, for
1039         example: "class X : NonExistant {}" th
1040         
1041         * cs-parser.jay: Be more precise with the errors being raised,
1042         instead of flagging all exceptions during parsing to be attributed
1043         to the parsing process, distinguish those from errors happening in
1044         the actions and hint that using -v would produce the actual
1045         exception. 
1046
1047         * repl.cs: Do not load all compiler references on each reset,
1048         doing the partial reset takes care of this.
1049         
1050 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1051
1052         * repl.cs: Add support for loading all the files from
1053         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1054         as shell libraries.
1055
1056         Introduce a micro-parser that is able to deambiguate on its input
1057         whether we are dealing with a compilation unit (namespace, class,
1058         interface, struct, delegate) declaration or a statement.   This
1059         allows both declarations and statements to be entered. 
1060
1061         Set history size by default to 300 lines.
1062
1063         Instead of distinguishing based on the parser.InteractiveResult,
1064         have only two cases: statements were parsed, or a compilation unit
1065         was.   Always pull the Using statement additions from the
1066         compilation unit parse.
1067         
1068         * cs-tokenizer.cs: Rename tokens to better describe their intent
1069         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1070         
1071         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1072         EvalMode is used to trigger the lookup of global variables while
1073         StatementMode is used turn variable declarations into static
1074         fields.
1075
1076         * getline.cs: Allow history size to be set.
1077         
1078 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1079
1080         A fix for bug #360755
1081         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1082
1083 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1084
1085         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1086         
1087         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1088         member name, it is too confusing
1089         
1090         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1091         
1092         * rootcontext.cs: Finally default to warning level 4.
1093
1094 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1095
1096         * class.cs (CheckBase): Ignore overloaded operators.
1097
1098 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1099
1100         A fix for bug #420830
1101         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1102
1103 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1104
1105         A fix for bug #420832
1106         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1107
1108 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1109
1110         A fix for bug #420386
1111         * nullables.cs: Fixed logic of nullable user comparison operators involving
1112         null values.
1113
1114 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1115         
1116         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1117
1118 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1119
1120         * repl.cs: Add support for aborting the running code with C-c. 
1121
1122 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1123
1124         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1125
1126 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1127
1128         * cs-parser.jay (interactive_statement_list): A new set of rules
1129         for hosting statements that uses the "interactive_" prefix.   
1130
1131         * repl.cs: Add support for parsing `using' as a statement or as a
1132         directive.  Deambiguating before passing this to the parser.
1133
1134         We need to distinguish statement_expressions that occur at the
1135         toplevel vs those that occur embedded into expressions.
1136
1137         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1138         that fixes the cursor key handling, and a history bug.
1139         
1140 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1141
1142         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1143         limitations in Console, instead the 2.0 bootstrap libraries now
1144         include the Console bits.
1145
1146         Also, remove the use of Nullables from getline.cs
1147
1148         ------------
1149         
1150         Interactive support for the C# compiler.   Use gmcs --shell to
1151         enter a read-eval-print loop shell.
1152
1153         Docs: http://www.mono-project.com/CsharpRepl
1154         
1155         * sources: include repl.cs here and getline.cs for gmcs.exe,
1156         everything else is getline.cs impaired.
1157
1158         * Makefile: when bootstrapping pass a special flag
1159         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1160         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1161         This distinguishes those two cases.
1162
1163         * repl.cs: Support for a read-eval-print loop.   Will be soon
1164         refactored into eval support and then REPL on top of it.
1165
1166         * ecore.cs: If a simplename lookup fails, before erroring out,
1167         if we are in EvalMode to resolve the name to a declaration in the
1168         Eval-land.    
1169
1170         This means that variable declarations that happened in previous
1171         classes (as repl puts every statement in a separate class) are
1172         made visible in this way.
1173
1174         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1175         triggered an error due to the end of file being reached.   This is
1176         used to do multi-line input, and notify the caller that the user
1177         needs to provide more text before a successful parse.
1178
1179         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1180         to drive the evaluation with a custom wrapper. 
1181
1182         * driver.cs: Add support for --shell, and refactor some code to be
1183         reused from repl.cs
1184         
1185         * namespace.cs: Add support for serializing the contents of the
1186         namespaces and reloading them.  
1187
1188         * getline.cs: A managed implementation of ReadLine under
1189         X11/Apache2 license terms.  Easy to embed in other applications as
1190         well.
1191
1192         * namespace.cs: Add some functions to save and restore the
1193         namespace state.
1194
1195         * rootcontext.cs: New public field.
1196
1197         * cs-tokenizer.cs: Add support for one of the possible characters
1198         we introduce into the token stream.  
1199
1200         This patch does not affect the regular tokenization process, the
1201         only performance hit would happen if there is an invalid character
1202         on the input string.
1203
1204         * support.cs: Move isatty helper routine here.
1205
1206         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1207         code generator for in-memory assemblies.
1208
1209 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1210
1211         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1212         parameter cannot be always used as a type.
1213
1214 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1215
1216         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1217
1218 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1219
1220         * convert.cs: Implement explicit array to IList<T> conversion.
1221
1222 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1223
1224         A fix for bug #362740
1225         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1226
1227 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1228         
1229         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1230         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1231         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1232         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1233         handling to use just one type of infrastructure and deal with generics
1234         more effectivelly.
1235
1236 2008-07-23  Martin Baulig  <martin@ximian.com>
1237
1238         *** Merged this from trunk revision 108527 ***
1239
1240         * statement.cs
1241         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1242         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1243         scope variable.
1244
1245 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1246         
1247         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1248         error checks.
1249
1250 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1251         
1252         * delegate.cs: Fixed compiler crash when creating delegate using partial
1253         method.
1254         
1255         * typemanager.cs: MulticastDelegate is not a delegate.
1256
1257 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1258         
1259         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1260         checks.
1261
1262 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
1263
1264         * cs-parser.jay (type): Allow 'var' in mcs too.
1265         (local_variable_type): Likewise.
1266
1267 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1268         
1269         * driver.cs: Removed broken -noconfig variants.
1270
1271 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1272         
1273         A fix for bug #417078
1274         * expression.cs: Emit correctly left side pointer operators.
1275
1276 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1277
1278         * generic.cs, lambda.cs: Inflate method generic arguments only.
1279
1280 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1281
1282         * class.cs: Fixed struct layout check regression.
1283
1284 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1285
1286         * cs-parser.jay, enum.cs: Simplified enum parsing.
1287         
1288         * decl.cs: Check all type parameters conflicts.
1289         
1290         * expression.cs, statement.cs, attribute.cs: More expression checks.
1291
1292 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1293
1294         * generic.cs: Add type inference types restriction.
1295         
1296         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1297         anonymous.cs, expression.cs: Allocate less accessor parameters.
1298
1299 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1300
1301         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1302         classes.
1303
1304 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1305
1306         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1307
1308 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1309
1310         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1311         Also fixes #362146 and #381592.
1312
1313 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1314
1315         * ecore.cs: Reduced constant cannot be used as an attribute value.
1316         
1317         * cs-parser.jay: Base expression has to be a type.
1318         
1319         * expression.cs (Conditional): Uses ReducedExpression.
1320
1321 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1322
1323         A fix for bug #376826
1324         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1325         address of hoisted local variable or parameter cannot be taken.
1326
1327 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1328
1329         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1330         anonymous method inside checked/unchecked expression.
1331
1332 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1333
1334         * typemanager.cs (IsEqual): Guard against null.
1335         
1336         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1337         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1338         routine. Fixed few misleading conversion errors.
1339
1340 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1341
1342         * class.cs: Consider generics when checking cycles in struct layout.
1343
1344 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1345
1346         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1347
1348 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1349
1350         A fix for bug #414165
1351         * anonymous.cs: Use same anonymous implementation method for all anonymous
1352         method emits.
1353
1354 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1355
1356         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1357         constraints.
1358
1359 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1360
1361         * cs-parser.jay: Typeof argument has to be a type expression.
1362         
1363         * namespace.cs: Check alias and namespace definitions collisions.
1364         
1365         * class.cs, pending.cs: Moved explicit interface accessor implementation
1366         check.
1367         
1368         * delegate.cs, expression.cs: Verify special name invocations.
1369         
1370 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1371
1372         * cs-parser.jay: Don't choke on empty generic type arguments.
1373         
1374         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1375         
1376         * expression.cs, ecore.cs: Minor expressions bugs.
1377
1378 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1379
1380         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1381         and added more error handling.
1382         
1383         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1384         
1385         *  modifiers.cs, enum.cs: Fixed.
1386
1387 2008-07-31  Jb Evain  <jbevain@novell.com>
1388
1389         * driver.cs: remove -pkg ability of smcs.
1390
1391 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1392
1393         * statement.cs (Switch): Correctly set empty default target for single
1394         blocks.
1395
1396 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1397
1398         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1399         string switch statement implementation to use string dictionary which
1400         significantly (2-8x) improves performance of generated code.
1401
1402 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1403
1404         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1405         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1406         
1407 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1408
1409         A fix for bug #412595
1410         * typemanager.cs, convert.cs, expression.cs: Some types are never
1411         convertible to each other.
1412
1413 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1414
1415         * nullable.cs (CreateNullConstant): An error messages update.
1416
1417 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1418
1419         A fix for bug #412595
1420         * cfold.cs: Don't cast undefined bool constant.
1421
1422 2008-07-29  Martin Baulig  <martin@ximian.com>
1423
1424         * symbolwriter.cs
1425         (SymbolWriter.Reset): New public static method.
1426
1427         * driver.cs
1428         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1429
1430 2008-07-28  Marek Safar  <marek.safar@gmail.com>
1431
1432         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1433         
1434         * expression.cs (ElementAccess): Exact size allocation.
1435
1436 2008-07-26  Marek Safar  <marek.safar@gmail.com>
1437
1438         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1439
1440 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1441
1442         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1443         
1444         * class.cs: Removed $PRIVATE$ field hack which caused problems during
1445         flow analysis.
1446
1447 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1448
1449         A fix for bug #412217
1450         * assign.cs: Mutate also assignment type.
1451
1452 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1453
1454         A fix for bug #323644
1455         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1456         indexers.
1457
1458 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1459
1460         A fix for bug #412134
1461         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1462         non-enumerable operands when overloading equality or bitwise operators.
1463
1464 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1465
1466         * anonymous.cs: Cache closed generic anonymous method delegates.
1467
1468 2008-07-24  Marek Safar  <marek.safar@gmail.com>
1469
1470         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
1471         anonymous.cs, statement.cs: Always emit anonymous method as static method
1472         when is instance free. Use nesting for nested anynomous methods blocks.
1473         
1474 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1475
1476         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1477         types.
1478
1479 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1480
1481         * expression.cs: Removed MakeSimpleCall.
1482
1483 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1484
1485         A fix for bug #323012
1486         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1487         Base method implementing interface has to be public.
1488
1489 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1490
1491         * cs-parser.jay: Don't break on missing argument.
1492
1493 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1494
1495         A fix for bug #320993
1496         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1497           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1498
1499 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1500
1501         A fix for bug #320748
1502         * convert.cs: Implicit user operators cannot convert to interfaces
1503
1504 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1505
1506         A fix for bug #312686
1507         * driver.cs: Ignore empty assembly references.
1508
1509 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1510
1511         A fix for bug #387040
1512         * ecore.cs: Skip constrains check for an explicit implementation.
1513
1514 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1515
1516         A fix for bug #409045
1517         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1518           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1519           identifiers are file specific unless passed as input arguments.
1520
1521 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1522
1523          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1524          to emit UnmanagedMarshal data under 2.0 profile.
1525
1526 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1527
1528         A fix for bug #410369
1529         * parameter.cs: Clone correctly ParamsParameter.
1530
1531 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1532
1533         * expression.cs (Argument): Always report type for type based expressions
1534         errors.
1535
1536 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1537
1538         A fix for bug #410666
1539         * anonymous.cs: Correctly initialize generic storey reference.
1540
1541 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1542
1543         * convert.cs: Don't box same type arguments.
1544
1545 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1546
1547         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1548         Finished missing generic type mutators.
1549
1550 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1551
1552         * iterators.cs, statement.cs: Finished statements CloneTo.
1553
1554 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1555
1556         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1557         
1558         * expression.cs: Emit optimized default value expressions in expression tree
1559         array initializer.
1560
1561 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1562
1563         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1564
1565 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1566
1567         A fix for bug #367536
1568         * cs-parser.jay: Check static constructor of generic types for an access
1569         modifier.
1570
1571 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1572
1573         A fix for bug #353800
1574         * lambda.cs: Emit ret for contextual statements.
1575         
1576         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1577         up emitting redundant ret for all anonymous methods with return.
1578
1579 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1580
1581         A fix for bug #365188
1582         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1583         create anonymous method storey in unreachable block.
1584
1585 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1586
1587         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1588         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1589         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1590         statement.cs: Fixed relevant defects found by Gendarme.
1591
1592 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1593
1594         A fix for bug #325291
1595         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1596         statement.cs: Replaced IAnonymousHost with top level block flag.
1597
1598 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1599
1600         * cs-parser.jay: Clean up unused open_parens.
1601
1602 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1603
1604         * ecore.cs: Custom error message for a range variable assignment.
1605
1606 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1607
1608         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1609         load.
1610
1611 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1612
1613         * literal.cs: Null literal is of object type.
1614
1615 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1616
1617         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1618         expression of nullable equality comparison.
1619
1620 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1621
1622         * expression.cs(PointerArithmetic): Removed redundant assignment.
1623
1624 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1625
1626         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1627
1628 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1629
1630         A fix for bug #408361
1631         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1632         they are replaced by GetMethod.
1633
1634 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1635
1636         A fix for bug #408721 by jeremie.laval@gmail.com
1637         * expression.cs (Indirection): Implemented CloneTo.
1638
1639 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1640
1641         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1642         assert check.
1643
1644 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1645
1646         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1647
1648 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1649
1650         * linq.cs: Reset tranparent parameter counter in probing mode.
1651
1652 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1653
1654         * anonymous.cs: Mutate anonymous method type.
1655
1656 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1657
1658         * ecore.cs, anonymous.cs: Mutate field expressions.
1659
1660 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1661
1662         A fix for bug #369670
1663         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1664
1665 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1666
1667         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1668
1669 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1670
1671         Fix bug #314902
1672         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1673         only one '>', and finds a '>>', abort the generic lookahead.
1674
1675 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1676
1677         A fix for bug #319902
1678         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1679
1680 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1681
1682         A fix for bug #406371
1683         * statement.cs: Moved EmitSymbolInfo to Block.
1684
1685 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1686
1687         * ecore.cs: Report better error for extension method overload failures.
1688
1689 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1690
1691         * expression.cs (Is): No need to box reference values.
1692
1693 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1694
1695         * class.cs: Use event resolve context when initializing CreateEmitContext.
1696
1697 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1698
1699         A fix for bug #394436
1700         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1701         method used inside expression trees. Added more LINQ to expression tree
1702         conversions.
1703
1704 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1705
1706         A fix for bug #378189, #370577
1707         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1708         from expression.
1709
1710 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1711
1712         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1713         hierarchically.
1714
1715 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1716
1717         A fix for bug #406702
1718         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1719
1720 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1721
1722         A fix for bug #406648
1723         * cs-parser.jay: Report nullable use in mcs for some cases.
1724
1725 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1726
1727         * ecore.cs: Improved argument mismatch error messages.
1728
1729 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1730
1731         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1732
1733 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1734
1735         * expression.cs (TypeOf): Mutate type argument.
1736
1737 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1738
1739         * class.cs: Report missing partial modifier for correct type.
1740
1741 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1742
1743         * ecore.cs, expression.cs (VariableReference): Variable property is 
1744         protected.
1745
1746 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1747
1748         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1749         
1750 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1751
1752         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1753         method delegates.
1754
1755 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1756
1757         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1758         anonymous method storey to an instance method when only "this" is hoisted.
1759
1760 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1761
1762         A fix for bug #321615
1763         * expression.cs: Pointer comparisons use unsigned operator.
1764
1765 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1766
1767         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1768
1769 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1770
1771         A fix for bug #404905
1772         * class.cs: Always initialize local unsafe variables.
1773
1774 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1775
1776         A fix for bug #396987
1777         * expression.cs (NewInitialize): Clear local temporary variable for next run
1778
1779 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1780
1781         A fix for bug #401020
1782         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1783
1784 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1785
1786         A fix for bug #398319
1787         * cs-parser.jay: Implemented undocumented base access expression inside
1788         anonymous types.
1789
1790 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1791
1792         A fix for bug #404227
1793         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1794
1795 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1796
1797         A fix for bug #404227
1798         * convert.cs: Fixed explicit array to interface cast.
1799
1800 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1801
1802         A fix for bug #403894
1803         * delegate.cs: Mutate DelegateInvocation type.
1804
1805 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1806
1807         A fix for bug #379348
1808         * delegate.cs: Box a load of generic parameters.
1809
1810 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1811
1812         * expression.cs: Add an array creation arguments mutate.
1813
1814 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1815
1816         A fix for bug #386068
1817         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1818         parameter.
1819
1820 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1821
1822         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1823         CloneTo.
1824
1825 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1826
1827         A fix for bug #403518
1828         * delegate.cs: Type correctly anonymous method new invocation.
1829
1830 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1831
1832         A fix for bug #394826
1833         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1834         calls.
1835
1836 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1837
1838         A fix for bug #394826
1839         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1840         needed.
1841
1842 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1843
1844         * class.cs: Clone indexer parameters for localized capturing.
1845
1846 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1847
1848         A fix for bug #402379
1849         * expression.cs: Don't crash when an object initializer resolve fails.
1850
1851 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1852
1853         A fix for bug #402888
1854         * expression.cs: Mutate conditional expression.
1855
1856 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1857
1858         A fix for bug #401012
1859         * class.cs: Keep StructLayout in shared container.
1860
1861 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1862
1863         A fix for bug #400438
1864         * decl.cs, class.cs: Only properties can be automatically implemented.
1865
1866 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1867
1868         * statement.cs (ChangeToIterator): Copy also labels.
1869
1870 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1871
1872         * ecore.cs: Pass type argument details to parent extension method.
1873
1874 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1875
1876         A fix for bug #375966
1877         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1878
1879 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1880
1881         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1882
1883 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1884
1885         A fix for bug #394347
1886         * anonymous.cs: Cache compatible delegates as compatibility check produces
1887         a new method every time.
1888
1889 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1890
1891         * anonymous.cs: Propagate storey reference for single references.
1892
1893 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1894
1895         A fix for bug #387615
1896         * assign.cs, expression.cs: Correctly clone compound assignment.
1897
1898 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1899
1900         A fix for bug #359611, #359604
1901         * anonymous.cs: Mutate all types of hoisted parameters.
1902
1903 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1904
1905         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1906         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1907         expression.cs, codegen.cs, statement.cs
1908         
1909         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1910         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1911         
1912         ** Anonymous methods, lambda expressions rewrite **
1913         
1914         Anonymous expressions are now resolved when an explicit block is resolved 
1915         and they don't require any registration procedure anymore. Further,
1916         anonymous methods are defined when explicit block is emitted which allows
1917         better control of whole process and opens possibilities for more
1918         optimizations as well as alternative to reverse whole process.
1919         
1920         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1921         process consistent and to correctly emit hoisted generic methods when they
1922         have at least 1 hoisted variable.
1923         
1924 2008-06-17  Martin Baulig  <martin@ximian.com>
1925
1926         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1927         iterator method.
1928         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1929         virtual property; check it in Emit().
1930         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1931         an iterator.
1932         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1933         an iterator.
1934         (Indexer.Define): Likewise.
1935
1936 2008-06-17  Marek Safar  <marek.safar@gmail.com>
1937
1938         * convert.cs: Don't use IsInterface on type arguments.
1939         
1940         * delegate.cs: DelegateInvocation uses MethodInfo.
1941         
1942         * parameter.cs: Removed IsTypeParameter.
1943         
1944         * generic-mcs.cs: More missing stuff.
1945
1946 2008-06-16  Martin Baulig  <martin@ximian.com>
1947
1948         * modifiers.cs
1949         (Modifiers.DEBUGGER_HIDDEN): New public const.
1950
1951         * typemanager.cs
1952         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1953
1954         * class.cs
1955         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1956         (AbstractPropertyEventMethod): Likewise.
1957         (Constructor.Emit): Likewise.
1958         (SourceMethod.SetCompilerGenerated): Removed.
1959
1960         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1961         on MoveNext().
1962
1963         * anonymous.cs
1964         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1965         if we're an `IteratorHost'.
1966         (AnonymousMethodMethod..ctor): Don't set
1967         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1968         not on the method.
1969
1970 2008-06-16  Marek Safar  <marek.safar@gmail.com>
1971
1972         * statement.cs: Clean-up foreach statements.
1973
1974 2008-06-12  Marek Safar  <marek.safar@gmail.com>
1975
1976         * class.cs: Stop using public method which should not exist
1977         (MethodBuilder.SetGenericMethodSignature).
1978
1979 2008-06-11  Martin Baulig  <martin@ximian.com>
1980
1981         * location.cs
1982         (Location.LookupFile): Add `CompilationUnit' argument; when given
1983         a relative file name, make it relative to the directory the .cs
1984         file is located in instead of using the current directory.
1985
1986 2008-06-11  Martin Baulig  <martin@ximian.com>
1987
1988         * class.cs
1989         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1990         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1991         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1992         (SourceMethod.SetCompilerGenerated): Likewise.
1993
1994 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1995
1996         * codegen.cs, driver: Only write symbol file when it's asked for.
1997
1998 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1999
2000         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2001
2002 2008-06-10  Martin Baulig  <martin@ximian.com>
2003
2004         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2005
2006 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2007
2008         A fix for bug #316290
2009         * expression.cs: Include decimal operators in predefined table.
2010         
2011         * parameters.cs: More readonlyness.
2012
2013 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2014
2015         A fix for bug #397213
2016         * cs-parser.jay: One more missing current_local_parameters reset.
2017
2018 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2019
2020         A fix for bug #396633
2021         * class.cs: Host backing field in partial container.
2022
2023 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2024
2025         A fix for bug #397068
2026         * expression.cs: Check both operand types when predefined operator is used.
2027
2028 2008-06-05  Martin Baulig  <martin@ximian.com>
2029
2030         Merged the `debugger-kahalo' branch.
2031
2032         * class.cs
2033         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2034         we're an iterator method.
2035         (SourceMethod): Reflect latest symbol writer changes;
2036         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2037         now `start_row' and `end_row'.
2038         (Constructor.Emit): Fix the logic whether to emit symbol information.
2039
2040         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2041         generated methods.
2042
2043         * location.cs
2044         (CompilationUnit): New public class; derives from `SourceFile'.
2045         (SourceFileEntry.DefineSymbolInfo): New public method.
2046         (SourceFileEntry.SetChecksum): New public method.
2047         (Location): Encode hidden line numbers by using `column == 255';
2048         the .ctor now accepts `column == -1' to mark a hidden line number.
2049         (Location.Hidden): New public property.
2050         (Location.CheckPoint): Add `CompilationUnit'.
2051         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2052         (Location.Push): Add `CompilationUnit compile_unit' argument.
2053         (Location.CompilationUnit): New public property.
2054
2055         * statement.cs
2056         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2057
2058         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2059
2060         * driver.cs: `SourceFile' -> `CompilationUnit'.
2061
2062         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2063
2064         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2065
2066         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2067         `#line hidden'.
2068
2069         * symbolwriter.cs
2070         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2071         new symbol writer API to also pass the file.
2072
2073 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2074
2075         * statement.cs: Emit catch variable assignment using variable expression.
2076         
2077 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2078
2079         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2080         with other variable types.
2081
2082 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2083
2084         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2085         GetLength method emit, it breaks resolve rules.
2086         
2087 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2088             Marek Safar  <marek.safar@gmail.com>
2089                         
2090         A fix for bug #395542
2091         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2092         declaration.
2093         
2094 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2095
2096         A fix for bug #395287
2097         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2098
2099 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2100
2101         A fix for bug #395845
2102         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2103         non-nullable parameter type.
2104         
2105 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2106
2107         * class.cs: Handle contructor initializer as a statement in top-level block.
2108
2109 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2110
2111         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2112         security attributes.
2113
2114 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2115
2116         * ecore.cs, expression.cs: Small IVariable refactoring.
2117
2118 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2119
2120         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2121
2122 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2123
2124         * cs-parser.jay: Removed redundant catch type check.
2125
2126 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2127
2128         A fix for bug #390372
2129         * nullable.cs: Set correct return type.
2130
2131 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2132
2133         A fix for bug #391062
2134         * typemanager.cs: Fixed crash when comparing null types.
2135
2136 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2137
2138         A fix for bug #391871
2139         * cs-parser.jay: Better error handling for invalid catch type.
2140
2141 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2142
2143         A fix for bug #392155
2144         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2145
2146 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2147
2148         A fix for bug #390666
2149         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2150         expressions.
2151
2152 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2153
2154         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2155         in getter.
2156
2157 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2158
2159         A fix for bug #389625
2160         * delegate.cs, generic.cs: Some progress on method group return type
2161         inference.
2162
2163 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2164
2165         A fix for bug #378419
2166         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2167
2168 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2169
2170         * class.cs (Constructor): Added IsCompilerGenerated.
2171
2172 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2173
2174         * expression.cs: Enum binary operators can accept non-enum operand only when
2175         is implicitly convertible to underlying type.
2176
2177 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2178
2179         A fix for bug #389272
2180         * support.cs: Workaround System.InvalidOperationException for enums.
2181
2182 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2183
2184         A fix for bug #389073
2185         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2186
2187 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2188
2189         * driver.cs: Split Parse.
2190         
2191         * location.cs (LookupFile): Uses string.Empty.
2192
2193 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2194
2195         * expression.cs, parameter.cs: Small ParameterReference clean up.
2196
2197 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2198
2199         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2200         hack. Fixes #387502.
2201
2202 2008-05-06  Martin Baulig  <martin@ximian.com>
2203
2204         * class.cs (Constructor.Emit): Fix the logic whether to emit
2205         symbol information.
2206
2207 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2208
2209         Fix #385503
2210         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2211         InvalidOperationException when the iterator is before the start or
2212         after the end.
2213
2214 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2215
2216         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2217         when left is nullable type.
2218
2219 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2220
2221         A fix for bug #386628
2222         * expression.cs (LocalVariableReference): Continue in resolving when
2223         variable is not assigned.
2224
2225 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2226
2227         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2228         nullable operations.
2229
2230 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2231
2232         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2233         it saves many redundant temporary variables for nullable operations.
2234
2235 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2236
2237         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2238         
2239         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2240         method.
2241         
2242         * nullable.cs: Constant coalescing operator optimizations.
2243
2244 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2245
2246         * constant.cs: Use unsigned conversion for values which are unsigned only.
2247
2248 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2249
2250         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
2251         coalescing operator as it should be.
2252
2253 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2254
2255         A fix for bug #371016
2256         * expression.cs: All predefined delegate operators require implicit method
2257         group conversion.
2258         
2259 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2260
2261         * constant.cs: Emit long constant as uint when fits the range.
2262         
2263         * convert.cs, expression.cs: Fixed few unsafe conversions.
2264
2265 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2266
2267         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2268
2269 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2270
2271         Fix #385758
2272         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2273         'expr'.
2274         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2275
2276 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2277
2278         * constant.cs, literal.cs: IsLiteral property for error reporting.
2279         
2280         * ecore.cs, expression.cs: Implemented Property expression.
2281
2282 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2283
2284         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2285         
2286         * nullable.cs: Implemented nullable coalescing null operator.
2287
2288         * ecore.cs, expression.cs: Expression trees work.
2289
2290 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2291
2292         * ecore.cs: CreateExpressionTree is finally abstract.
2293
2294         * expression.cs, linq.cs: Updated.
2295
2296 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2297
2298         * expression.cs, ecore.cs: Block base access expression inside expression
2299         tree.
2300
2301 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2302
2303         A fix for bug #385058
2304         * expression.cs: User-defined operator implementations always take
2305         precedence over predefined operator implementations.
2306
2307 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2308
2309         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2310         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2311         expression tree conversions.
2312         
2313 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2314
2315         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2316         operators method details to Operator class.
2317
2318 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2319
2320         * anonymous.cs: Pass unsafe flags to anonymous container.
2321         
2322         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2323         inside expression tree.
2324
2325 2008-04-29  Martin Baulig  <martin@ximian.com>
2326
2327         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2328         (Tokenizer.PopPosition): Also restore the `line'.
2329
2330 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2331
2332         * delegate.cs: Implemented Invoke expression.
2333
2334 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2335
2336         * expression.cs: Fixed equality reference comparison regression.
2337
2338 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2339
2340         * ecore.cs: Clean up EmptyCast hack.
2341         
2342         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2343         using correct conversion rules. Also fixes #383993.
2344
2345 2008-04-28  Martin Baulig  <martin@ximian.com>
2346
2347         * class.cs (Constructor.Emit): Don't emit debugging information
2348         for generated default .ctor's.
2349
2350 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2351
2352         * convert.cs: Empty-cast ushort to int conversion.
2353
2354 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2355
2356         A fix for bug #384191
2357         * ecore.cs, expression.cs: Fixed expression cloning.
2358
2359 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2360
2361         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2362
2363 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2364
2365         Fix #381559, test-638.cs, test-639.cs
2366         * assign.cs (CompoundAssign.Helper): New wrapper.
2367         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2368         access.
2369         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2370         Pass unconverted expressions to the params array creation expression.
2371         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2372         (PropertyExpr.EmitAssign): Likewise.
2373         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2374         element if it is of kind CompoundAssign.Helper.
2375         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2376         first before anything else.
2377         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2378         (ArrayAccess.LoadArrayAndArguments): Simplify.
2379
2380 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2381
2382         * expression.cs: Fixed cloning of typeof(void).
2383
2384 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
2385
2386         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2387         (Assign.Emit): Likewise.  Move it to ...
2388         (CompoundAssign.DoResolve): ... here and ...
2389         (CompoundAssign.Emit): ... here.
2390         (EventAddOrRemove): New helper to handle += and -= on events, and
2391         avoid the use of BinaryDelegates.
2392         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2393         (EventExpr.EmitAddOrRemove): Improve.
2394         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2395
2396         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2397         create VarExprs for 'foo.bar.var'.
2398         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2399         is a highly inappropriate name for its functionality.
2400
2401 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2402
2403         Simplify handling of multiple assignments
2404         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
2405         inheritable-only.
2406         (SimpleAssign): New.  Class to be used for normal assignments.
2407         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2408         * expression.cs, parameter.cs, statement.cs: Likewise.
2409
2410 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2411
2412         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2413         for incompatible underlying types, more to come, uff.
2414
2415 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2416
2417         Fix gtest-388.cs
2418         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2419         Handle 'leave_copy'.
2420
2421 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2422
2423         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2424
2425 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
2426
2427         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
2428         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2429         * statement.cs (While, Do, For): Allow test to have side effects.
2430         (For.DoEmit): Always emit InitStatement.
2431
2432         Fix test-635.cs
2433         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2434         Always create SideEffectConstant.
2435         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2436         of type EnumConstant.
2437
2438         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2439         Handle 'right' being SideEffectConstant of type 'bool'.
2440
2441         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2442         Use left.EmitBranchable instead of open coding it, so as to
2443         improve optimization opportunities.
2444
2445         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2446
2447         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2448         assumptions.
2449         (Expression.EmitSideEffect): Document.
2450
2451 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2452
2453         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2454
2455 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2456
2457         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2458
2459 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2460
2461         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2462         conversion to expression tree.
2463
2464 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2465
2466         * ecore.cs: Removed unused expression.
2467
2468 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2469
2470         * expression.cs: Implemented NegateChecked and New expressions.
2471
2472 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2473
2474         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2475
2476 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
2477
2478         Fix #351102
2479         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2480         needing final 'ret' instruction.
2481
2482 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2483
2484         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2485
2486 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2487
2488         * expression.cs: Emit ldnull and not null expression as an instance argument
2489          of static method expression calls.
2490
2491 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2492
2493         A fix for bug #378200
2494         * expression.cs: Fixed crash when creating parameterless expression tree
2495         method call.
2496
2497 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2498
2499         A fix for bug #375297
2500         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2501         method.
2502
2503 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2504
2505         A fix for bug #377596
2506         * decl.cs, class.cs: Emit delegate type argument attributes.
2507
2508 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2509
2510         A fix for bug #365314
2511         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2512         
2513 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2514
2515         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2516         only.
2517
2518 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2519
2520         * generic.cs (TypeParameter): Removed redundant location.
2521
2522 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2523
2524         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2525         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2526         FullNamedExpression in all declaration type expression, statements will come
2527         later.
2528
2529 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2530
2531         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2532         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2533
2534 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2535
2536         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2537         code.
2538
2539 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2540
2541         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2542         constraints.
2543
2544 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2545
2546         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2547         name expressions.
2548         Also fixes #340463.
2549
2550 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2551
2552         Hook up 'EmitSideEffect'
2553         * constant.cs (Constant.EmitSideEffect): New.
2554         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2555         (SideEffectConstant.EmitSideEffect): New.
2556         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2557         unconditional branch in EmitBranchable.
2558         (FieldExpr.EmitBranchable): New.
2559         * expression.cs (Unary.EmitSideEffect): New.
2560         (Binary.EmitSideEffect): New.
2561         (VariableReference.EmitSideEffect): New.  Do nothing.
2562
2563 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2564
2565         Introduce 'EmitSideEffect'
2566         * ecore.cs (Expression.EmitSideEffect): New.
2567         (TypeCast): Rename from EmptyCast.
2568         (EmptyCast): New.
2569         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2570         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2571         * convert.cs, nullable.cs: Update to changes.
2572
2573 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2574
2575         * class.cs, cs-parser.jay: Early check for base types expression.
2576
2577 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2578
2579         * decl.cs (MemberName): Declare PrettyName as obsolete.
2580
2581 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2582
2583         * namespace.cs: Use MemberName comparison.
2584
2585 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2586
2587         Fix build break
2588         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2589         FullName.
2590         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2591         (MemberName.FullyQualifiedName): New.  Provides the functionality
2592         that users assume FullName would have.
2593         * ecore.cs, namespace.cs: Update to changes.
2594
2595         * statement.cs (Using.assign): Make into ExpressionStatement.
2596         (Using.EmitPreTryBody): Simplify.
2597
2598 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2599
2600         * report.cs: ColorFormat is protected.
2601         
2602         * rootcontext.cs: Unused fields clean-up.
2603         
2604         * namespace.cs: Made UsingEntry name private.
2605
2606 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2607
2608         * cs-tokenizer.cs, location.cs: Removed unused field.
2609
2610 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2611             Raja R Harinath  <harinath@hurrynot.org>
2612
2613         Fix #379822
2614         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2615         (SideEffectConstant.side_effect): Rename from 'right'.
2616         (SideEffectConstant..ctor): Normalize 'side_effect'.
2617         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2618         value of this constant.
2619         * cfold.cs: Update to changes.
2620
2621 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2622
2623         * cs-paser.jay: Removed unused variable.
2624         
2625         * driver.cs: Made Compile instance method.
2626
2627 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2628
2629         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2630
2631 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2632
2633         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2634
2635 2008-04-13  Jb Evain  <jbevain@novell.com>
2636
2637         * namespace.cs: update the System.Core fullname for 2.1
2638         * driver.cs: update the list of required assemblies for 2.1.
2639         Merged from the Moonlight 2 branch.
2640
2641 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2642
2643         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2644         types and user defined operators. User operators arguments has to be checked
2645         for null value before invocation, which also means no operator is called
2646         when any argument is not convertible to unwrapped nullable type.
2647         
2648 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2649
2650         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2651         of Unary expressions to follow operator overloading rules precisely.
2652         Also fixes #321794, #323794
2653         
2654 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2655
2656         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2657         expression.
2658         
2659 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2660
2661         * expression.cs, ecore.cs: Implemented MemberInit expression.
2662         
2663 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2664
2665         Fix mono/tests/exception4.cs
2666         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2667         ec.NeedReturnLabel () rather emitting a 'nop'.
2668
2669         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2670         simple heuristic.
2671         (TryCatch.SomeCodeFollows): Likewise.
2672         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2673         for 'break', 'continue' and 'return' statements inside a try.
2674         We're fairly sure that the generated IL stream will have more
2675         instructions textually following the try.
2676         (FlowBranchingTryCatch): Likewise.
2677
2678         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2679         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2680         overrides.
2681
2682         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2683         wrapper -- forward everything to CollectionForeach.
2684         (CollectionForeach.NonDisposableWrapper): New.
2685         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2686         instead of a pop + branch to end.
2687
2688 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2689
2690         A fix for bug #377485
2691         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2692         Propagate location for extension method groups. Report conversion failure at
2693         right place.
2694
2695 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2696
2697         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2698         ListInit and Field expressions.
2699
2700 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2701
2702         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2703         Since $PC is always -1 inside the body of MoveNext, the fault
2704         handler is a no-op.
2705         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2706         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2707         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2708
2709         The denouement!  Fix #324708
2710         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2711         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2712         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2713         'finally' inside the finally clause.
2714
2715         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2716         inside an iterator.  Don't emit the body of the 'finally' inside
2717         the finally clause yet.
2718
2719         Use the ResumableStatement infrastructure for MoveNext ()
2720         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2721         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2722         'old_resume_points'.  Move dispatcher upfront.
2723         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2724         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2725         in an enumerator.  This encodes the main fix in this patch series
2726         -- we can only jump into the first instruction of a try from the
2727         outside, but we want to emit try/finally regions in iterators and
2728         resume in the middle of them.
2729
2730 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2731
2732         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2733         of NeedReturnLabel here.
2734
2735         Introduce a common point for emitting try/finally to IL
2736         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2737         features of the various subclasses, which are now driven by ...
2738         (ExceptionStatement.EmitPreTryBody): ... this and ...
2739         (ExceptionStatement.EmitTryBody): ... this and the original
2740         EmitFinallyBody.
2741         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2742         Remove DoEmit and update to follow above protocol.
2743
2744         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2745         of the dispatcher are the same, skip emitting the 'switch'.
2746         * iterator.cs (Iterator.EmitDispose): Update to changes.
2747
2748         Clean up handling of 'using' statement
2749         * statement.cs (UsingTemporary): New.  Carved out of ...
2750         (Using): ... this.  Simplify drastically.  Handle exactly
2751         one variable.
2752         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2753         or Using as appropriate.  If there are multiple variable declared,
2754         create nested Using statements.
2755         (resource_acquisition): Kill.
2756
2757         * statement.cs (ExceptionStatement.EmitForDispose): Use
2758         EmitFinallyBody, not EmitFinally.
2759
2760         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2761         * iterator.cs: Update to changes.
2762
2763         Start using the ResumableStatement infrastructure
2764         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2765         (ResumableStatement.EmitForDispose): New.
2766         (ExceptionStatement): Override them.
2767         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2768         EmitForDispose to create the body of the Dispose method.  Don't
2769         use OldResumePoint.
2770
2771         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2772         * statement.cs (Toplevel.AddResumePoint): ... here.
2773         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2774         * flowanalysis.cs (FlowBranchingIterator): New.
2775         * codegen.cs (EmitContext): Update to changes.
2776
2777         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2778         (Iterator.old_resume_points): Rename from 'resume_points'.
2779         (Iterator.MoveNextStatement): Remove unused class.
2780
2781         New infrastructure for try/finally in iterators (still unused)
2782         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2783         (FlowBranchingToplevel.AddResumePoint): Hook into
2784         ToplevelBlock.AddResumePoint.
2785         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2786         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2787         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2788         resume points and assign program-counter values.
2789         (ExceptionBlock.AddResumePoint): Collect resume points for
2790         de-muxer at the top of try block.
2791         * iterators.cs (Yield.CheckContext): Simplify.
2792         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2793
2794 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2795
2796         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2797         argument to an ExitStatement.
2798         (FlowBranchingException): Refactor saved origins code.
2799         * statement.cs (ExitStatement): Update to cahges.
2800         * iterator.cs (YieldBreak): Likewise.
2801
2802         * statement.cs (ResumableStatement): New.  Common base class for
2803         YieldReturn and ExceptionStatement.
2804         (ExitStatement): New.  Common base class for Return and YieldBreak.
2805         (Return): Update to changes.
2806         * iterator.cs (YieldBreak): Likewise.
2807         * lambda.cs (ContextualReturn): Likewise.
2808
2809         Fix #377028
2810         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2811         emit a meaningful error message.
2812
2813         Fix #324765, #319508
2814         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2815         (VariableInfo.SetAssigned): Set it.
2816         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2817         determine if CS0219 or CS0168 is appropriate.  Don't use
2818         flow-analysis information.
2819         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2820         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2821         (EmitContext.EndFlowBranching): ... this.
2822
2823 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2824
2825         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2826
2827 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2828
2829         A fix for bug #376508
2830         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2831         ImplicitConversionExists.
2832
2833 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2834
2835         * expression.cs (Binary): Added remaining binary operators to expression
2836         tree builder.
2837
2838         * nullable.cs: Optimize shift with null argument.
2839
2840 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2841
2842         Fix minor IL regression
2843         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2844         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2845         * cs-parser.jay (try_statement): Update to changes.
2846
2847         * statement.cs (TryFinally.need_exc_block): Delete.
2848         (TryFinally): Update to changes.
2849
2850         Now all ExceptionStatements are unconditional
2851         * statement.cs (CollectionForeach.DisposableWrapper): New.
2852         Extract out the try/finally code into a new wrapper.
2853         (CollectionForeach.Resolve): Use it to simplify the code.
2854
2855 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2856
2857         Start at simplifying ExceptionStatement semantics a bit
2858         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2859         * cs-parser.jay (try_statement): Update to changes.
2860         (opt_catch_clauses): Remove.
2861         * flowanalysis.cs: Update to changes.
2862         (FlowBranching.BranchingType.TryCatch): New.
2863         (FlowBranchingTryCatch): New.
2864
2865         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2866         (FlowBranching.CreateBranching): Update to changes.
2867         (FlowBranchingBlock.AddSibling): Add sanity check.
2868         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2869         Update to changes.
2870
2871         * iterators.cs (Iterator.MarkFinally): Remove.
2872         * statement.cs (ExceptionStatement): Update to changes.
2873
2874         Add support for skipping over finally blocks at runtime.  First
2875         in a series to fix #324708
2876         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2877         (Iterator.EmitMoveNext): Initialize it.
2878         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2879         branch over the body of the 'finally' clause.
2880
2881 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2882
2883         Avoid lopsided use of Foo/DoFoo names
2884         * statement.cs (ExpressionStatement.EmitFinallyBody):
2885         Rename from EmitFinally.
2886         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2887         * iterator.cs: Update to changes.
2888
2889 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2890
2891         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2892         based on UserOperatorCall. More binary nullable operators clean up.
2893
2894 2008-04-02  Martin Baulig  <martin@ximian.com>
2895
2896         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2897
2898 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2899
2900         * nullable.cs: Merge user and empty conversions when lifting expression
2901         trees.
2902         
2903         * expression.cs (StringConcat): Implemented expression tree representation.
2904
2905 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2906
2907         * nullable.cs: When lifting null literal and a user operator exists, no call 
2908         is made.
2909         
2910 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2911
2912         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2913         null.
2914
2915 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2916
2917         * nullable.cs, expression.cs: Use namespace instead heavily nested
2918         monster abstract class.
2919
2920 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2921
2922         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2923         lifting of null literal and user operators. Clean up of some temporary
2924         nullable hacks.
2925
2926 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
2927
2928         Fix #368224, test-629.cs
2929         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2930         if it crossed an unwind-protect boundary.
2931         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2932         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2933         inside an unwind-protected region.
2934         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2935         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
2936         'leave' instead of a 'br' if unwind-protected.
2937         (Iterator.EmitYieldBreak): Likewise.
2938
2939 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
2940
2941         * driver.cs: Only define versioninfo resources if no win32 resource
2942         file was specified.
2943
2944 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2945
2946         A fix for bug #372375
2947         * convert.cs: Fixed boxing of nullable types.
2948
2949 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2950
2951         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2952         type.
2953
2954 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2955
2956         A fix for bug #374619
2957         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2958         
2959 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2960
2961         * lambda.cs: Check return type only for invocation.
2962         
2963 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2964
2965         A fix for bug #374214
2966         * ecore.cs: Correctly report argument type mismatch.
2967
2968 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2969
2970         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2971         and not rely on broken IsEnum.
2972
2973 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2974
2975         * nullable.cs: New file, extracted from generic.cs.
2976         
2977         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2978
2979 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2980
2981         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2982         predefined comparison operators and null literals.
2983         
2984         * report.cs: New warning ID.
2985         
2986 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2987
2988         A fix for bug #370577
2989         * lambda.cs: Check return type too.
2990
2991 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2992
2993         A fix for bug #372846
2994         * class.cs: Automatic properties can be declared as unsafe.
2995
2996 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2997
2998         * location.cs: Use string based concatenation.
2999         
3000         * expression.cs: LiftedBinaryOperator is gmcs only.
3001         
3002 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3003
3004         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3005         conversions rules and expression trees.
3006
3007 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3008
3009         * delegate.cs: Use extension method source as delegate target.
3010
3011 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3012
3013         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3014         binary operations to be purely based on binary operations and optimized
3015         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3016         and other ET refactoring.
3017         
3018         * typemanager.cs: Fixed warning.
3019         
3020 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3021
3022         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3023         
3024         * symbolwriter.cs: Fixed.
3025
3026 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3027
3028         * anonymous.cs, driver.cs: Reset anonymous types counters.
3029
3030 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3031
3032         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3033         
3034         * class.cs: Use fullname for all type member definitions.
3035         
3036 2008-02-19  Martin Baulig  <martin@ximian.com>
3037
3038         * class.cs
3039         (IMethodData.EmitExtraSymbolInfo): New interface method.
3040         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3041         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3042         interface method here as an empty public virtual method.
3043
3044         * anonymous.cs
3045         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3046         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3047         CodeGen.SymbolWriter.SetRealMethodName().       
3048
3049 2008-02-18  Martin Baulig  <martin@ximian.com>
3050
3051         * anonymous.cs
3052         (ScopeInfo.EmitType): Override this and emit debugging
3053         information for captured variables.
3054         (RootScopeInfo.EmitType): Override this and emit symbol
3055         information for a captured `this'.
3056
3057 2008-02-15  Martin Baulig  <martin@ximian.com>
3058
3059         * iterators.cs: Emit debugging info.
3060
3061         * codegen.cs
3062         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3063         (EmitContext.OmitDebuggingInfo): New public property.
3064
3065         * statement.cs
3066         (While): Override Emit() and don't emit symbol info there; do it
3067         inside DoEmit() instead.
3068         (Block.Emit): Omit symbol information while emitting the scope
3069         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3070         block logic.
3071         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3072         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3073         .ctor to make `IsIterator' work.
3074
3075 2008-03-14  Martin Baulig  <martin@ximian.com>
3076
3077         * symbolwriter.cs: Added the new symbol writer function from the
3078         debugger's `terrania' branch; temporarily enclose them inside
3079         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3080         my vacations.
3081
3082 2008-03-14  Martin Baulig  <martin@ximian.com>
3083
3084         * symbolwriter.cs
3085         (SymbolWriter): Make this a public static class.
3086
3087         * codegen.cs
3088         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3089         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3090
3091 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3092
3093         A fix for bug #370577
3094         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3095         return type.
3096         
3097 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3098
3099         * typemanager.cs (CSharpName): Made 250 times faster.
3100
3101 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3102
3103         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3104         
3105 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3106
3107         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3108         crash when predefined field does not exist.
3109         
3110 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3111
3112         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3113         
3114 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3115
3116         * class.cs (FixedField): Don't crash when contructors are missing.
3117
3118 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3119
3120         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3121         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3122         check internal types accessibility for internal and external types.
3123         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3124
3125 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3126
3127         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3128         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3129         attribute.cs, statement: Use corect instance of predefined types (work
3130         related to #364674).
3131
3132 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3133
3134         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3135         
3136 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3137
3138         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3139         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3140         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3141         predefined types clean up, delayed predefined types members initialization
3142         (work related to #364674).
3143
3144 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3145
3146         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3147         
3148 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3149
3150         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3151         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3152         predefined types clean up (work related to #364674).
3153
3154 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3155
3156         * ecore.cs: Print an error message instead of throwing exception.
3157         
3158 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3159
3160         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3161         expression.cs, statement.cs: Unififed null literal representation.
3162
3163 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3164
3165         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3166         expression.cs: Refactored binary operators resolve phase and improved speed.
3167         The nullable code is still missing and won't work correctly, more fixes
3168         required.
3169
3170         It also fixes #323726, #324312, #324248, and many other unreported issues.
3171
3172 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3173
3174         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3175         instead of 'gmcs'.
3176
3177 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3178
3179         * ecore.cs: Clean-up and split BetterConversion.
3180         
3181 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3182
3183         Fix #363791
3184         * enum.cs (EnumMember.Value): Only access 'value' if
3185         ResolveValue says it's ok.
3186         (EnumMember.DoResolveValue): Don't set prev_member.value.
3187         (Enum.GetDefinition): Reverse arguments of Equals --
3188         EnumMember.Value can return 'null'.
3189
3190         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3191
3192 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3193
3194         * generic.cs, expression.cs: More ongoing work on expression trees.
3195         
3196 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3197
3198         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3199         handle missing matches when mutiple operators exist.
3200         
3201 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3202
3203         A fix for bug #363218
3204         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3205         initializers.
3206         
3207 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3208
3209         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3210         update. This time to deal correctly with SideEffectConstant expression used
3211         as an argument for another constant folding.
3212
3213 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3214
3215         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3216         MethodBuilder.
3217
3218 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3219
3220         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3221
3222 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3223
3224         A fix for bug #328136
3225         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3226         side is a false constant, because we still need to evaluate the right-hand
3227         side.
3228
3229         * statement.cs (If): Emit two types of boolean constants (simple constant,
3230         side-effect constant).
3231
3232 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3233
3234         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3235
3236         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3237         constants.
3238
3239 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3240
3241         A fix for bug #361457
3242         * ecore.cs (IsApplicable): Params methods have lower priority.
3243
3244         * support.cs: Return correct parameter modifier for params types.
3245
3246 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3247
3248         * generic.cs (TypeParameter): Cache attribute target name.
3249
3250         * support.cs: Removed unused variable.
3251
3252         * typemanager.cs: Removed debugging leftover.
3253
3254         * ecore.cs: Use local type instead of a property;
3255
3256         * class.cs (VerifyMembers): Consider also parent to test whether type member
3257         is local or public.
3258
3259         * expression.cs (FullMethodDesc): Removed.
3260
3261         * attribute.cs (IsValidArgumentType): Made static.
3262
3263 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3264
3265         Cleanup to be more readable.
3266         * Makefile (GMCS_PROFILE): Remove.
3267         (COMPILER_NAME): New helper.
3268
3269 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3270
3271         * cs-tokenizer.cs: if a conditional expression happens inside a
3272         (...) this also means that we do not need to de-ambiguate between
3273         an parenthesized expression and a cast.
3274
3275         Fixes 346484.
3276
3277         * constant.cs (SideEffectConstant): a constant value that happens
3278         to have a side effect.
3279
3280         Fixes the build regressions introduced by the fix for #359789
3281
3282 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3283
3284         * expression.cs (Conditional.Emit): when emitting the ternary
3285         operator, use local variables to generate code verifiable code.
3286
3287         The verifier cannot infer that the type on stack before the
3288         stloc.0 is executed is of type ParentB. This happens because the
3289         stack merge algorithm uses only parent types when deciding which
3290         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3291         335.
3292
3293         This code compiled with mcs is not verifiable under MS. The MS
3294         verifier picks the first common interface of Foo and Bar, which is
3295         wrong, but doesn't use a full join type of the 2 interfaces.
3296
3297         CSC uses a clever hack to compile such code in a verifiable
3298         way. It stores the intermediate values in a local variable with
3299         the expected type.
3300
3301         Fixes: #358102
3302
3303 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3304
3305         * expression.cs: Do not fold BitwiseAnd operators when the left
3306         side is a false constant, because we still need to evaluate the
3307         right-hand side.
3308
3309         Fixes #359789
3310
3311         * support.cs: Instead of throwing an InternalErrorException when
3312         the position of the stream is outside the boundary of our buffer,
3313         reset the state of the reader, and restart the reading from the
3314         beginning of the file.
3315
3316 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3317
3318         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3319
3320 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3321
3322         A fix for bug #361686
3323         * decl.cs: A protected types used inside a private class which parents
3324         derives from the protected class are accessible.
3325
3326 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3327
3328         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3329         the parameterless constructor.
3330
3331 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3332
3333         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3334         lookup methods to use standard member cache when doing member lookup.
3335
3336 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3337
3338         * driver.cs: Don't report full path for referenced module as assembly error.
3339
3340 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3341
3342         * Makefile: Fixed `qh' target to work on all machines.
3343
3344         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3345         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3346         and HasElementType with TypeManager implementation.
3347
3348 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3349
3350         A fix for bugs #325134, #359749
3351         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3352         first binds point to non-method member expression.
3353
3354 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3355
3356         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3357
3358 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3359
3360         A fix for bugs #321394, #323028
3361         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3362         Reworked naive IsAccessibleAs implementation to handle nested types.
3363
3364 2008-02-05  Jb Evain  <jbevain@novell.com>
3365
3366         * class.cs: use generic type comparison for parameters
3367         as well.
3368
3369 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3370
3371         A fix for bug #325372
3372         * class.cs: Use generic type comparison when testing method signatures.
3373
3374 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3375
3376         A fix for bug #357047
3377         * ecore.cs: Applied C# 3.0 changes to better conversion.
3378
3379 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3380
3381         A fix for bug #358374
3382         * cs-parser.jay: Correctly set modifiers for all constructor types.
3383
3384 2008-02-04  Marek Safar  <marek.safar@gmail.com>
3385
3386         A fix for bug #355251
3387         * generic.cs: Added base class constraint based type inference.
3388
3389 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3390
3391         A fix for bug #357255
3392         * decl.cs: One more missing visibility check.
3393
3394 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3395
3396         * support.cs: Fixed broken return.
3397
3398 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3399
3400         * report.cs: Correctly reset warnings count after probing.
3401
3402 2008-01-25  Martin Baulig  <martin@ximian.com>
3403
3404         * namespace.cs
3405         (NamespaceEntry.SymbolFileID): Make this work again after
3406         MemberName.ToString() is gone.
3407
3408 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3409
3410         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3411         expressions.
3412
3413 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3414
3415         * generic.cs: Use full implicit conversion for type inference fixing.
3416
3417 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3418
3419         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3420         Fixed user operator conversions.
3421
3422 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3423
3424         * generic.cs: Do nullable type to null comparison optimization during
3425         resolve phase.
3426
3427 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3428
3429         A fix for bug #355163
3430         * generic.cs: Enabled l-value resolve on nullable expressions.
3431
3432 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3433
3434         A fix for bug #353986
3435         * class.cs: Ingore static ctors with parameters for any further checks.
3436
3437 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3438
3439         A fix for bug #354310
3440         * namespace.cs: Removed redundant check.
3441
3442 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3443
3444         A fix for bug #354928
3445         * expression.cs: ElementInitializers can be resolved only once.
3446
3447 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3448
3449         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3450         Condition expressions.
3451
3452 2008-01-23  Marek Safar  <marek.safar@gmail.com>
3453
3454         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3455
3456 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3457
3458         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3459         not allowed.
3460
3461         * generic.cs: Implemented coalesce expression.
3462
3463 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3464
3465         A fix for bug #355145
3466         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3467         expression tree type inference.
3468
3469 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
3470
3471         Fix #354663
3472         * expression.cs (Binary.IsUnsignedType): Fix typo.
3473
3474 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3475
3476         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3477
3478 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3479
3480         A fix for bug #355161
3481         * ecore.cs, expression.cs: Wider range of extension method supported
3482         expressions.
3483
3484 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
3485
3486         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3487         AssemblyBuilder to operate in compiler context. Fixes mcs part of
3488         bug #354970.
3489
3490 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3491
3492         A fix for bug #355148
3493         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3494
3495 2008-01-22  Miguel de Icaza  <miguel@novell.com>
3496
3497         * expression.cs (CreateExpressionTree): Add support for or and
3498         logical or, and indent following the coding conventions.
3499
3500         * typemanager.cs (LinqExpression): renamed from
3501         ExpressionTreeManager, for a shorter name.
3502
3503         Use TypeManager.CoreLookupType to lookup types from our core
3504         assemblies and turn those into "Type" variables.
3505
3506         Consumers that previously used "Namespace" and "Type" from this
3507         class should instead use the TypeExpression which is a type that
3508         is fully resolved (without involving the regular C# resolution
3509         rules). 
3510
3511         This typically looks like this:
3512
3513         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3514         new MemberAccess (texpr, name, type_arguments, loc)
3515
3516         This avoids the problem in: #355178
3517
3518 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3519
3520         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3521         feature in parser only as we do in other cases.
3522         
3523 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3524
3525         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3526         typemanager.cs: A refactoring of params arguments to reuse existing
3527         expressions (params -> array initializer) to emit params argument instead
3528         of specialized handling.
3529         It was required by expression tree implementation and it has other benefits
3530         as well, we now apply same optimization for params arguments as we do for
3531         array initializers.
3532         
3533 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3534
3535         A fix for bug #353526
3536         * generic.cs: A type inference of params arguments may not required any
3537         temporary array creation.
3538         
3539 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3540
3541         A fix for bug #353534
3542         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3543         supported for delegates only.
3544         
3545 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3546
3547         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3548         type for more than 1 candidates.
3549         
3550 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3551
3552         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3553         expressions.
3554         
3555 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3556
3557         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3558         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3559         operator) expressions. 
3560                 
3561 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3562
3563         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3564         not accessed from the generated IL.
3565
3566 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3567
3568         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3569         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3570         statement.cs: The first expression tree implementation drop, mostly
3571         infrastructure work.
3572
3573 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3574
3575         * ecore.cs (IsNestedChild): Refactored.
3576
3577 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3578
3579         * lambda.cs: Don't use a cast on unknown expression statement.
3580
3581 2008-01-10  Geoff Norton  <gnorton@novell.com>
3582
3583         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3584         arguments
3585
3586 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3587
3588         * doc.cs: Report better /doc crash details.
3589         
3590 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3591
3592         A fix for bug #352536
3593         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3594
3595 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3596
3597         A fix for bug #352287
3598         * ecore.cs, expression.cs: Do `this' access checking in all member access
3599         expressions.
3600         
3601 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3602
3603         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3604         
3605         * report.cs: Reset message stacks.
3606         
3607 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3608
3609         * generic.cs (InferInPhases): Correctly calculate params position.
3610         
3611 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3612
3613         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3614         arguments.
3615
3616 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3617
3618         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3619         
3620         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3621         
3622         * driver.cs: Updated --help option.
3623         
3624 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3625
3626         * generic.cs (InferParamsTypeArguments): Removed.
3627         (InferInPhases): Add params type inference.
3628         (LowerBoundInference): Fixed scoring mechanism.
3629         
3630         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3631         
3632 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3633
3634         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3635         byte array for unsigned "baked" assemblies.
3636
3637 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3638
3639         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3640         array for assemblies that are not strongnamed.
3641
3642 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3643
3644         A fix for bug #351481
3645         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3646         declaring type for nested generic types.
3647         
3648 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3649
3650         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3651         instead of ToString.
3652         
3653 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3654
3655         A fix for bug #351047
3656         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3657         null and structs only when equality and inequality operators are defined
3658         either as an user-operators or predefined operators.
3659         
3660 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3661
3662         A fix for bug #351047
3663         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3664         
3665 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3666
3667         A fix for bug #351257
3668         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3669         
3670 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3671
3672         A fix for bug #351157
3673         * class.cs (Using): Fixed yet another broken cloning.
3674         
3675         (Block): Put back more sensible default value for statements.
3676         
3677 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3678
3679         * codegen.cs: Allow AssemblyVersion with only major version component.
3680         Fixes bug #351055.
3681
3682 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3683
3684         A fix for bug #324654
3685         * class.cs: Use FullName property as member name.
3686
3687 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3688
3689         A fix for bug #342117
3690         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3691         constructor constraint.
3692
3693 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3694
3695         A fix for bug #338273
3696         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3697         only.
3698
3699 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3700
3701         A fix for bug #350839
3702         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3703
3704 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3705
3706         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3707         GHOP:
3708         
3709         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3710
3711         * statement.cs: Changed some Hashtables to use HybridDictionaries
3712         instead. It was observed that some HashTables only contained a few
3713         items in the vast majority of cases. Since HybridDictionary is
3714         more efficient on small sets (<10 elements), "known_variables"
3715         from class ExplicitBlock as well as "labels" and "constants " from
3716         class Block were changed to HybridDictionaries. 
3717
3718         Atsai results: (56216kb->54987kb)
3719
3720         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3721
3722
3723 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3724
3725         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3726         GHOP:
3727         
3728         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3729         
3730         * expression.cs: foreach loop to for loop, saved on allocation of
3731         enumerator (59333kb->59141kb)
3732
3733         * statement.cs. Changed foreach loops to for loops, saved on
3734         allocation of enumerator (59141kb->59006kb)
3735
3736         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3737         when constructed with no specified capacity. This was causing a
3738         few ArrayLists to allocate more memory than they would potentially
3739         need in the Block class and MemberCache class. Setting the
3740         ArrayLists to construct with a capacity of 1 saves some
3741         memory. (56216kb->55585kb)
3742
3743 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3744
3745         A fix for bug #347189 (2nd issue)
3746         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3747         type.
3748
3749 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3750         
3751         * report.cs: Do not use colors if stdout and stderr are not a
3752         terminal.
3753
3754 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3755
3756         A fix for bug #346998
3757         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3758         overloads.
3759
3760 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3761
3762         A fix for bug #343465
3763         * class.cs: Explicit method name for nested types uses dots only.
3764
3765 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3766
3767         A fix for bug #343707
3768         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3769
3770 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3771
3772         * ecore.cs: Report type inference errors only when arguments count matches
3773         parameter count.
3774         
3775         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3776         
3777         * expression.cs, report.cs: New warning.
3778         
3779         * typemanager.cs: Catch anonymous method type too.
3780
3781 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3782
3783         A fix for bug #346379
3784         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3785
3786 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3787
3788         A fix for bug #347359
3789         * expression.cs (Invocation): Don't resolve already resolved expression.
3790
3791 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3792
3793         A fix for bug #347189
3794         * class.cs (FixedField): Use non-dependent code only in the define phase.
3795
3796 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3797
3798         A fix for bug #348076
3799         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3800
3801 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3802
3803         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3804         discovered extension methods.
3805
3806 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3807
3808         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3809         method.
3810
3811 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3812
3813         * report.cs (ErrorMessage): Add support for using colors on
3814         terminals that support it. 
3815
3816 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3817
3818         * ecore.cs: Use information about expanded params for error reporting.
3819
3820 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3821
3822         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3823         and logic for params overloads.
3824         
3825 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3826
3827         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3828         as this is also created from the parser.  Fixes #349034
3829
3830 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3831
3832         * statement.cs (Throw.CloneTo): it is valid to have empty
3833         expressions for throw. 
3834
3835 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3836
3837         * cs-parser.jay: Set delegate constraint parsing region correctly.
3838
3839 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3840
3841         A fix for bug #345467
3842         * typemanager.cs (IsEqual): Compare generic parameters position only.
3843         
3844 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3845
3846         * expression.cs (BaseAccess): Type arguments can be null.
3847
3848 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3849
3850         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3851         consistent even when an error has occured.
3852         (Switch.Resolve): Likewise.
3853
3854 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3855
3856         A fix for bug #334505
3857         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3858         overrides.
3859         
3860 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3861
3862         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3863         refactorings required to resolve extension methods correctly when mixing
3864         generics and non-generics members.
3865         
3866 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3867
3868         A fix for bug #342584
3869         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3870         conversion.
3871         
3872 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3873
3874         A fix for bug #342512
3875         * delegate.cs: Use delegate argument expression when is available. Don't
3876         emit virtual call when class is sealed.
3877         
3878 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3879
3880         A fix for bug #325423
3881         * assign.cs (FieldInitializer): Use resolved expression for emit.
3882         
3883         * class.cs: Print less confusing error message.
3884         
3885 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3886
3887         * cs-tokenizer.cs: Removed GMCS ifdefs.
3888         
3889         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3890         mcs.
3891         
3892         * cs-parser.jay: Disabled nullable check.
3893         
3894         * generic-mcs: Copied more generic stuff.
3895                 
3896 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3897
3898         * gcs-parser.jay: Merged to cs-parser.jay.
3899         
3900         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3901         * *.csproj, *.sources: Updated to use only jay parser file.
3902
3903 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3904
3905         * gcs-parser.jay: Added nullable and default expression feature checks.
3906         
3907 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3908
3909         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
3910         it fixes many TODOs and hidden bugs.
3911         
3912         * expression: Removed duplicate error check.
3913
3914 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3915
3916         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3917         implicitly type local variable only when it is used in a declaration.
3918
3919 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3920
3921         * attribute.cs: Use CS0612 for empty strings.
3922
3923 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3924
3925         * lambda.cs, statement.cs: Contextual return may act as a statement.
3926
3927 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3928
3929         A fix for a regression cause by #324222
3930         * class.cs: Don't report unused even when it implements an interface.
3931         
3932 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3933
3934         A fix for bug #341205
3935         * ecore.cs, expression.cs: Method group expression cannot do static
3936         method access with an instance reference check before overloading takes
3937         a place.
3938         
3939 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3940
3941         A fix for bug #325359
3942         * class.cs: Use predictable name for automatically generated property.
3943         
3944 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3945
3946         A fix for bug #324996
3947         * expression.cs (Is): Handle case where D is nullable and T is not
3948         correctly.
3949         
3950         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3951         
3952 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3953
3954         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3955         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3956         Flush small error reporting changes.
3957         
3958 2007-11-09  Marek Safar  <marek.safar@gmail.com>
3959
3960         A fix for bug #324996
3961         * expression.cs: Rewrote Is expression implementation to work with
3962         generics, nullable types, anonymous method. A const result expression 
3963         uses existing infrastructure instead of custom not fully-featured one.
3964         
3965 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3966
3967         A fix for bug #340202
3968         * class.cs: Consider generics for volatile field.
3969
3970 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3971
3972         A fix for bug #335594
3973         * expression.cs: Use conversion rules when handling string addition.
3974         
3975 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3976
3977         A fix for bug #336651
3978         * expression.cs: Fixed a crash when probing is on.
3979         
3980 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3981
3982         A fix for bug #324242
3983         * covert.cs: Added a conversion from any nullable-type with an 
3984         underlying enum-type to the type System.Enum.
3985         
3986 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3987
3988         A fix for bug #324222
3989         * class.cs: Report all non-used event fields.
3990         
3991 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3992
3993         A fix for bug #325161
3994         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3995         qualifier for generic types.
3996         
3997 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3998
3999         A fix for bug #322971
4000         * expression.cs, ecore.cs: Added intermediate result value check for
4001         indexers. 
4002         
4003 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4004
4005         A fix for bug #324754
4006         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4007         when it was requested.
4008
4009 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4010
4011         A fix for bug #325101
4012         * expression.cs: Do type not value comparison for `is' expression.
4013
4014 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4015
4016         A fix for bug #320236
4017         * convert.cs: Don't apply user conversion on underlying target type.
4018
4019 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4020
4021         * expression.cs: Don't use unresolved expression for error reporting.
4022  
4023 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4024
4025         A fix for bugs #337712, #324490
4026         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4027         overloading resolution too.
4028         
4029         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4030         the process consistent and more robust.
4031         
4032         * expression.cs, linq.cs, report.cs: Update.
4033
4034 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4035
4036         A fix for bug #332909
4037         * attribute.cs: Resolve attributes in correct context using error
4038         handling procedure.
4039         
4040         * rootcontext.cs: Define Obsolete attribute members as core members.
4041         
4042 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4043
4044         * statement.cs: Removed unused methods.
4045         
4046 2007-10-31  Wade Berrier  <wberrier@novell.com>
4047
4048         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4049         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4050         during 'make dist')
4051
4052 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4053
4054         A fix for bug #338102
4055         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4056         methods registered as non-generics.
4057         
4058 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4059
4060         A fix for bugs #337712, #324490
4061         * delegate.cs: Delegate covariance and contravariance is not allowed for
4062         value types.
4063         
4064 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4065
4066         A fix for bug #337719 
4067         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4068         `from' keyword.
4069         
4070 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4071  
4072         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4073
4074 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4075  
4076         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4077         query expressions.
4078
4079 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4080
4081         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4082
4083 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4084  
4085         A fix for bug #334652
4086         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4087         extension methods when we have not found the best candidate in normal
4088         container.
4089
4090 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4091
4092         * AssemblyInfo.cs: Keep up-to-date.
4093
4094 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4095
4096         * Makefile: Fixed generics compiler name.
4097         
4098 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4099
4100         * lambda.test: removed, lambda parsing is done differently.
4101         
4102         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4103
4104 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4105
4106         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4107
4108 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4109
4110         * Makefile, *.sources : All C# compilers are in mcs folder.
4111         
4112         * *.cs: Use existing 2_1 define for smcs.
4113
4114 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4115
4116         A fix for bug #335847
4117         * assign.cs, expression.cs: Couple of changes to avoid creating a
4118         temporary variable for each object initializer assignment statement. It
4119         simplifies struct initialization too, otherwise two temporary variables
4120         would be required.
4121         Implemented optimization of redundant default element initializers.
4122         
4123 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4124
4125         A fix for bug #336766
4126         * expression.cs (Class.CheckBase): Use generic name when method is
4127         generic.
4128         
4129 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4130
4131         A fix for bug #334737
4132         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4133         variable and not variable argument for prepared copies.
4134
4135 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4136
4137         A fix for bug #325110
4138         * class.cs, expression.cs, attribute.cs: Use open generic method when
4139         checking conditional attribute.
4140         
4141 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4142
4143         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4144         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4145         FeatureIsNotAvailable.
4146
4147 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4148
4149         ** C# 3.0 Partial methods
4150         
4151         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4152         methods support. Because of member cache issue with generics only
4153         non-generics partial methods are fully supported.
4154         
4155 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4156         
4157         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4158         generics and to use member cache for member checking. It also improves
4159         performance and fixes remaining overloads issues.
4160         
4161 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4162         
4163         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4164         roottypes.cs, typemanager.cs:
4165                 
4166         A member cache creation logic changed to add members immediately and
4167         not rely on fallback. The member cache is now only prefered way
4168         how to access and find type declaration members. It saves 5 MB of memory
4169         during MWF compilation and makes code ready for more optimizations and
4170         clean-ups, it's also a pre-requirement for partial methods.
4171         
4172 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4173
4174         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4175         handling for generic parameters.
4176
4177 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4178         
4179         * class.cs (FixedField): Removed redundant volatile check.
4180         
4181 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4182         
4183         * class.cs, decl.cs: Fixed overload members verification to do only one
4184         check per possible collision.
4185         
4186 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4187         
4188         A fix for bug #325478
4189         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4190         and create only one disposable flags container.
4191         
4192 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4193         
4194         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4195         * statement.cs (Fixed): Fixed variables cloning.
4196         
4197 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4198         
4199         A fix for bug #333342
4200         * class.cs (EventField): Don't mark value type event as synchronized. 
4201         
4202 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4203         
4204         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4205         inference to identify best candidate method correctly.
4206         (ProperyExpr): A range variable is read only and cannot be modified.
4207         
4208 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4209         
4210         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4211         logic to identify best candidate method correctly.
4212         
4213 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4214         
4215         * location.cs (Equals, GetHashCode): Removed.
4216         
4217 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4218         
4219         * report.cs: Implemented message recorder. It is used mainly for lambda
4220         expressions to capture otherwise swallowed error messages.
4221         
4222         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4223
4224         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4225         and not at the top.
4226         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4227                 
4228         * expression.cs (MemberAccess): Always report lookup failure.
4229         
4230         * location.cs: Implemented Equals, GetHashCode.
4231         
4232         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4233         
4234 2007-10-10  Jb Evain  <jbevain@novell.com>
4235
4236         * codegen.cs: re-enable assembly version check.
4237
4238 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4239         
4240         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4241         checks.
4242         
4243         * namespace.cs (UsingAlias): Do correct version check.
4244         
4245 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4246         
4247         * expresison.cs, ecore.cs: Issue extension method error message when
4248         appropriate.
4249         
4250         * rootcontext.cs: Added ISO_2 compiler mode option.
4251
4252 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4253         
4254         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4255          message.
4256         
4257 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4258         
4259         * attribute.cs (GetString, GetBoolean): Work with both literal and
4260         constant.
4261         
4262         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4263         Moved method overload specific methods to MethodGroupExpr.
4264         
4265         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4266         it should be less memory consuming.
4267         
4268 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4269
4270         * codegen.cs: remove the assembly version check until the buildbot is
4271         fixed.
4272
4273 2007-10-07  Jb Evain  <jbevain@novell.com>
4274
4275         * attribute.cs (Attribute.GetString): if the value
4276         expression is a StringConstant, return its string value.
4277
4278 2007-10-07  Jb Evain  <jbevain@novell.com>
4279
4280         * typemanager.cs: add `assembly_version_attribute_type`.
4281         * codegen.cs: on attribute emission, check that the
4282         AssemblyVersionAttribute doesn't overflow.
4283
4284 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4285         
4286         A fix for bug #324677
4287         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4288         parent container of a scope container with currently resolved one. 
4289         
4290 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4291         
4292         A fix for bug #325534
4293         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4294         only.
4295         
4296 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4297         
4298         A fix for bug #327504
4299         * class.cs (Operator.Define): Refactored implicit and explicit user
4300         operator conversion rules.
4301         
4302 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4303         
4304         A fix for bug #327520
4305         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4306         
4307 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4308         
4309         A fix for bug #328022
4310         * class.cs (MethodData.Define): Use correct method to check whether
4311         a method implementents an accessor.
4312         
4313 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4314         
4315         A fix for bug #330069
4316         * statement.cs (Fixed.Resolve): Read the first array element only when
4317         an array is instantiated. 
4318         
4319 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4320         
4321         * expression.cs, assign.cs, generics.cs: Print correct operator when
4322         compound assignment is used.
4323         
4324 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4325         
4326         A fix for bug #325841
4327         * expression.cs (ArrayAccess): Use full argument cloning only for
4328         string compound concatenation.
4329         
4330 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4331         
4332         A fix for bug #328774
4333         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4334         assignment.
4335         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4336         assignment.
4337
4338 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4339
4340         Fix #328490
4341         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4342         Event accessibility checks here.  Remove some bogus code that
4343         accidently made GenericMethods work.
4344         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4345
4346 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4347         
4348         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4349         
4350         * statement.cs (Block): Refactored AddVariable to allow error handling
4351         customization.
4352         
4353         * generic.cs: New stub.
4354         
4355 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4356         
4357         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4358         flag.
4359         
4360 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4361
4362         * class.cs: Use partial container to record whether any partial part
4363         contains static field initializer and therefore default contructor has
4364         to be defined.
4365         
4366 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4367
4368         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4369         mono-list when only one of two partial parts has defined accessibility
4370         modifier.
4371         
4372 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4373
4374         A fix for bug #82845
4375         
4376         * class.cs (TypeContainer): Set correct resolve context for all field
4377         initializers.
4378         
4379 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4380
4381         * assign.cs: Fixed a crash when field is resolved twice with an error.
4382         
4383         * codegen.cs: Changed InFieldInitializer to be flag.
4384         
4385         * anonymous.cs, ecore.cs, expression.cs: Update after
4386         IsInFieldInitializer rename.
4387         
4388         * const.cs: Removed unused parameter.
4389         
4390         * class.cs: Changed the way how we resolve and emit field initializers.
4391         The field initilizers have to have access to contructor block to emit
4392         compiler generated code.
4393
4394 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4395
4396         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4397         generics use TypeContainer instead.
4398         
4399 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4400         
4401         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4402
4403         * lambda.cs (ResolveParameters): Use more powerful
4404         InflateGenericArgument.
4405         
4406         * parameters.cs: Better exception message.
4407                 
4408 2007-09-10  Marek Safar  <marek.safar@gmail.com>
4409
4410         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4411         correct expression block type. 
4412         
4413         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4414         
4415         * expression.cs (Invocation): Extracted method group resolve to
4416         DoResolveOverload.
4417         
4418 2007-09-07  Marek Safar  <marek.safar@gmail.com>
4419
4420         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4421         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4422         
4423         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4424         generic extension methods.
4425
4426 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4427
4428         A fix for bug #82676 (Do I get it right now?)
4429         * convert.cs (Binary.ResolveOperator): An interface is converted to the
4430         object before a standard conversion is applied.
4431         
4432 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4433
4434         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4435         #82676.
4436         
4437 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4438
4439         A fix for bug #82676
4440         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4441         non-generic interface types.
4442         
4443 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4444
4445         A fix for bug #82690
4446         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4447         
4448 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4449
4450         A fix for bug #82571
4451         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
4452         modifier for container based methods.
4453         
4454 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4455
4456         A fix for bug #82676
4457         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4458         any interface-type T means to any of interface type T.
4459
4460 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4461
4462         * namespace.cs: We have 2 versions of System.Core assembly.
4463
4464 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4465
4466         A fix for bug #82652
4467         * class.cs (Class.GetClassBases): Compare types and not expressions.
4468
4469 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4470
4471         A fix for bug #82620
4472         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4473         actually never worked before.
4474         (IndexerAccess): Emit prepared arguments before they are modified.
4475         
4476 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4477
4478         A fix for bug #82563
4479         * assign.cs: Revert wrong fix.
4480         
4481         * expression.cs (VariableReference.EmitAssign): Handle ref reference
4482         correctly.
4483         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4484         Instead of ldelema/stdind we have to use temporary variables to handle
4485         cases like String.Concat (params string[]).
4486         
4487 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4488
4489         * class.cs: EmitAttributes to Emit rename.
4490         
4491         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4492         null.
4493         (MemberCore.HasClsCompliantAttribute): Don't depend on 
4494         GetClsCompliantAttributeValue execution.
4495         
4496 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4497
4498         * anonymous.cs: Use shorter type prefix.
4499         
4500         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4501         when exist.
4502         
4503         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4504         variables when probing is on.
4505         
4506         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4507         unresolved variables.
4508         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4509         handle transparent identifiers.
4510         
4511 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4512
4513         * attribute.cs (IsClsCompliant): Add nullable types test.
4514         
4515 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4516
4517         * doc.cs : catch other types of exception than XmlException to
4518           report CS1570. Fixed bug #82565.
4519
4520 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4521
4522         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4523         The number of delegate parameters has to match.
4524         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4525         arrays.
4526
4527 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4528
4529         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4530         to fix problem with private arguments.
4531
4532 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4533
4534         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4535         
4536         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4537         
4538         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4539         empty. Add cloning suport.
4540         
4541         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4542
4543 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4544
4545         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4546         to create EmptyCast. It handles EmptyConstantCast specialization for
4547         constants.
4548         
4549 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4550
4551         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4552         (EmitArrayArgument): One routine for array arguments.
4553         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4554         
4555 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4556
4557         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4558
4559 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4560
4561         * anonymous.cs: MemberLookupFinal update.
4562
4563         * class.cs (ConstructorInitializer): Is expression based.
4564         
4565         * delegate.cs: MethodGroupExpr update.
4566         
4567         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4568         messages.
4569         (Error_MemberLookupFailed): Customizable error override.
4570         (MethodGroupExpr): Keep queried type for later usage.
4571         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4572         resolve.
4573         
4574         * expression.cs: Error_MemberLookupFailed refactoring.
4575         (New.DoResolve): Resolve as much as possible.
4576         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4577         customization for invalid member types.
4578
4579         * statement.cs: MethodGroupExpr update.
4580         
4581 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4582
4583         * modifier.cs (Check): Check all modifiers and not only accessibility
4584         ones.
4585
4586 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4587
4588         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4589         type and not an expression.
4590
4591 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4592
4593         * statement.cs (Catch.Clone): Type and variable can be null.
4594
4595 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4596
4597         A fix for bug #81979
4598         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4599         I am really not sure whether this is the best fix.
4600         
4601         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4602         only once.
4603         
4604 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4605
4606         ** C# 3.0 Object and collection initializers (major re-write)
4607         
4608         * assign.cs (DoResolve): Initializers are not assign related.
4609         
4610         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4611         used during collection or object initialization.
4612         
4613         * expression.cs (Error_InvalidArguments): Add initializers specific
4614         messages. More will come later because it requires some general
4615         refactoring.
4616         (New.DoResolve): Better error handling for unsafe types.
4617         (EmptyExpressionStatement): New class.
4618         (ElementInitializer): An object initializer expression.
4619         (CollectionElementInitializer): A collection initializer expression.
4620         (CollectionOrObjectInitializers): A block of object or collection
4621         initializers.
4622         (NewInitialize): New expression with element/object initializers.
4623         
4624         * statement.cs: Reverted object/collection initializer hacks.
4625         
4626         * typemanager.cs (CSharpName): Filter __arglist type.
4627         
4628 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4629
4630         ** C# 3.0 Anonymous Types (update to the latest standard)
4631         
4632         * expression.cs (Binary.ResolveOperator): Threat all null based types
4633         same.
4634         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4635         (AnonymousTypeParameter): Updated.
4636         
4637         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4638         (AnonymousTypeClass): New anonymous type container.
4639         
4640         * class.cs (AddField): Return operation result.
4641         
4642         * generic.cs: Another empty TypeArguments overload.
4643         
4644         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4645         are stored at top of normal hierarchy.
4646         
4647         * typemanager.cs (CSharpName): Filter anonymous types.
4648         
4649 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4650
4651         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4652         as single Concat call. How could we miss that :-(
4653         
4654 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4655
4656         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4657         
4658 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4659
4660         * expression.cs: Fix the previous commit, the creation of the
4661         arguments array list needs also to be conditional on the arguments
4662         not being null.
4663
4664         * class.cs: Add a little bit of help to help narrow down problems.
4665
4666         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4667         not try to copy in that case. 
4668
4669         * driver.cs: When building SMCS, include a new different set of
4670         default assemblies here.   Do this here so we can control whether
4671         to include the default assemblies with /noconfig.
4672
4673 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4674
4675         A fix for bug #81979
4676         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4677         only.
4678
4679 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4680
4681         A fix for bug #82300
4682
4683         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4684         we are in probing scope.
4685
4686 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4687
4688         A fix for bug #82301
4689
4690         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4691         (Statement.CloneTo): Clone and not map children blocks.
4692
4693 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4694
4695         A fix for bug #82299
4696
4697         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4698         variable too.
4699         
4700         * statement.cs (Statement.CloneTo): Clone variables before statements
4701         to allow remaping of local variables.
4702
4703 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4704
4705         A fix for bug #82296
4706
4707         * anonymous.cs,
4708         * report.cs: Log crash details for future clone problems.
4709         
4710         * statement.cs (Return.Clone): Don't clone non-existent expression.
4711
4712 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4713
4714         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4715         (Class.AddBasesForPart): Move CS0537 check here from ...
4716         * cs-parser.jay (class_declaration): ... here.  Move calling of
4717         'AddBasesForPart' to ...
4718         (class_bases): ... here.
4719         (struct_declaration, interface_declaration): Update to changes.
4720
4721 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4722
4723         A fix for bug #81923
4724
4725         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4726         conversion is allowed.
4727
4728 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4729
4730         A fix for bug #81564
4731
4732         * ecore.cs (EventExpr): Add IsBase handling.
4733
4734         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4735         too.    
4736         
4737 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4738
4739         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4740         * cs-parser.jay: Some whitespace cleanups.
4741         (current_delegate): New.
4742         (type_name): New.
4743         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4744         a dummy code block, and use 'type_name' instead of 'member_name'.
4745         (interface_declaration, class_declaration): Likewise.
4746         (delegate_declaration): Likewise.  Rearrange slightly and use
4747         'current_delegate'.
4748         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4749         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4750
4751 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4752
4753         A fix for bug #82039
4754
4755         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4756         available.
4757
4758         * typemanager.cs (CSharpName): Split to string overload.
4759
4760 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4761
4762         * expression.cs,
4763         * report.cs: Updated warning CS0472.
4764
4765 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4766
4767         A fix for bug #82181
4768         * cs-parser.jay,
4769         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4770
4771 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4772
4773         A fix for bug #82277
4774         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4775
4776 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4777
4778         ** C# 3.0 Type Inference (major bits are working)
4779         
4780         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4781         (.ImplicitStandardConversionExists): Uses compatible.
4782         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4783         (.InferReturnType): New method.
4784         (.Compatible): Refactored.
4785         (.ResolveParameters): Uses factory to create resolved parameters.
4786         (.CompatibleMethod): Add probing mode support.
4787         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4788         clearly distinguish between 2 different operations.
4789         (LambdaMethod): Moved to lambda.cs.
4790         (AnonymousMethod): Removed unused fields and methods.
4791         (AnonymousDelegate): Simplified.
4792         
4793         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4794         
4795         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4796         
4797         * delegate.cs (Delegate): New mehods to reduce code duplication.
4798         (.GetConstructor): New method.
4799         (.GetInvokeMethod): New method.
4800         (DelegateCreation): Updated.
4801         
4802         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4803         does not exist.
4804         (OverloadResolve): Made probing little bit faster.
4805         
4806         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4807         when probing is on.
4808         
4809         * generic.cs (TypeInferenceContext): Dummy implementation.
4810         
4811         * iterators.cs: Updated after Resolve/Define rename.
4812         
4813         * lambda.cs (LambdaExpression)
4814         (.ResolveParameters): Handles both type of arguments and type inference too.
4815         
4816         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4817         (InflateTypes): Updated.
4818         
4819         * support.cs (InflateTypes): Changed signature and updated.
4820         
4821         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4822         (MemberLookup_FindMembers): More MS tricks.
4823         (GetParameterData): Ditto.
4824         (GetDelegateParameters): Uses quick path for dynamic types.
4825         
4826 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4827
4828         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4829         only.
4830
4831 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4832
4833         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4834         syntax.
4835         
4836 2007-07-26  Jb Evain  <jbevain@novell.com>
4837
4838         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4839         which takes a boolean 'report_errors', similar to the GetMethod.
4840         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4841         in .net 2.1, do not report errors here.
4842
4843         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4844         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4845         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4846         in .net 2.1.
4847
4848         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4849         of the type InternalsVisibleToAttribute before the first call
4850         to CoreLookupType which is allowed to fail (third boolean parameter
4851         to true). Because, during the resolution for a type that is not
4852         immediately found, we try to check if the type is not defined in
4853         a friend assembly, and to do so, we need the
4854         InternalVisibleToAttribute.
4855
4856 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4857
4858         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4859         feature that allows structs to be compared against null and inline
4860         the result as true or false.
4861
4862         Notice that the same code is not permitted inside a generic block
4863         of code that would do:
4864
4865         class Foo<T> where T : struct {
4866             bool Eval (T x)
4867             {
4868                  return x == null;
4869             }
4870         }
4871
4872         It is only allowed if the type of T is not bound (no where
4873         clause).   In my opinion, this CSC 2 behavior is broken but people
4874         seem to be using it (IronRuby does, a few bug reports on bugzilla
4875         have it and some people have complained about it).
4876
4877         All of the users that depend on this behavior have code that is
4878         very likely broken. 
4879         
4880         * report.cs (Warning, Error): make these take object arguments,
4881         not strings, as that allows us to take advantage of Format.
4882
4883 2007-07-20  William Holmes  <billholmes54@gmail.com>
4884
4885         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4886           Left member variable for the Count.
4887         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4888           MemberName.CountTypeArguments to avoid a NRE. 
4889
4890         This code is contributed under the MIT X11 license
4891
4892 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4893
4894         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4895
4896 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4897
4898         * doc.cs : generic method arguments are written as ``x while generic
4899           type arguments are `x. Combined with the previous change, fixed bug
4900           #79706.
4901
4902 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4903
4904         Fix #82120
4905         * expression.cs (Binary.ResolveOperator): When converting
4906         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4907
4908 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4909
4910         * doc.cs : when T: or whatever x: is specified, it does not really
4911           check the doc comment's syntax correctness. Fixed bug #82006.
4912
4913 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4914
4915         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4916         LambdaExpression better.
4917         
4918         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4919         
4920         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4921         
4922         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4923         as it can be generated.
4924         
4925         * expression.cs (Invocation.Error_InvalidArguments): Show correct
4926         modifiers.
4927         
4928         * lambda.cs (LambdaExpression): Refactored to share same code with
4929         AnonymousMethodExpression.
4930         
4931 2007-07-17  Marek Safar  <marek.safar@gmail.com>
4932
4933         * anonymous.cs (MakeName): Include host name for easier debugging.
4934         (LambdaMethod): New class for lambda spcecific stuff.
4935         
4936         * attribute.cs: Set EmitContext return type.
4937
4938         * class.cs: Set EmitContext return type.
4939         
4940         * codegen.cs (EmitContext): Return type cannot be null to stop messing
4941         with null/void meaning.
4942         
4943         * iterators.cs (ContainerType): Implemented.
4944         
4945         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4946         
4947         * statement.cs (Return): Updated to lambda expressions.
4948         (Block.CloneTo): Parent can be null.
4949                 
4950 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4951
4952         A fix for bug #81917
4953         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4954         
4955         * class.cs (FixedField): Check whether field is in unsafe scope.
4956
4957         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4958         (FieldExpr.Emit): Fixed buffers cannot be volatile.
4959
4960         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4961         FieldExpr.
4962         
4963         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4964                 
4965 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4966
4967         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4968         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4969         from Report class.
4970
4971 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4972
4973         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4974         
4975 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4976
4977         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4978         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4979         
4980         * codegen.cs(EmitContext): Add ProbingMode flag.
4981         
4982         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4983         
4984         * driver.cs: For now set both warning values.
4985         
4986         * ecore.cs (SimpleName): Name is readonly.
4987         (MethodGroup.OverloadResolve): One quick path for probing.
4988         
4989         * expression.cs (Unary): Set Oper r/o.
4990         (Binary): Set Oper r/o.
4991         (ParameterReference): Set few instance variables as r/o.
4992         (ParameterReference.DoResolveBase): Don't capture aruments when 
4993         the probing is on.
4994         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4995         (Arglist): arguments are private.
4996         (SizeOf): type is private and r/o.
4997         (MemberAccess): arguments are private.
4998
4999         * report.cs: Enhanced reporting on/off capabilities.
5000         
5001         * lambda.cs: Uses ec.IsInProbingMode.
5002         (ContextualReturn): Derives from return.
5003         
5004         * rootcontext.cs: For now set both warning values.
5005         
5006         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5007         copy if one exists.
5008         (Return.Resolve): Don't die immediately.
5009         (Block.Resolve): Speed-up probing.
5010         (Block.CloneTo): Clone only child blocks.
5011
5012 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5013
5014         * iterators.cs: reverted Miguel's latest change (r81925) as it
5015         breaks the build in System.
5016
5017 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5018
5019         * iterators.cs (Yield.CheckContext): Check for the iterator type
5020         also here as we can call into Yield even in codepaths that are not
5021         directly checked by
5022         (MethodOrOperator is the only path that was checked).
5023
5024         In addition to the standard check, use a more specific check for
5025         constructors to report a more verbose error. 
5026
5027 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5028
5029         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5030         report the warning and continue 
5031
5032         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5033         values on the stack on the call to Emit.   Use EmitStatement if
5034         possible, or using Emit + Pop if not possible.   Fixes #82064
5035
5036 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5037
5038         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5039         avoid try...finally in some cases.
5040
5041 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5042
5043         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5044         
5045         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5046         instead of method. Re-use standard error handling.
5047         (ConstructorInitializer.Emit): Simplified.
5048         
5049         * delegate.cs: Updated after Invocation.EmitCall change.
5050         
5051         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5052         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5053         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5054         method and don't permanently changing input arguments.
5055         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5056         is resolved it has one of the candidates is the best one which is later
5057         used to emit. Removed a few unused method.
5058         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5059
5060         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5061         (Binary.ResolveOperator): Ditto.
5062         (ConditionalLogicalOperator.DoResolve): Ditto.
5063         (Invocation): Uses method group.
5064         (Invocation.DoResolve): Simplified.
5065         (Invocation.EmitCall): Removed useless is_static.
5066         (Invocation.Emit): Delegate to method group.
5067         (Invocation.EmitStatement): Simplified.
5068         (New): Uses method group.
5069         (MemberAccess.DoResolve): Don't destroy original expression.
5070         
5071         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5072         
5073 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5074
5075         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5076         
5077         * anonymous.cs,
5078         * lambda.cs: Add custom error message type.
5079
5080 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5081
5082         * lambda.cs: Simplified little bit.
5083         
5084         * parameter.cs: Introduced ImplicitLambdaParameter.
5085         (Parameters.CreateFullyResolved): New factory instead of ctor.
5086         
5087         * anonymous.cs,
5088         * class.cs,
5089         * delegate.cs: Updated parameter creation.
5090         
5091 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5092
5093         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5094         arguments.
5095         
5096         * generic.cs: Synchronized with gmcs.
5097         
5098 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5099
5100         * class.cs (Indexer): Check return type as soon as possible.
5101         
5102         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5103         members too.
5104         
5105         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5106         
5107         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5108         
5109         * parameter.cs (Parameter): Use expression type when it is available.
5110         
5111         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5112         method modifier for the first parameter only.
5113
5114 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5115
5116         A fix for bug #81938
5117         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5118         
5119         * constant.cs: Tide up an exception message.
5120
5121 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5122
5123         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5124         an uninitialized variable is used.
5125         
5126         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5127
5128 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5129
5130         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5131         not found error handling.
5132
5133         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5134         simplified.
5135         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5136         (ArrayCreation.DoResolve): Simplified.
5137         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5138         its own resolve process.
5139         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5140
5141 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5142
5143         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5144         more error details.
5145         
5146 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5147
5148         * cs-tokenizer.cs: Removed var related stuff.
5149         
5150         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5151         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5152         a type and a keyword at same time.
5153         
5154         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5155         matches to "var".
5156         
5157         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5158         implicitly typed arrays, more changes will follow.
5159         
5160         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5161         
5162 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5163
5164         * ecore.cs (VarExpr): Removed Handled field.
5165         
5166         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5167         build-in assign functionality.
5168         (ForEach.Resolve): Removed all implicitly typed local variable code and
5169         simplified.
5170         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5171         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5172
5173 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5174
5175         * assign.cs: Removed implicitly typed local variable check.
5176         
5177         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5178         referencing implicitly typed local variable.
5179         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5180         variable here.
5181         
5182         * statement.cs (Fixed): Removed unsupported implicitly typed local
5183         variable code.
5184
5185 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5186
5187         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5188
5189 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5190
5191         A fix for bugs #81855 and #76274
5192         * attribute.cs (AttachTo): Always set owner for global attributes to
5193         prefined owner.
5194         
5195         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5196         usefull too.
5197         
5198         * cs-parser.jay: Assembly and module attributes must precede all other
5199         elements except using clauses and extern alias declarations.
5200
5201 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5202
5203         A fix for bug #81748
5204         * cs-tokenizer.cs,
5205         * expression.cs: More checks for non ISO-1 features.
5206
5207 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5208
5209         A fix for bug #81807
5210         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5211         present inside switch statement and it is required by nullable check.
5212
5213 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5214
5215         A fix for bug #81840
5216         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5217         when type matching fails.
5218         
5219         * namespace.cs: Tiny error message change.
5220
5221 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5222
5223         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5224         reporting. Added automatic property check.
5225         
5226         * class.cs: Updated after CheckAbstractAndExtern relocation.
5227         (AEventPropertyAccessor.GetSignatureForError): Customized.
5228         
5229 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5230
5231         * class.cs (DefineBaseTypes): Base type can be undefined.
5232         
5233         * ecore.cs (TypeLookup): Minor refactoring.
5234         (DoResolveAsTypeStep): Removed redundant check.
5235
5236         * namespace.cs (Lookup): Removed redundant check.
5237                 
5238         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5239         ResolveAsTypeTerminal step.
5240         (BootstrapCorlib_*): Simplified.
5241         (PopulateCoreType): Core types can be now external.
5242
5243 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5244
5245         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5246          verification only.
5247          (InferTypeArguments): Infers anonymous expression type arguments.
5248          (Compatible): Split to Compatible and InferTypeArguments. 
5249         
5250         * lambda.cs: Updated.
5251
5252 2007-06-08  Marek Safar  <marek.safar@gmail.com>
5253
5254         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5255
5256 2007-06-07  Raja R Harinath  <harinath@gmail.com>
5257
5258         Fix #80477, cs0135-2.cs, cs0135-3.cs
5259         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5260         names to the "known" variables list.
5261         (Block.CheckInvariantMeaningInBlock): Handle the fact the
5262         parameter names are also "known".
5263         (Block.CheckError136): Remove.
5264         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
5265         null.
5266
5267 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5268
5269         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5270
5271 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5272
5273         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5274         internal error not an user error.
5275          
5276         * expression.cs (IsApplicable): Refactored to make debugging easier.
5277
5278         * support.cs: More tricks for non-mono runtimes.
5279         
5280         * typemanager.cs (CoreLookupType): Made public.
5281         (InitSystemCore): All linq specific stuff moved to linq.cs
5282
5283 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5284
5285         * typemanager.cs (CSharpSignature): One more missing build-in types
5286         replacement.
5287         More tricks for non-mono runtime.
5288
5289 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5290
5291         * statement.cs (Block.CheckError136_InParents): Remove.
5292         (Block.AddVariable): Use GetParameterInfo instead.
5293         (ToplevelBlock.ProcessArguments): Likewise.
5294
5295 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5296
5297         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5298         information too.
5299         (ToplevelBlock.GetParameterInfo): Split out of ...
5300         (ToplevelBlock.GetParameterRefernce): ... this.
5301         (ToplevelBlock.ParameterMap): Remove.
5302         * expression.cs (ParameterReference): Update to use
5303         ToplevelParameterInfo.
5304
5305         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5306         regression.
5307
5308         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5309         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5310
5311         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5312         (ToplevelBlock.ProcessParameters) ... here.
5313         (ToplevelBlock..ctor): Invoke it.
5314
5315         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5316         new parameters.
5317
5318         * statement.cs (IKnownVariable): New interface.
5319         (LocalInfo): Implement it.
5320         (ToplevelParameterInfo): New class.
5321         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5322         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5323         GetKnownVariableInfo.
5324
5325 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5326
5327         Partly speed up CS0136 error checks.
5328         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5329         'recurse' parameter.
5330         (Block.DoCheckError136): Only check errors in parameters.  Move
5331         local variable checks ...
5332         (Block.AddVariable): ... here, and ...
5333         (ToplevelBlock.ResolveMeta): ... here.
5334
5335 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5336
5337         * statement.cs (Block.IsChildOf): Remove.
5338
5339         * statement.cs (Statement.Clone): Move special case code ...
5340         (Block.CloneTo): ... here.
5341
5342 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5343
5344         * statement.cs (ToplevelBlock.container): Remove field.  It's
5345         redundant with 'Parent'.
5346         (ToplevelBlock.ContainerBlock): Remove accessor.
5347         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5348         child with parent here, ...
5349         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5350         current_block.
5351         (start_anonymous): Don't save current_block.
5352         (top_current_block): Remove.
5353
5354         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5355         (Block.Resolve): Update to changes.
5356         (Block..ctor): Move setting of "correct" 'Toplevel'
5357         and 'Explicit' fields to ...
5358         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5359
5360 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5361
5362         Kill Block.Implicit
5363         * statement.cs (Block.Implicit): Remove.
5364         (Block): Update to changes.
5365         * flowanalysis.cs: Likewise.
5366
5367         Mildly speed up CheckInvariantMeaningInBlock
5368         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5369         Recursively call AddKnownVariable to all enclosing blocks.
5370         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5371         Remove recursive calls.
5372         (Block): Update to changes.
5373
5374         New ExplicitBlock invariants
5375         * statement.cs (Block.Explicit): New field.  It points to the
5376         immediately enclosing non-implicit block.
5377         (Block..ctor): Maintain the invariant.
5378         * cs-parser.jay: Take advantage of invariant.
5379
5380         Introduce ExplicitBlock
5381         * statement.cs (ExplicitBlock): New.
5382         (ToplevelBlock): Derive from it.
5383         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5384         sense of flag.
5385         (Block.Implicit): Update to changes.
5386         * cs-parser.jay: Update to changes.
5387
5388         Remove unused field
5389         * codegen.cs (EmitContext.IsLastStatement): Remove.
5390         * statement.cs (Block.DoEmit): Update to changes.
5391
5392 2007-05-25  Raja R Harinath  <rharinath@novell.com>
5393
5394         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5395         modifying current_block directly.
5396
5397 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
5398         
5399         * class.cs: Implemented automatic properties (C# 3.0)
5400           Thanks to Marek for the help.
5401
5402 2007-05-23  Raja R Harinath  <rharinath@novell.com>
5403
5404         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5405         variable as assigned, note also that all its components are
5406         assigned too.
5407         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
5408
5409 2007-05-19  Marek Safar  <marek.safar@gmail.com>
5410
5411         * anonymous.cs, class.cs: Emit Compiler generated attribute when
5412         member is marked as compiler generated.
5413         
5414         * decl.cs (MemberCore): Refactored ModFlags into property.
5415
5416         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5417         (Check): Check only accessibility modifiers.
5418
5419 2007-05-18  Raja R Harinath  <rharinath@novell.com>
5420
5421         Track all assignable slots in one bit array
5422         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5423         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
5424         logic from VariableMap constructor here.  Use the same 'offset'
5425         variable that's later used for computing offsets of local
5426         variables.
5427         * flowanalysis.cs (UsageVector.parameters): Remove.
5428         (UsageVector): Update to changes.
5429         (VariableMap): Remove.
5430
5431         Avoid creating ParameterMap in every block
5432         * statement.cs (Block.ParameterMap): Move ...
5433         (ToplevelBlock.ParameterMap): ... here.
5434         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5435         only once.
5436         * flowanalysis.cs (FlowBranching.param_map): Remove.
5437         (FlowBranching.UsageVector): Update to changes.
5438         (FlowBranchingToplevel.CheckOutParameters): Likewise.
5439
5440         * statement.cs (Block.CloneTo): Clone Toplevel field too.
5441
5442         * expression.cs (ParameterReference): Distinguish between block
5443         where parameter was referenced and declared.
5444
5445 2007-05-18  Marek Safar  <marek.safar@gmail.com>
5446
5447         * flowanalysis.cs, statement.cs: Put back improved error handling.
5448
5449 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
5450         
5451         * assign.cs:
5452         * expression.cs:
5453           Imporved object and collection initialization (C# 3.0).
5454
5455 2007-05-15  Marek Safar  <marek.safar@gmail.com>
5456
5457         A fix for bug #81380
5458         * expression.cs (Is.DoResolve): Only value types have constant `is'
5459         behaviour.
5460
5461 2007-05-15  Raja R Harinath  <rharinath@novell.com>
5462
5463         * statement.cs (ToplevelBlock.child): Remove.
5464
5465 2007-05-15  Raja R Harinath  <harinath@gmail.com>
5466
5467         Rationalize ResolveMeta: refactoring
5468         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
5469         out constant handling code into ...
5470         (Block.DoResolveConstants): ... this.
5471
5472         Rationalize ResolveMeta: kill local_map
5473         * statement.cs (Block.local_map, Block.LocalMap): Remove.
5474         (Block.AssignableSlots): New.
5475         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
5476         for locals -- move code from VariableMap here.  Avoid unnecessary
5477         allocations.
5478         * flowanalysis.cs (FlowBranching.local_map): Remove.
5479         (FlowBranching..ctor): Use Block.AssignableSlots.
5480         (VariableMap): Remove unused constructors.
5481
5482 2007-05-11  Raja R Harinath  <rharinath@novell.com>
5483
5484         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5485
5486 2007-05-11  Marek Safar  <marek.safar@gmail.com>
5487
5488         * typemanager.cs (IsFriendAssembly): Should not be called for building
5489         assembly.
5490
5491 2007-05-09  Marek Safar  <marek.safar@gmail.com>
5492
5493         * literal.cs (NullConstant): Print null in all cases.
5494         
5495         * expression.cs (Binary.ResolveOperator): Implemented delegate
5496          comparison based on C# 2.0 changes.
5497
5498 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
5499
5500         This code is contributed under the MIT X11 license
5501         
5502         The following enables support for several C# 3.0 language features:
5503         
5504         * cs-tokenizer.cs: Added support for the "var" keyword.
5505         
5506         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5507           Added VarExpr class to facilitate type inferencing.
5508         
5509         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5510           to support anonymous types.
5511         
5512         * assign.cs: Added support for type inferencing and initialization.
5513         
5514         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5515         
5516         * expression.cs: Added implicit array support to ArrayCreation.
5517           Added 5 types and 1 interface:
5518           
5519           IInitializable                Implementing classes can inject initializing
5520                                         statements after object instantiation.
5521           
5522           Initializer                   Stores data for object initialization.
5523           
5524           AnonymousType                 An expression for anonymous types.
5525           
5526           AnonymousTypeParameter        Stores data about an anonymous type's field.
5527           
5528           NewInitialize                 An expression for object initialization.
5529           
5530           CollectionInitialize          An expression for collection initialization.
5531         
5532         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5533           statements.
5534
5535 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5536
5537         A fix for bug #81500
5538         * cs-tokenizer.cs: Add special handling for coalescing operator.
5539
5540 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5541
5542         A fix for bug #81529
5543         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5544         its value from base class until it is redefined.
5545
5546 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5547
5548         Fix regression in cs0631-3.cs
5549         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5550         fallback.  Make error fallback catch more cases.
5551
5552 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5553
5554         * cs-parser.jay: Allow parameters in operator declarations to have
5555         attributes. 
5556
5557 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5558
5559         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5560         exists. 
5561
5562         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5563         inside the ContextualReturn, it does not have to be an
5564         ExpressionStatement. 
5565
5566 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5567
5568         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5569         set, set it.
5570
5571 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5572
5573         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5574         method in two methods: ResolveNoDefine and Resolve.
5575
5576         ResolveNoDefine will stop just after ResolveTopBlock has been
5577         called.   
5578
5579         Resolve will then continue by creating a method and issuing the
5580         call to method.Define ().
5581
5582         (AnonymousMethod): Split and implement the new Resolve and
5583         ResolveNoDefine as well.
5584
5585         * lambda.cs (LambdaExpression): Split the anonymous method
5586         resolution code into a separate routine (CoreCompatibilityTest)
5587         from DoCompatibleTest.
5588
5589         (LambdaExpression.TryBuild): New method, this method tries to
5590         build the LambdaExpression with the given set of types to be used
5591         as the types for the various parameters of the lambda expression. 
5592
5593         If the compilation succeed with the given types, the infered type
5594         of the Anonymous method is returned, otherwise null is returned.
5595
5596 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5597
5598         A fix for bug #81414
5599         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5600
5601 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5602
5603         * cs-tokenizer.cs: Change various identifiers here from the
5604         camelCasing to the recommended Linux-like style for instance
5605         variables from the Coding Guidelines. 
5606
5607 2007-04-19  Martin Baulig  <martin@ximian.com>
5608
5609         * convert.cs
5610         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5611         System.Enum to System.ValueType.
5612
5613 2007-04-13  Martin Baulig  <martin@ximian.com>
5614
5615         Rewrote implicit reference conversions.  We need to distinguish
5616         between implicit reference conversions (13.1.4) and implicit
5617         boxing conversions (13.1.5).
5618
5619         According to the spec, there's an an implicit conversion
5620         "From a one-dimensional array-type S[] to IList<T> and base
5621         interfaces of this interface, provided there is an implicit
5622         reference conversion from S to T."  Note that this does not
5623         include boxing conversions.
5624
5625         * convert.cs
5626         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5627         (Convert.ImplicitReferenceConversion): Split into
5628         ImplicitReferenceConversionCore() and
5629         ImplicitBoxingConversionExist().
5630         (Convert.ImplicitReferenceConversionExists): Use the new
5631         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5632
5633 2007-04-12  Martin Baulig  <martin@ximian.com>
5634
5635         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5636         `TypeManager.null_type' checks up to the top of the method.
5637
5638 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5639
5640         A fix for bug #81350
5641         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5642         extension methods.
5643
5644 2007-04-11  Martin Baulig  <martin@ximian.com>
5645
5646         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5647         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5648         to make this work for generic classes; fixes #79561.
5649
5650 2007-04-11  Martin Baulig  <martin@ximian.com>
5651
5652         * expression.cs (As): Add support for nullable types; fixes #79371.
5653
5654 2007-04-11  Martin Baulig  <martin@ximian.com>
5655
5656         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5657         `type.FullName' is null; fixes #80243.
5658
5659 2007-04-11  Martin Baulig  <martin@ximian.com>
5660
5661         * expression.cs (Invocation.IsApplicable): Don't modify the method
5662         if type inference succeeded, but the method was not applicable.
5663         Fixes #81250.
5664
5665 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5666
5667         A fix for bug #81324
5668         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5669         internal and external namespaces containers.
5670
5671 2007-04-10  Martin Baulig  <martin@ximian.com>
5672
5673         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5674         TypeManager.DropGenericMethodArguments() so we also call
5675         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5676
5677 2007-04-10  Martin Baulig  <martin@ximian.com>
5678
5679         * iterators.cs (Iterator.CreateIterator): Don't crash if
5680         `method.ReturnType' is null.  This happens if something went wrong
5681         while resolving that typ (we already reported an error in this case).
5682
5683 2007-04-10  Martin Baulig  <martin@ximian.com>
5684
5685         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5686         generic interfaces; report the CS0144 directly.
5687
5688 2007-04-10  Martin Baulig  <martin@ximian.com>
5689
5690         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5691         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5692
5693 2007-04-10  Martin Baulig  <martin@ximian.com>
5694
5695         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5696
5697 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5698
5699         A better fix
5700         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5701         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5702
5703         Fix #81338
5704         * statement.cs (For.Resolve): If resolution fails, use
5705         KillFlowBranching.
5706
5707 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5708
5709         * anonymous.cs (MakeName): Make faster and zero-based.
5710         (VerifyExplicitParameterCompatibility): Back to mode where generic
5711         parameter is ignored.
5712         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5713
5714         * class.cs (EmitType): Method can emit another new method.
5715
5716         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5717
5718         * driver.cs: Updated.
5719
5720         * lambda.cs: Reuse predefined empty parameters.
5721
5722         * parameter.cs: Updated
5723
5724         * support.cs: Implemented InflateTypes.
5725
5726         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5727         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5728
5729 2007-04-03  Martin Baulig  <martin@ximian.com>
5730
5731         Fix #80632.
5732
5733         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5734         version of TypeManager.IsOverride() which also works with generic
5735         types.  
5736
5737 2007-04-03  Martin Baulig  <martin@ximian.com>
5738
5739         Fix #81044.
5740
5741         * convert.cs
5742         (Convert.ExplicitReferenceConversion): We need to cast when
5743         converting from IList<T> to S[].
5744
5745 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5746
5747         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5748         at this level.
5749         
5750         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5751
5752 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5753
5754         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5755         argument and return type inferring.
5756
5757         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5758         (ReturnType): Turned to property.
5759
5760         * statement.cs (Return): Implemented return type inferring.
5761
5762         * support.cs (ReflectionParameters): Use local types if possible.
5763
5764 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5765
5766         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5767         (FlowBranching.UsageVector): Update to changes.
5768
5769         Prepare to kill 'Reachability'
5770         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5771         argument of constructor.
5772
5773 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5774
5775         Prepare to kill 'Reachability'
5776         * flowanalysis.cs (UsageVector.is_unreachable): New.
5777         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5778         'reachability', and verify they're consistent.
5779
5780         Fix #81121
5781         * expression.cs (New.EmitStatement): Handle type parameters here too.
5782
5783 2007-03-29  Martin Baulig  <martin@ximian.com>
5784
5785         Fix #79148.
5786
5787         * anonymous.cs
5788         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5789         CompilerGeneratedClass.
5790         (ScopeInfo.EmitScopeInstance): Make this protected.
5791         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5792         `ec.CurrentAnonymousMethod.Scope == Scope'.
5793
5794         * statement.cs (Block.ScopeInfo): Make this a property.
5795
5796 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5797
5798         Prepare to kill 'Reachability'
5799         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5800         (FlowBranching.UsageVector.Reachability): Remove property.
5801         (FlowBranching.UsageVector.IsUnreachable): New property.
5802         (FlowBranching.UsageVector.ResetBarrier): New.
5803         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5804         * codegen.cs, statement.cs: Update to changes.
5805
5806 2007-03-27  Martin Baulig  <martin@ximian.com>
5807
5808         Fix #81209.
5809
5810         * decl.cs
5811         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5812         generic types.
5813
5814 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5815
5816         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5817         instead of TriState.  Remove all mention of TriState.
5818
5819         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5820         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5821         and maintain invariants.
5822
5823 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5824
5825         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5826
5827 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5828
5829         * expression.cs: Stop using obsolete 2.0 opcodes.
5830
5831 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5832
5833         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5834         one of the latests Martin's fixes.
5835
5836 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5837
5838         * expression.cs: On BigEndian systems, swap the bytes, temporary
5839         solution until we get a new bitconverter class.
5840
5841 2007-03-23  Martin Baulig  <martin@ximian.com>
5842
5843         Fix #81158.
5844
5845         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5846         "Method" and "Method`1".  Normally, a cache lookup is done on the
5847         "Method" form (ie. without the generic arity), but this one makes
5848         lookups on the full form work as well.
5849
5850 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5851
5852         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5853         unused properties.
5854
5855 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5856         * class.cs: 
5857         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5858         ordered_member_list, to TypeBuilder to store members to be defined
5859         in the order they were parsed in.
5860         - ordered_explicit_member_list contains all properties indexers
5861           and methods that are defined as explicit implementation of an
5862           interface or base class.
5863         - ordered_member_list contains all properties indexers and methods
5864           that are not defined as explicit implementation of an interface
5865           or base class.
5866
5867         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5868         functionality in these removed classes has been replaced with 
5869         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5870         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5871
5872         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5873         to CheckForDuplications inside GetMethod and SetMethod Define Method
5874         to handle method property and indexer name conflicts.
5875
5876         Fixes #79434
5877
5878         All code is contributed under the MIT/X11 license.
5879
5880 2007-03-20  Martin Baulig  <martin@ximian.com>
5881
5882         * class.cs (TypeContainer.Interfaces): Removed; they're now
5883         included in `TypeContainer.Types'.
5884
5885 2007-03-20  Martin Baulig  <martin@ximian.com>
5886
5887         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5888
5889         * class.cs (TypeContainer.CreateType): New public method.  This is
5890         now called before DefineType() to create the TypeBuilders.
5891         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5892         has already been created by CreateType().
5893         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5894         don't resolve our base classes here; this has been moved into
5895         DefineBaseTypes().  We're now called from CreateType().
5896         (TypeContainer.DefineBaseTypes): New private method; resolve our
5897         base classes here.  We're now called from DefineType().
5898
5899         * rootcontext.cs
5900         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5901         our types first to create all the TypeBuilders.  After that, call
5902         TypeContainer.DefineType() on all the types which'll resolve their
5903         base classes and setup the resolve order.
5904
5905 2007-03-20  Martin Baulig  <martin@ximian.com>
5906
5907         * class.cs (TypeContainer.Enums): Removed; they're now included in
5908         `TypeContainer.Types'.  
5909
5910 2007-03-20  Martin Baulig  <martin@ximian.com>
5911
5912         * class.cs
5913         (TypeContainer.DefineType): Don't call ResolveMembers() here.
5914         (TypeContainer.DoResolveMembers): Call DefineType() on our
5915         `compiler_generated' classes; moved here from DefineNestedTypes().
5916
5917         * rootcontext.cs
5918         (RootContext.ResolveTree): Call ResolveMembers() on all
5919         TypeContainer's in the `type_container_resolve_order'.
5920
5921 2007-03-19  Marek Safar  <marek.safar@gmail.com>
5922
5923         * class.cs: Use corlib to handle InternalMethodImplAttribute.
5924
5925 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5926
5927         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5928         implementation flags.
5929
5930 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5931
5932         * class.cs: More optimizations for type parameters.
5933
5934 2007-03-15  Marek Safar  <marek.safar@gmail.com>
5935
5936         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5937
5938         * ecore.cs, parameter.cs: More common code for both corlibs.
5939
5940         * typemanager.cs (IsGenericMethod): Simplified.
5941
5942 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5943
5944         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5945         'returns'.
5946         * statement.cs, iterators.cs, lambda.cs: Update to changes.
5947
5948         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5949         unconditionally.  Simplify explanation.
5950         (Try.Resolve, Using.Resolve): Likewise.
5951
5952 2007-03-15  Martin Baulig  <martin@ximian.com>
5953
5954         Fix #80731.
5955
5956         * decl.cs (DeclSpace): If we're a partial class, use our
5957         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5958
5959 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5960
5961         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5962         'throws'.
5963         (FlowBranching.UsageVector): Update to changes.
5964         (FlowBranching.MergeSiblings): Likewise.
5965         * statement.cs: Likewise.
5966
5967 2007-03-15  Martin Baulig  <martin@ximian.com>
5968
5969         Fix #79302.
5970
5971         * decl.cs
5972         (MemberCache): Added a special .ctor for type parameters.
5973
5974         * typemanager.cs
5975         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5976         `MemberCache'.  
5977
5978 2007-03-09  Martin Baulig  <martin@ximian.com>
5979
5980         * enum.cs (Enum): Make this a TypeContainer.
5981         (EnumMember): Derive from `Const'.
5982
5983         * const.cs
5984         (Const.DoResolveValue): New protected virtual method; move most of
5985         the functionality of ResolveValue() here so we can override it in
5986         `EnumMember'.
5987         (Const.CreateConstantReference): Make this virtual.
5988
5989         * class.cs (Kind): Add `Kind.Enum'.
5990         (TypeContainer.Emit): Don't emit the enums here; they're already
5991         in the `RootContext.typecontainer_resolve_order'.
5992
5993         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5994         here; they're already in the `typecontainer_resolve_order'.
5995
5996         * ecore.cs (EnumConstant.ConvertImplicitly): Add
5997         TypeManager.DropGenericTypeArguments().
5998
5999         * typemanager.cs
6000         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6001         (TypeManager.IsEnumType): Likewise.
6002         (TypeManager.EnumToUnderlying): Likewise.
6003         (TypeManager.IsEqual): Add support for enums.
6004
6005 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6006
6007         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6008         DefaultParameterValueAttribute to be undefined, say if System.dll
6009         is not referenced.
6010
6011 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6012
6013         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6014         any mscorlib.
6015
6016 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6017
6018         * class.cs, parameter.cs: Unified parameters verification.
6019
6020 2007-03-08  Martin Baulig  <martin@ximian.com>
6021
6022         * cs-parser.jay (constructor_header): Pass the location to the
6023         newly created TopLevelBlock.
6024
6025 2007-03-07  Martin Baulig  <martin@ximian.com>
6026
6027         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6028
6029 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6030
6031         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6032         with the changes from David, fixes the build.
6033
6034 2007-03-05  David Mitchell  <dmitchell@logos.com>
6035
6036         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6037         and its base interfaces to a one-dimensional array type S[],
6038         provided there is an implicit or explicit reference conversion
6039         from S to T.
6040
6041 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6042
6043         * cs-tokenizer.cs: Implemented basic linq grammar.
6044
6045         * driver.cs: Set linq lang version on demand.
6046
6047 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6048
6049         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6050
6051 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6052
6053         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6054         (Fixes #80455)
6055
6056         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6057         here.
6058         Check property and event extern attributes.
6059
6060         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6061         charset.
6062
6063 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6064
6065         A fix for bug #80407
6066         * ecore.cs: Don't report ambiguity error when methods have same parent.
6067
6068 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6069
6070         A fix for bug #80878
6071         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6072
6073 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6074
6075         * attribute.cs: Enable ExtensionAttribute presence test.
6076
6077 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6078
6079         * class.cs: Warn about missing GetHashCode only when Equals is override.
6080
6081         * decl.cs: Check accessibility of type arguments.
6082
6083         * typemanager.cs: Correctly report nullable array.
6084
6085 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6086
6087         * class.cs, report.cs: Capture more details when things go wrong.
6088
6089 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6090
6091         A fix for bug #80650
6092         * cs-parser.jay: Anonymous container starts at constructor declaration
6093         and not at block beginning because it has to be usable in constructor
6094         initializer.
6095
6096         * statement.cs: Use context location and not block one for error reporting.
6097
6098 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6099
6100         A fix for bug #78712
6101         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6102         too.
6103
6104 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6105
6106         A fix for bug #80493 by Atsushi Enomoto
6107         * cs-parser.jay: Ignore invalid attribute target.
6108
6109 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6110  
6111         * cs-tokenizer.cs: Ignore '\0' as white space character.
6112
6113 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6114
6115         * cs-parser.jay: Add support for lambda expressions to the mcs
6116         compiler as well.
6117
6118         * lambda.cs: Only clone when we are probing, not on the final call
6119         (Compatible is the final call). 
6120
6121         * statement.cs (CloneContext): Introduce class to provide block
6122         remapping during clone.
6123
6124         All statements Clone themselves now.
6125
6126         (Clone): special handling for blocks, when we clone a block, we
6127         register the block inside this routine, as children of the block
6128         might trigger a lookup. 
6129         
6130         * expression.cs: Add support for CloneContext in all expressions. 
6131         
6132 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6133  
6134         A fix for bug #80493
6135         * statement.cs: Report ambiguous warning when interfaces are not related.
6136
6137 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6138
6139         C# 3.0 extension methods.
6140
6141         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6142         cannot be used directly.
6143
6144         * class.cs (Class.Emit): Emit extension attribute if any class method
6145         is extension method.
6146         (Method.Define): Add basic extension method validation conditions.
6147         (Method.Emit): Emit extension attribute for method.
6148
6149         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6150         extension method exists. Currently we follow same approach as Microsoft
6151         does, emit even if a method or a class are private but this can change
6152         later.
6153
6154         * cs-parser.jay: Add handling of `this' keyword in method parameters
6155         context.
6156
6157         * decl.cs (DeclSpace.IsStaticClass): New property.
6158         (MemberCache.FindExtensionMethods): Looks for extension methods with
6159         defined name and extension type.
6160
6161         * doc.cs: Updated after OverloadResolve changes.
6162
6163         * driver.cs: Add new soft reference to System.Core.dll.
6164
6165         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6166         (ExtensionMethodGroupExpr): Represents group of extension methods.
6167
6168         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6169         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6170         to MethodGroupExpr and made non-static for easier customization.
6171         (Invocation.DoResolve): Add extension method lookup when no standard
6172         method was found.
6173         (MemberAccess.DoResolve): Try extension methods if no member exists.
6174
6175         * modifiers.cs: Add METHOD_EXTENSION modifier.
6176
6177         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6178         as well as candidate extension type.
6179         (ComputeNamespaces): When assembly constains extension methods registers
6180         them.
6181         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6182         extension method lookup.
6183         (Namespace.LookupExtensionMethod): Looks for extension method in this
6184         namespace.
6185         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6186         find a method which matches name and extensionType.
6187
6188         * parameter.cs (Parameter): Add This modifer.
6189         (HasExtensionMethodModifier): New property.
6190         (Resolve): Add extension parameter check.
6191         (ModFlags): turned to property to exclude this modifier as it is not real
6192         parameter modifier.
6193         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6194
6195         * support.cs (ParameterData): Add ExtensionMethodType.
6196         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6197
6198         * typemanager.cs: Add type and ctor extension attribute type.
6199
6200 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6201
6202         * report.cs (DisableErrors, EnableErrors): used to prevent error
6203         output when we are "trying" to compile various methods with
6204         different types. 
6205
6206         * ecore.cs (Expression): Add Clone method that calls the virtual
6207         CloneTo method.  The current CloneTo method in Expression throws
6208         an exception so we can track down all the places where this must
6209         be implemented (not using abstract, because that would be a lot of
6210         up-front-work before we can start testing the implementation
6211         idea). 
6212
6213         Important: we only need Clone capabilities for expressions created
6214         by the parser, as the expressions we will be cloning are
6215         expressions in the pre-resolved state.   This vastly simplifies
6216         the work required. 
6217         
6218         (SimpleName): Add CloneTo that does nothing.
6219         (EmptyCast): Add CloneTo.
6220         
6221         * expression.cs (Binary): Implement CloneTo.
6222         (Invocation.IsApplicable): Store the current ec in
6223         EmitContext.TempEc and restore it on return.  This is used so we
6224         do not have to sprinkle hundres of methods with an extra
6225         EmitContext, we know that the only user is the lambda expression
6226         ImplicitConversionExists code. 
6227         
6228         (Argument): Add Cloning capabilities.
6229         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6230         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6231         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6232         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6233         IndexerAccess): Add Clone capability.
6234
6235         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6236
6237         (Argument): Add cloning capability.
6238
6239         * assign.cs (Assign): Implement CloneTo.
6240
6241         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6242         
6243         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6244         version by calling Convert with the EmitContext (that we are
6245         currently storing in ec, this is not great, but will do for now,
6246         to avoid passing EmitContext parameters to hundreds of functions
6247         that do not need them now).
6248
6249         (SetExpression): Remove, it is not needed.
6250         
6251         (ContextualReturn): Implement CloneTo.
6252
6253         * statement.cs (Statement): Implement cloning infrastructure,
6254         similar to expressions.
6255
6256         (Block): Partial implementation of Clone for statements.
6257
6258         (Return): Implement clone.
6259         
6260         * constant.cs (Constant.CloneTo): New method, does nothing.
6261
6262         * codegen.cs (TempEc): Add a static EmitContext as a temporary
6263         solution, until we decide how to exactly do this.  
6264         
6265 2007-02-14  Marek Safar  <marek.safar@gmail.com>
6266  
6267         A fix for bug #80493
6268         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6269         a property is override we need to use second accessor.
6270
6271 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6272  
6273         A fix for bug #80418
6274         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6275         methods.
6276
6277 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6278
6279         Another fix for bug #80749
6280         * pending.cs: Abstract class has priority over interfaces.
6281
6282 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6283
6284         Another fix for bug #80749
6285         * pending.cs: Abstract class has priority over interfaces.
6286
6287 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6288
6289         Another fix for bug #80749
6290         * pending.cs: Abstract class has priority over interfaces.
6291
6292 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6293
6294         Another fix for bug #80749
6295         * pending.cs: Abstract class has priority over interfaces.
6296
6297 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6298
6299         * class.cs Better error message.
6300
6301         * driver.cs: Add shorter versions of -optimize option.
6302
6303 2007-02-13  Martin Baulig  <martin@ximian.com>
6304
6305         * class.cs (Constructor.Emit): Check the return value of
6306         ec.ResolveTopBlock() and return on error.
6307
6308 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6309
6310         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6311         message to fix error message regression.
6312
6313 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6314
6315         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6316
6317 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6318
6319         A fix for bug #80749
6320         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6321         its parent container.
6322
6323         * class.cs (DefineFieldInitializers): Each initializer can has different
6324         resolve context.
6325
6326         * const.cs: Updated.
6327
6328 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6329
6330         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6331         now all the heavy lifting to check that embedded statements or
6332         expressions have the right form is done in the ContextualReturn.
6333
6334         (ContextualReturn): New class.  
6335
6336         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6337         method that can be invoked to report 201, so we do not replicate
6338         this everywhere.
6339
6340         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6341         
6342         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6343         treating tabs as spaces. 
6344
6345 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6346
6347         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6348         * assign.cs: Use full implicit conversion for right side check.
6349
6350 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6351
6352         * statement.cs (Switch): Switch over boolean type is not standardized.
6353
6354 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6355
6356         A fix for bug #80755
6357         * decl.cs (FindBaseEvent): Don't use method cache for events.
6358
6359 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6360
6361         * cs-parser.jay: Better syntax error handling.
6362
6363         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6364         instead of underlying type value.
6365
6366 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6367
6368         * driver.cs: Check define identifier before is registered.
6369
6370         * namespace.cs: Use existing error message.
6371
6372         * report.cs: New warning.
6373
6374 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6375
6376         A fix for bug #80742
6377         * expression.cs: Delegate Invoke method can be called directly.
6378
6379 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6380
6381         A fix for bug #80676
6382         * class.cs (IsEntryPoint): The Main method can have params modifier.
6383
6384 2007-02-04  Miguel de Icaza  <miguel@novell.com>
6385
6386         * parameter.cs (Parameter, Parameters): Add Clone method.
6387
6388         * anonymous.cs (Compatible): Turn method into virtual method, so
6389         LambdaExpression can implement a different behavior.
6390
6391         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6392         out the basic checking here, so it can be used by
6393         LambdaExpressions.
6394         
6395         * lambda.cs: Introduce "Compatible" function that will do the
6396         heavy lifting.
6397
6398 2007-02-02  Marek Safar  <marek.safar@gmail.com>
6399
6400         * attribute.cs: Unified one error message.
6401
6402         * class.cs (Class): Use type attributes and not properties to test static
6403         class.
6404         (IsEntryPoint): Don's pass local variable.
6405
6406         * convert.cs: Removed duplicate check.
6407
6408         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6409
6410         * driver.cs: Don't crash when soft reference does not exist.
6411
6412         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6413         (UsingEntry): Removed redundant allocation.
6414
6415         * parameter.cs: Add fast path for type parameters.
6416
6417         * support.cs: Don't allocate attribute when it's not used.
6418
6419 2007-01-30  Miguel de Icaza  <miguel@novell.com>
6420
6421         * anonymous.cs
6422         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6423         this into a virtual method, so we can override it in LambdaExpression.
6424
6425         * driver.cs: Improve diagnostics in case of failure. 
6426
6427         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6428         write a function that is slightly more complex and that parses:
6429
6430         type identifier [, type identifier]* )
6431
6432         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6433         this expression:
6434
6435                 (canEmpty ? i >= 0 : i > 0)
6436
6437 2007-01-30  Raja R Harinath  <rharinath@novell.com>
6438
6439         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6440         exception on possibly valid code.
6441
6442 2007-01-29  Raja R Harinath  <rharinath@novell.com>
6443
6444         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6445         Push/PopPosition.
6446         (parse_opt_type_arguments): Remove.  It's almost the same as
6447         parse_less_than.
6448         (parse_namespace_or_typename): Use parse_less_than.
6449
6450 2007-01-28  Miguel de Icaza  <miguel@novell.com>
6451
6452         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6453         this bug took a few hours to find, because the state saved and
6454         restored by PushPosition and PopPosition was ignoring the state of
6455         parse_generic_less_than.
6456
6457         I can also now remove the handling of OP_LT and OP_GT, this solves
6458         the big mistery.
6459         
6460         * cs-tokenizer.cs: store the location for the ARROW token, we use
6461         that in the parser.
6462
6463         (PushPosition, PopPosition): save/restore also `current_token',
6464         restore `parse_generic_less_than' (was missing).
6465
6466         (parse_opt_type_arguments): use parse_type, not
6467         parse_namespace_or_typename to parse types.
6468
6469         * lambda.cs: Empty new file, will eventually have the lambda
6470         expression implementation.
6471
6472         * lambda.test: used to test the internal tokenizer. 
6473
6474         * report.cs (FeatureIsNotISO1): Rename from
6475         FeatureIsNotStandardized, because it was about the language level
6476         (1 vs 2) it was not about standarization.
6477
6478         (FeatureRequiresLINQ): New.
6479
6480         * support.cs (SeekableStreamReader): Only require that the reader
6481         is a TextReader, not a StreamReader, so we can plug StringReader. 
6482
6483         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6484         given position in the input stream the following tokens can be
6485         parsed as a type followed by an identifier.
6486
6487         (is_punct): after a '(' if parse_type_and_parameter returns true,
6488         then return a special token OPEN_PARENS_LAMBDA which is used to
6489         avoid reduce/reduce errors in the grammar for the
6490         lambda_expression rules.
6491
6492         (parse_type): implement a type parser inside the
6493         tokenizer, the parser only returns true or false depending on
6494         whether the input at a given position can be parsed as a type.
6495
6496         (peek_token): new method used during type parsing.
6497
6498 2007-01-28  Raja R Harinath  <rharinath@novell.com>
6499
6500         Fix #80531
6501         * anonymous.cs (ScopeInfo.InflateParameters): New.
6502         (AnonymousContainer.Resolve): Use it to redirect types of
6503         delegate parameters.
6504
6505 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6506
6507         Fix #80530
6508         * expression.cs (Error_InvalidArguments): Don't use two different
6509         messages for CS1503.  Use ExtraInformation and
6510         SymbolRelatedToPreviousError instead.
6511
6512         Fix #80358
6513         * decl.cs (DeclSpace.initialize_type_params): Don't access
6514         'type_params' of a partial class directly.
6515
6516 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6517
6518         * constant.cs: Removed a handful of out-of-range checks that were
6519         not necessary. 
6520
6521 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6522
6523         * expression.cs (CheckUselessComparison): Add additional check for char
6524         constants.
6525
6526         * namespace.cs: Fixed typo.
6527
6528 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6529
6530         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6531         gone, instead we inline the test, preventing the needless casts to
6532         longs, ulongs and doubles for the parameters, avoiding calls to
6533         methods that overchecked stuff, and instead inlined things
6534         nicely. 
6535
6536 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6537
6538         * cs-parser.jay: Better parameter error handling.
6539
6540 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6541
6542         A fix for bug #80368, #80522
6543         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6544         whether array initializer contains constants only.
6545         (ArrayCreation.Emit): Use better formula to decide when
6546         are array initializers for static initialization.
6547         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6548         have to emit even constants otherwise they are pre-initialized.
6549
6550 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6551             Raja R Harinath  <rharinath@novell.com>
6552
6553         Fix emit order of 'get' vs. 'set'.
6554         * support.cs (Accessors): New.
6555         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6556         Note the order in which accessors are declared in the source.
6557         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6558         Refactored from Property.Define and Indexer.Define.
6559         (PropertyBase.DefineAccessors): New helper that calls the above in
6560         appropriate order as noted by the parser.
6561         (Property.Define, Indexer.Define): Update to changes.
6562         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6563
6564 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6565
6566         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6567         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6568         there's an implicit conversion from the current type to the target
6569         type before converting the underlying constant.
6570
6571 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6572
6573         * const.cs (ResolveValue): Updated after constant conversion was made more
6574         generic.
6575
6576         * constant.cs (GetAttributableValue): constant to object conversion is
6577         used for attributes only.
6578         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6579         constant conversions.
6580         (LongConstant.ConvertImplicitly): Ditto.
6581
6582         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6583         (ImplicitConversionStandard): Handle constant conversion as extra step.
6584         It solves the issue when constant conversion was called indirectly like
6585         inside array initializer and constant folding was skipped.
6586
6587         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6588         this change.
6589
6590         * statement.cs(ImplicitConversionStandard): Updated after constant
6591         conversion was made more generic.
6592
6593 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6594
6595         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6596         Constraints, solves the problem where the compiler incorrectly
6597         reported that a type parameter was not constrained to a class (Bug
6598         80518)
6599
6600 2007-01-14  Marek Habersack  <grendello@gmail.com>
6601
6602         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6603
6604 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6605
6606         A fix for bug #80368
6607         * assign.cs (FieldInitializer): New class implements field
6608         initializer statement.
6609
6610         * attribute.cs: Update after FieldMember rename.
6611
6612         * class.cs (PropertyBasedMember): New common class for property based
6613         types.
6614         (InterfaceMemberBase): New base class for all members which can be used as
6615         an interface members.
6616         (MethodCore): Moved really common code to InterfaceMemberBase.
6617         (Method.Define): Equal and GetHasCode detection is relevant for methods
6618         only.
6619         (MethodData.Define): Don't assume that public event implements an
6620         interface automatically.
6621         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6622         modifier is used.
6623         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6624         (FieldMember): Merged with FieldBase.
6625         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6626         event extern modifier can be used.
6627         (EventField.EventFieldAccessor): Moved event field specific code here.
6628         (Event.AllowedModifiers): Even event can be extern.
6629         (Event.FindOutBaseMethod): New override specific to events.
6630         (Indexer.parameters): Reintroduce parameters because base class holds
6631         only properties common data.
6632         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6633         need do extra parameters check.
6634
6635         * const.cs: Update after FieldMember rename.
6636
6637         * decl.cs (MemberCache.FindBaseEvent): New method.
6638
6639         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6640         to reflect that indexer is now derived from PropertyBased.
6641
6642         * ecore.cs (GetMemberType): Made public.
6643         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6644         obsolete event.
6645
6646         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6647         
6648         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6649         (RegisterEvent): Removed.
6650         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6651         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6652
6653 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6654
6655         Fix #80249
6656         * statement.cs (CollectionForeach.TryType): Prefer generic
6657         GetEnumerator over non-generic variant.  Fix code to follow comments.
6658
6659 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6660
6661         Fix #80446
6662         * support.cs (ReflectionParameter): Don't use an invalid index on
6663         the generic parameter data.
6664
6665 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6666
6667         * driver.cs: Just add a tiny bit of infrastructure.
6668
6669 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6670
6671         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6672         where field type is struct from current assembly.
6673         
6674         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6675         it is possible.
6676
6677 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6678
6679         A fix for bug #80381
6680         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6681         the core types.
6682
6683         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6684         messages.
6685         (Namespace.LookupType): Always use core types from corlib when speficied.
6686
6687         * report.cs: A new warning.
6688
6689         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6690         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6691         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6692
6693         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6694         (InitCoreTypes): Set expression type of object_type and value_type
6695         immediately after lookup.
6696
6697 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6698
6699         * cs-tokenizer.cs: Accept Pc class characters (Connector
6700         Punctuation) as valid identifiers.  Fixes #78259
6701
6702         * expression.cs (Invocation.DoResolve): Moved the check for the
6703         use of `this' for doing method calls to the Invocation resolution
6704         step, after overload resolution has taken place instead of doing
6705         the check at the low-level `This.DoResolve' level.
6706
6707         The `This.DoResolve'(appens before overload resolution, so it has
6708         no way of knowing if the method that will be called will be
6709         instace or static, triggering an erroneous report for cs0188 (Bug
6710         78113).
6711
6712         We now do the check for instance method invocations after we know
6713         what method will be called.
6714
6715         (This.CheckThisUsage): Move the actual use of this structure
6716         checking into its own method and expose it. 
6717
6718         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6719         EmitContext.
6720
6721         Exceptions: Null.ConvertImplicitly,
6722         Constant.ImplicitConversionRequired as there are too many call
6723         sites for passing the ec. 
6724
6725         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6726         EmitContext, if the value is null, then we do not try to provide
6727         the extra information from the error (If a userdefined conversion
6728         exists, as UserDefinedConversion requires a non null-EmitContext).
6729
6730         Fixes: #80347
6731
6732 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6733
6734         * flowanalysis.cs (MyBitVector): Document some invariants.
6735         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6736         introduced below, and add a couple of others, 
6737
6738 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6739
6740         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6741         GetPropertyFromAccessor and GetEventFromAccessor.
6742         
6743         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6744         overrides non-obsolete one.
6745         (Indexer.Define): Error message has been moved to the parser.
6746
6747         * cs-parser.jay: Better syntax errors handling.
6748
6749         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6750         when an invocation has no arguments.
6751
6752         * ecore.cs: Removed not used caching.
6753
6754         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6755         implementation.
6756
6757         * report.cs: Add a new warning.
6758
6759         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6760
6761         * typemanager.cs (enumeration_type): Removed.
6762         (CSharpSignature): Reuses IsSpecialMethod.
6763         (IsEqual): Hack for MS BCL.
6764         (GetPropertyFromAccessor): New method.
6765         (GetEventFromAccessor): New method.
6766         (IsSpecialMethod): Fixed to handle more cases.
6767
6768 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6769
6770         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6771         Made white spaces array static.
6772
6773         * ecore.cs (RemoveGenericArity): Optimized.
6774
6775         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6776         10 times faster).
6777         (MyBitVector.initialize_vector): Simplified.
6778
6779 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6780
6781         * ecore.cs: Am not entirely happy with this hack, but it seems to
6782         address the issue in 80257 (a small test case for
6783         CreativeDocs.NET). 
6784
6785         I set the MethodGroupExpr.Type to an internal compiler type
6786         (itself in this case) to force the resolution to take place.   Why
6787         it does not take place with a null is beyond me.
6788
6789 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6790
6791         A fix for bug #80288
6792         * expression.cs (ResolveOperator): Consider user defined conversion for
6793         logical and operator too.
6794         (EmitBranchable): Optimization for logical and when full constant folding
6795         could not be applied but one operand is constant.
6796
6797 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6798
6799         * class.cs (GetClassBases): Write 5 times every day, will never use
6800         FullName for error reporting.
6801
6802         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6803
6804 2006-12-19  Martin Baulig  <martin@ximian.com>
6805
6806         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6807         the symbol file info here.
6808
6809 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6810
6811         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6812         of `elseif' is taking then following sections are not taking.
6813         Fixes an issue reported on mono mailing list.
6814
6815 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6816
6817         A fix for bug #80300
6818         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6819         a caller is not taking.
6820
6821 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6822
6823         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6824         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6825         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6826         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6827         * class.cs: Update to changes.
6828
6829 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6830
6831         A fix for bug #79934
6832         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6833         partial container.
6834
6835         * class.cs (ResolveMembers): Register an iterator in current container and
6836         not in shared one.
6837
6838 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6839
6840         Fix test-543.cs
6841         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6842         satisfy a params annotated parameter.
6843
6844 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6845
6846         A fix for bug #77014
6847         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6848         paramters correctly and not rely on hacks in Parameters class.
6849         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6850         at any possition.
6851         (Invocation.VerifyArgumentsCompat): Ditto.
6852         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6853         any possition.
6854
6855         * parameter.cs (HasParams): Don't assume that params is the last one.
6856
6857         * support.cs (ReflectionParameters.ctor): Look for params attribute
6858         correctly.
6859         (ReflectionParameters.ParameterType): Removed hack when we returned last
6860         parameter for out of range parameters.
6861         (ParameterName, ParameterModifier): Ditto.
6862
6863 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6864
6865         A fix for bug #79987
6866         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6867         when assembly is not CLS compliant but type is. I have no idea why is this
6868         allowed.
6869
6870         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6871
6872 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6873
6874         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6875         in struct constructors, they are basically no-ops.
6876
6877 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6878
6879         * cs-tokenizer.cs (Position): Save preprocessor status too.
6880
6881 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6882
6883         A fix for bug #77794
6884         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6885
6886 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6887
6888         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6889         Fixes #69299.
6890         (pp_expr): Report error for an invalid expression.
6891         (handle_preprocessing_directive): Simplified; add more error checking.
6892
6893 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6894
6895         A fix for bug #74939
6896         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6897         directives handling.
6898
6899 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6900
6901         A fix for bugs #80093, and #75984
6902         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6903         logic, it seems to me as it worked before "by coincidence".
6904         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6905         (cleanup): Enabled endif check.
6906
6907 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6908
6909         A fix for bug #80162
6910         * statement.cs (CollectionForeach.TryType): Generics and non-generics
6911         enumerators are never ambiguous.
6912
6913 2006-12-08  Raja R Harinath  <rharinath@novell.com>
6914
6915         Fix #80060
6916         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6917
6918 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6919
6920         A fix for bug #80144
6921         * class.cs (EventProperty.Define): Explicit implementation means
6922         that an even is used.
6923
6924 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6925
6926         Fixes the operators implementation (part II)
6927
6928         * cfold.cs (DoConstantNumericPromotions): Renamed to
6929         DoBinaryNumericPromotions and simplified.
6930         (BinaryFold): Couple of conversion fixes; simplified.
6931
6932         * constant.cs, ecore.cs, literal.cs
6933         (ToType): Renamed to ConvertImplicitly.
6934         (Reduce): Renamed to ConvertExplicitly.
6935
6936         * class.cs, convert.cs: Updated.
6937
6938         * expression.cs: TryReduce doesn't throw an exception.
6939
6940 2006-12-01  Marek Safar  <marek.safar@gmail.com>
6941
6942         A fix for bug #80108
6943         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6944         compatible.
6945
6946 2006-11-30  Marek Safar  <marek.safar@gmail.com>
6947
6948         Fixes unary operators implementation (part I)
6949         Also fixes #80026
6950
6951         * cfold.cs (Error_CompileTimeOverflow): Made internal
6952
6953         * const.cs (IConstant): Changed to use reference to constant and
6954         not constant itself.
6955         Updated IConstant implementations.
6956
6957         * constant.cs (CreateConstant): New factory method.
6958         Updated IConstant implementation.
6959
6960         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6961
6962         * ecore.cs: Updated to use CreateConstantReference.
6963
6964         * enum.cs: Reflects IConstant changes.
6965
6966         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6967
6968         * literal.cs (NullConstant): Change to be independently usable.
6969
6970 2006-11-29  Martin Baulig  <martin@ximian.com>
6971
6972         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6973         we need to emit the scope initializer before calling the base .ctor.
6974
6975         * anonymous.cs: Merged back from the new anonymous methods branch.
6976         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6977
6978         * expression.cs (ParameterReference.DoResolveBase): Create a
6979         "normal" ScopeInfo when capturing parameters rather than using the
6980         root scope; this makes things work with anonymous methods having
6981         parameters.
6982
6983         * statement.cs
6984         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6985
6986 2006-11-22  Marek Safar  <marek.safar@gmail.com>
6987
6988         A fix for bug #79987
6989         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6990         check to a base class.
6991         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6992         only when assembly has missing attribute.
6993         * report.cs: Update.
6994
6995 2006-11-21  Marek Safar  <marek.safar@gmail.com>
6996
6997         * cs-tokenizer.cs: Merged with gmcs version.
6998
6999 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7000
7001         * cs-tokenizer.cs,
7002         * cs-parser.jay: Better error message when partial keyword is misplaced.
7003
7004 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7005
7006         A fix for bug #79810
7007         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7008         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7009         a RuntimeWrappedException by default.
7010
7011 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7012
7013         A fix for bug #79843
7014         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7015         implementation.
7016         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7017
7018 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7019
7020         * driver.cs, namespace.cs: Uses faster IndexOf version.
7021
7022 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7023
7024         A fix for bug #79941
7025         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7026         operators.
7027         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7028         even if internal name is different.
7029         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7030         (UserDefinedConversion): Simplified as the operators cannot be internal.
7031         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7032         conversions.
7033         (MethodLookup): Replaced EmitContext with parentType.
7034         * expression.cs: Updated.
7035
7036 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7037
7038         * driver.cs (BadAssembly): Handle all the ugliness of
7039         DefineDynamicAssembly.
7040
7041 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7042
7043         Address parts of #58244 -- most of what's left is in the runtime
7044         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7045         CS1509 error checks, and handle them for all assembly loads, not
7046         just the first invocation.
7047         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7048         * codegen.cs (AssemblyClass.AddModule): ... here.
7049
7050 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7051
7052         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7053         IEnumerable<T> is ambiguous.
7054
7055 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7056
7057         A fix for bug #67689
7058         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7059         GetEnumerator is ambiguous.
7060
7061         * report.cs: Add new warning.
7062
7063 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7064
7065         A fix for bug #78602
7066         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7067         to protected member can be nested type.
7068
7069 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7070
7071         A fix for bug #78965
7072         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7073         to protected member must derive from current type.
7074
7075 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7076
7077         assign.cs: Reuses error method.
7078
7079         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7080         instead of type for constants.
7081         (Expression.Error_ValueAssignment): Common error method.
7082
7083         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7084         for any assignment.
7085
7086 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7087
7088         A fix for bug #79081
7089         * expression.cs (MemberAccess.DoResolve): Check nested type
7090         accessibility.
7091
7092 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7093
7094         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7095
7096 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7097
7098         A fix for bug #76591
7099         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7100
7101 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7102
7103         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7104         type forwarder of the same type multiple times.
7105
7106 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7107
7108         Fix #78820
7109         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7110         instance as an rvalue, even when we later resolve as an lvalue.
7111
7112 2006-10-25  Martin Baulig  <martin@ximian.com>
7113
7114         * anonymous.cs: Fix #79673.
7115
7116 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7117
7118         A fix for bug #79666
7119         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7120         ignored when is optimized (= default value) as its value is already set.
7121
7122 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7123
7124         A fix for bug #79724
7125         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7126         TypeContainer for type lookup.
7127
7128 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7129
7130         A fix for bug #79231
7131         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7132         * expression.cs (OverloadResolve): Always convert type name for
7133         an error message.
7134         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7135         other member.
7136
7137 2006-10-18  Martin Baulig <martin@ximian.com>
7138
7139         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7140
7141 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7142
7143         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7144         an int32, but requesting an int64 from the conversion
7145
7146 2006-10-12  Martin Baulig  <martin@ximian.com>
7147
7148         * anonymous.cs
7149         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7150         
7151 2006-10-12  Martin Baulig  <martin@ximian.com>
7152
7153         * statement.cs
7154         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7155
7156 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7157
7158         * convert.cs: Remove broken code: I was doing the "Existance"
7159         tests for Implicit conversions.
7160
7161 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7162
7163         * convert.cs: Added one missing case in
7164         ImplicitStandardConversionExists uint64 to intptr.
7165
7166         Fixes #59800
7167         
7168         * typemanager.cs (uintptr_type): another core known type.   
7169
7170         * ecore.cs (OperatorCast): routine used to do cast operations that
7171         depend on op_Explicit.  We could change some of the Decimal
7172         conversions to use this.
7173
7174         This one has a probe mechanism that checks both types for an op_
7175         which it coudl be used to eliminate two classes: CastToDecimal
7176         and CastFromDecimal.
7177
7178         * convert.cs: Implement the conversions documented in #59800
7179         
7180 2006-10-10  Martin Baulig  <martin@ximian.com>
7181
7182         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7183         before RootScope.ResolveMembers().
7184
7185         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7186         `CurrentType' if appropriate.
7187
7188 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7189
7190         A fix for bug #78568
7191         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7192         when contains binary operators.
7193         * cs-parser.jay: Updated.
7194
7195 2006-10-09  Martin Baulig  <martin@ximian.com>
7196
7197         * delegate.cs
7198         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7199         moved that into Define() and also do the other type parameter
7200         checks there.  Fixes #79094.  Added gtest-292.cs.
7201
7202         * expression.cs
7203         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7204         since that doesn't include type parameters; don't use `Ldelema'
7205         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7206
7207 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7208
7209         A fix for #77796
7210         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7211         conversion is allowed.
7212
7213 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7214
7215         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7216         error reporting when no error occurs.
7217
7218 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7219
7220         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7221         does not exist.
7222
7223 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7224
7225         Fix #79584
7226         * class.cs (DefineTypeBuilder): Check circular dependencies before
7227         setting the parent of the TypeBuilder.
7228         (CheckRecursiveDefinition): Don't use 'BaseType', since
7229         it may not be valid until after DefineTypeBuilder.  Use
7230         'base_type' instead.
7231
7232 2006-10-04  Martin Baulig  <martin@ximian.com>
7233
7234         Merged the Anonymous Methods patch.
7235
7236         * anonymous.cs, iterators.cs: The new anonymous methods code.
7237
7238         * statement.cs (Variable): New public abstract class.
7239         (LocalInfo.Variable): New public property.
7240         (LocalInfo.ResolveVariable): New public method.
7241         (Block.Flags): Add `IsIterator'.
7242         (Block.AddVariable): Improved the CS0136 check.
7243         (Block.AnonymousChildren): New public property.
7244         (Block.AddAnonymousChild): New public method.
7245         (ToplevelBlock): Update to use the new anonymous method framework.
7246         (ToplevelBlock.ctor): `container' is now a `Block' and not a
7247         `ToplevelBlock'; this is required to correctly implement the
7248         CS0136 check.
7249         (Fixed, Using): Use `TemporaryVariable' instead of directly
7250         creating the `LocalBuilder'.
7251
7252         * parameter.cs (Parameter.ResolveVariable): New public method.
7253         (Parameters.ResolveVariable): Likewise.
7254
7255         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7256
7257         * class.cs (TypeContainer): Replaced the `iterators' list and
7258         corresponding methods with a list of `CompilerGeneratedClass'es.
7259         (TypeContainer.ResolveMembers): New public method.
7260         (Method): `IIteratorContainer' has been replaced by
7261         `IAnonymousHost'.
7262
7263         * expression.cs (VariableReference): New public abstract base
7264         class for `LocalVariableReference', `ParameterReference' and
7265         `This'.
7266
7267         * codegen.cs (EmitContext): Removed `capture_context',
7268         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7269         (EmitContext.EmitThis): Removed.
7270
7271         * cs-parser.jay: Replace `iterator_container' with
7272         `anonymous_host'.       
7273
7274 2006-10-04  Martin Baulig  <martin@ximian.com>
7275
7276         * generic.cs (GenericMethod): Don't make this abstract.
7277         (Constraints.Clone): Added dummy implementation.
7278
7279 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7280
7281         Fix #79577
7282         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7283         'declspaces'.  Avoid allocating arrays willy-nilly.
7284
7285         Fix #79553
7286         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7287         cases out of the switch.
7288
7289 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7290
7291         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7292         message when non-generic type is used with the type arguments.
7293         * expression.cs: Updated.
7294
7295 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7296
7297         Fix #79013
7298         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7299         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7300         Change semantics slightly.  Don't insist on having only one
7301         temporary EmptyExpression -- just throttle the creation of new ones.
7302
7303         Fix #79451
7304         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7305         non-interfaces too.  If no methods are found, don't try to create
7306         a MethodGroupExpr.
7307
7308 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7309
7310         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7311         generic type.
7312
7313         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7314         us produce better error message.
7315
7316 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7317
7318         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7319         of the `|' operator.
7320
7321         * report.cs: A new warning added.
7322
7323 2006-09-27  Martin Baulig  <martin@ximian.com>
7324
7325         * generic.cs (GenericMethod): Don't make this abstract.
7326
7327 2006-09-27  Martin Baulig  <martin@ximian.com>
7328
7329         * report.cs
7330         (InternalErrorException): Added overloaded ctor taking a params array.
7331
7332 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7333
7334         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7335         Fixed the cases when same error was reported twice.
7336
7337         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7338         now report symbol information.
7339
7340 2006-09-25  Martin Baulig  <martin@ximian.com>
7341
7342         * class.cs: Completely unified with the gmcs version.
7343
7344 2006-09-25  Martin Baulig  <martin@ximian.com>
7345
7346         * typemanager.cs (TypeManager.IsNullableType): New public function.
7347         (TypeManager.IsNullableTypeOf): Likewise.
7348         (TypeManager.IsNullableValueType): Likewise.
7349
7350         * class.cs (MethodCore): Added the `GenericMethod' argument from
7351         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7352
7353 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7354
7355         * convert.cs: Unify with gmcs version.
7356
7357 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7358
7359         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7360         verify them as well.
7361
7362         * report.cs: New warning.
7363
7364 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7365
7366         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7367         for anonymous block with out argument.
7368
7369 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7370
7371         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7372         not used private events only.
7373
7374 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7375
7376         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7377
7378         * const.cs (Const.Define): Check for constant type.
7379         (Const.IsConstantTypeValid): Looks for valid constant types.
7380
7381         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7382
7383         * ecore.cs (EmptyConstantCast): New common class for all constant based
7384         EmptyCast(s).
7385
7386         * expression.cs (Is.DoResolve): Handle null constant especially.
7387         (New.DoResolve): Check for new void().
7388         (MemberAccess.DoResolve): Cope with all kind of nulls.
7389
7390         * literal.cs (NullConstant): Uses EmptyConstantCast.
7391         (NullDefault): Based on EmptyConstantCast.
7392         (NullLiteral): Uses EmptyConstantCast.
7393
7394         * statement.cs (Block.ResolveMeta): Check for constant type.
7395
7396 2006-09-22  Martin Baulig  <martin@ximian.com>
7397
7398         * delegate.cs, attribute.cs: Merged with the gmcs versions.
7399
7400 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7401
7402         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7403         not the null type.
7404
7405         Fix part of #79451
7406         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7407         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
7408         code slightly.
7409
7410 2006-09-22  Martin Baulig  <martin@ximian.com>
7411
7412         * ecore.cs: Merged with the gmcs version.
7413
7414         * generic.cs (ConstructedType): New dummy class.
7415         (TypeArguments): Don't make this abstract.
7416
7417         * typemanager.cs
7418         (TypeManager.IsGenericTypeDefinition): New method.
7419         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7420
7421 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7422
7423         * expression.cs (ComposedCast): Check for arrays of TypedReference
7424         before creating the type, not after.
7425
7426 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
7427
7428         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7429         after ToType change.
7430
7431         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7432         when constant must be implicitly convertible.
7433
7434         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7435
7436         * ecore.cs (NullCast): Derives from NullConstant.
7437
7438         * expression.cs (Is.DoResolve): Removed useless variables.
7439         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7440         (New.Constantify): Add enum support.
7441         (MemberAccess.DoResolve): Add warning when accessing null constant or
7442         variable.
7443
7444         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7445         property.
7446
7447         * literal.cs (NullConstant): New abstract class with common
7448         functionality for all null specializations.
7449         (NullDefault): Represents default(X) when result can be
7450         reduced to null.
7451         (NullLiteral): Updated.
7452
7453         * report.cs: Add new warning.
7454
7455 2006-09-21  Martin Baulig  <martin@ximian.com>
7456
7457         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7458
7459 2006-09-21  Martin Baulig  <martin@ximian.com>
7460
7461         * generic.cs (GenericConstraints): New dummy class.
7462         (Constraints): Likewise.
7463         (TypeParameter): Likewise.
7464         (TypeParameterName): Likewise.
7465         (GenericMethod): Likewise.
7466
7467         * typemanager.cs (TypeManager.GetGenericArguments): New method.
7468
7469         * decl.cs: Merged with the gmcs version.
7470
7471 2006-09-21  Raja R Harinath  <rharinath@novell.com>
7472
7473         * generic.cs (TypeParameter): Implement IMemberContainer.
7474         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
7475
7476         * rootcontext.cs: Unify with gmcs version.
7477
7478         * report.cs: Unify with gmcs version.
7479         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7480         from gmcs/generics.cs.
7481         * generics.cs (TypeParameter): New dummy class.
7482
7483         * support.cs: Unify with gmcs version.
7484
7485 2006-09-20  Raja R Harinath  <rharinath@novell.com>
7486
7487         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7488         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7489
7490         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7491         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7492         * mcs.exe.sources: Add generic.cs.
7493
7494         * codegen.cs: Unify with gmcs version.
7495
7496         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7497         (EmitContext): Add GenericDeclContainer implementation.
7498         * decl.cs (MemberCore, DeclSpace): Likewise.
7499         * namespace.cs: Remove #ifdef GMCS_SOURCE.
7500
7501         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7502         MCS TypeManager has a corresponding dummy method.
7503
7504 2006-09-19  Martin Baulig  <martin@ximian.com>
7505
7506         * expression.cs: Completely merged with the gmcs version.
7507
7508 2006-09-19  Martin Baulig  <martin@ximian.com>
7509
7510         * expression.cs (Invocation): Merged with the gmcs version.
7511         (ArrayAccess.GetStoreOpcode): Likewise.
7512
7513 2006-09-19  Martin Baulig  <martin@ximian.com>
7514
7515         * typemanager.cs
7516         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7517         (TypeManager.IsGenericMethodDefinition): Likewise.
7518
7519 2006-09-19  Martin Baulig  <martin@ximian.com>
7520
7521         * typemanager.cs
7522         (TypeManager.IsEqual): Moved the gmcs implementation here.
7523         (TypeManager.DropGenericTypeArguments): Likewise.
7524         (TypeManager.DropGenericMethodArguments): Likewise.
7525         (TypeManager.GetTypeArguments): Moved here from gmcs.
7526         (TypeManager.HasGenericArguments): Likewise.
7527
7528 2006-09-19  Martin Baulig  <martin@ximian.com>
7529
7530         * expression.cs (Binary): Merged with the gmcs version.
7531
7532 2006-09-19  Martin Baulig  <martin@ximian.com>
7533
7534         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7535
7536 2006-09-19  Martin Baulig  <martin@ximian.com>
7537
7538         * typemanager.cs: Merged with the gmcs version.
7539
7540 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7541
7542         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7543         * driver.cs: Likewise.
7544
7545 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7546
7547         A fix for #79401
7548         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7549         only if parent type is class.
7550         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7551         update.
7552
7553 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7554
7555         * cs-parser.jay,
7556         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7557         keywords are used.
7558         * typemanager.cs(CSharpName): Converts NullType to null.
7559
7560 2006-09-15  Martin Baulig  <martin@ximian.com>
7561
7562         * typemanager.cs
7563         (TypeManager.GetMethodName): Added mcs implementation.
7564         (TypeManager.IsEqual): Likewise.
7565
7566         * ecore.cs
7567         (SimpleName.RemoveGenericArity): Added dummy implementation.
7568
7569         * pending.cs: Merged with the gmcs version.     
7570
7571 2006-09-15  Martin Baulig  <martin@ximian.com>
7572
7573         * statement.cs: Merge with the gmcs version.
7574
7575 2006-09-15  Martin Baulig  <martin@ximian.com>
7576
7577         * statement.cs (Switch): Merge with the gmcs implementation
7578         (without nullables), which is newer.
7579
7580 2006-09-15  Martin Baulig  <martin@ximian.com>
7581
7582         * statement.cs (Block.Variables): Make this public.
7583         (ToplevelBlock.Parameters): Make this a property.
7584         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7585
7586 2006-09-15  Martin Baulig  <martin@ximian.com>
7587
7588         * namespace.cs: Merge with the gmcs version.
7589
7590 2006-09-15  Martin Baulig  <martin@ximian.com>
7591
7592         * decl.cs (MemberName): Minor code cleanups.
7593
7594 2006-09-15  Martin Baulig  <martin@ximian.com>
7595
7596         * parameter.cs: Merge with the gmcs version.
7597
7598 2006-09-15  Martin Baulig  <martin@ximian.com>
7599
7600         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7601         and an error in mcs.
7602
7603 2006-09-15  Martin Baulig  <martin@ximian.com>
7604
7605         * flowanalysis.cs: Merged from GMCS; added the generics code into
7606         a `GMCS_SOURCE' conditional so we can share this file.
7607
7608 2006-09-08  Martin Baulig  <martin@ximian.com>
7609
7610         * typemanager.cs (TypeManager.interlocked_type): New public field.
7611         (TypeManager.int_interlocked_compare-exchange): New public field.
7612         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7613         enumerator types here and call InitGenericCoreTypes().
7614         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7615         after calling InitEnumUnderlyingTypes().
7616
7617         * rootcontext.cs
7618         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7619         `classes_second_stage'. 
7620
7621 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7622
7623         * assign.cs, ecore.cs, expression.cs: Share error message text.
7624         * class.cs (FieldMember.Define): Check for varible of static type.
7625         * driver.cs (LoadAssembly): Uses error output for errors.
7626         * statement.cs: Updated.
7627
7628 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7629
7630         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7631         type instance.
7632
7633 2006-09-07  Martin Baulig  <martin@ximian.com>
7634
7635         * driver.cs
7636         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7637
7638 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7639
7640         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7641         
7642 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7643
7644         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7645         #52019 and #79064, the use of the \uXXXX sequence in source code
7646         to represent unicode characters.
7647
7648 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7649
7650         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7651         support.
7652         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7653
7654 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7655
7656         * assign.cs: Catch attempts to assign to a method groups in += and
7657         report as 1656
7658
7659 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7660
7661         A fix for #79056
7662         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7663
7664 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7665
7666         * class.cs (Method.Define): Issue a warning when generic method looks like
7667         an entry point.
7668         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7669         as well.
7670
7671 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7672  
7673         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7674         looking for ctor.
7675         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7676         search all base interfaces as a member can be ambiguous.
7677         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7678         Constructor member type filter. 
7679         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7680         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7681         reporting for returned memberinfos.
7682         * report.cs: Updated.
7683         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7684         version to work on all runtimes.
7685         (TypeManager.RealMemberLookup): Removed members filtering.
7686
7687 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7688
7689         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7690         (PropertyExpr.EmitAssign): Likewise.
7691         * expression.cs (Indirection.EmitAssign): Likewise.
7692         (LocalVariableReference.EmitAssign): Likewise.
7693         (ParameterReference.EmitAssign): Likewise.
7694         (Invocation.EmitArguments): Likewise.
7695         (ArrayAccess.EmitAssign): Likewise.
7696         (IndexerAccess.EmitAssign): Likewise.
7697         (This.EmitAssign): Likewise.
7698         (ConditionalLogicalOperator.Emit): Likewise.
7699
7700         Fix #79026
7701         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7702         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7703         leave it in after returning it.
7704         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7705
7706 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7707
7708         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7709         message.
7710
7711 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7712
7713         Fix cs0146-3.cs and cs0146-4.cs.
7714         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7715         enclosing types don't depend on the current type.
7716
7717 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7718
7719         Fix #77963
7720         * class.cs (TypeContainer.DoDefineMembers): Use
7721         FindBaseMemberWithSameName on Parent, since we're interested in
7722         whether we hide inherited members or not.
7723         (FindBaseMemberWithSameName): Make slightly more robust.
7724
7725         Fix the non-generic testcase from #77396
7726         * decl.cs (DeclSpace.DeclContainer): Remove override.
7727
7728         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7729         declspaces for doppelgangers too.
7730         (UsingEntry): Implement IResolveContext.
7731         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7732         'this' as the resolve context.
7733         (LocalAliasEntry): Likewise.
7734
7735         Implement parts of #77403
7736         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7737         toplevel declaration space.  Each namespace declaration introduces
7738         a "partial" root declaretion space.
7739         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7740         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7741         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7742         from 'current_namespace.SlaveDeclSpace'.
7743         (namespace_declaration): Likewise.
7744         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7745         check.  It can't happen now.
7746         * decl.cs (DeclSpace.LookupType): Likewise.
7747         * driver.cs (MainDriver): Sanity check.
7748
7749 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7750
7751         * decl.cs (DeclSpace.FindNestedType): Remove.
7752         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7753         LookupTypeContainer to get the container of the nested type.
7754         * class.cs (TypeContainer.FindNestedType): Make non-override.
7755
7756 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7757
7758         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7759         * class.cs (TypeContainer.PartialContainer): ... here.
7760         (TypeContainer.AddBasesForPart): New helper.
7761         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7762         instead.
7763         * cs-parser.jay (current_class): Convert to DeclSpace.
7764         (struct_declaration, interface_declaration, class_declaration):
7765         Use AddBasesForPart instead of .Bases directly.
7766         * const.cs, iterators.cs: Update to changes.
7767
7768 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7769
7770         * class.cs (TypeContainer.AddMemberType): Rename from
7771         AddToTypeContainer.
7772         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7773         (AddTypeContainer): New.  Combine AddClassOrStruct and
7774         AddInterface.
7775         (AddPartial): Update.  Add 'is_partial' argument.
7776         * roottypes.cs: Update to changes.
7777         * cs-parser.jay (push_current_class): New helper for handling
7778         current_container and current_class.
7779         (struct_declaration, interface_declaration, class_declaration):
7780         Use it.
7781
7782 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7783
7784         * roottypes.cs: Rename from tree.cs.
7785
7786         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7787         * tree.cs (Tree, ITreeDump): Remove types.
7788         * rootcontext.cs (tree, Tree): Remove fields.
7789         (root, ToplevelTypes): New.
7790         * *.cs: Update to rename.
7791
7792         * tree.cs (Tree.RecordDecl): Remove.
7793         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7794         namespace here.
7795         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7796
7797 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7798
7799         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7800         DoFlowAnalysis and OmitStructFlowAnalysis here.
7801         (ec.With): Rename from WithUnsafe and generalize.
7802         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7803         (ec.WithFlowAnalyis): New.
7804         * ecore.cs, expression.cs, statement.cs: Update.
7805
7806 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7807
7808         * statement.cs (Block.ResolveMeta): Simplify slightly.
7809
7810         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7811         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7812         check_state to flags.
7813         (CheckState, ConstantCheckState): Update.
7814         (InUnsafe): New read-only property.
7815         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7816         arbitrary flags.
7817         (WithUnsafe): New helper similar to WithCheckState.
7818         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7819         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7820
7821 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7822
7823         Make comparisons use the same IL irrespective of whether they're
7824         in a 'checked' or 'unchecked' context: one of the issues in #78899
7825         * codegen.cs (EmitContext.CheckState): Make read-only property.
7826         (EmitContext.ConstantCheckState): Likewise.
7827         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7828         helper that implement a save/restore stack for CheckState
7829         values.  This is the only way to change check-state.
7830         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7831         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7832         (CheckedExpr.EmitBranchable): New forwarding method.
7833         (UnCheckedExpr): Likewise.
7834         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7835         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7836         (Checked.Resolve, checked.DoEmit): Likewise.
7837
7838 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7839
7840         * anonymous.cs: Cache the resolved anonymous delegate, and return
7841         this so that the ResolveTopBlock is only triggered once, not
7842         twice.
7843
7844         Currently we trigger ResolvetopBlock twice due to a first pass of
7845         argument check compatibility, and a second pass that does the
7846         actual resolution.   
7847         
7848 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7849
7850         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7851         modifiers.
7852         * rootcontext.cs (Reset): Add helper_classes.
7853
7854 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7855
7856         A fix for #78860
7857         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7858         correctly.
7859
7860 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7861
7862         * statement.cs (Lock): Handle expressions of type
7863         TypeManager.null_type specially.  Fixes #78770
7864
7865 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7866
7867         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7868         to an event.
7869
7870 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7871
7872         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7873         for accessors as well.
7874         * ecore.cs (EventExpr): Add AccessorTable.
7875
7876 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7877
7878         A fix for #78738
7879         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7880         for CS0122 where appropriate.
7881         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7882         level attributes.
7883         (Filter): Assembly can be null in the case of top level attributes.
7884
7885 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7886
7887         A fix for #78690
7888
7889         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7890         is done at global level.
7891
7892 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7893
7894         A fix for #77002, Implemented TypeForwarder support.
7895
7896         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7897         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7898         * typemanager.cs (): Add type_forwarder_attr_type.
7899
7900 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7901
7902         * report.cs: Add CS0469 warning.
7903
7904 2006-06-21  Martin Baulig  <martin@ximian.com>
7905
7906         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7907         the `try'-block, so we also report CS0016 etc. there.
7908
7909 2006-06-21  Martin Baulig  <martin@ximian.com>
7910
7911         * delegate.cs
7912         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7913
7914 2006-06-21  Martin Baulig  <martin@ximian.com>
7915
7916         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7917         also report CS1686 for parameters.
7918
7919 2006-06-21  Martin Baulig  <martin@ximian.com>
7920
7921         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7922         instead of an error if the value is not implicitly convertible to
7923         the switch types; fixes #77964.
7924
7925 2006-06-21  Raja R Harinath  <rharinath@novell.com>
7926
7927         Fix #78673
7928         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7929         FieldBuilder is null.
7930
7931         Fix #78662
7932         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7933         'left' and 'right' before error-checking.
7934
7935 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
7936
7937         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7938         Fixed bug #78601.
7939         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7940         (FieldExpr.DoResolve): likewise.
7941         (PropertyExpr.InstanceResolve): likewise.
7942         (EventExpr.InstanceResolve): likewise. 
7943
7944 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7947         attribute applicable tests for attribute argument.
7948
7949 2006-06-02  Raja R Harinath  <rharinath@novell.com>
7950
7951         Fix #78079
7952         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7953         (Binary.OverloadResolve_PredefinedIntegral): New.
7954         (Binary.OverloadResolve_PredefinedFloating): New.
7955         (Binary.OverloadResolve_PredefinedString): New.
7956         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7957         Follow the standard more closely, and treat numeric promotions in
7958         terms of overload resolution.
7959         (Binary.CheckShiftArguments): Simplify.
7960
7961 2006-06-01  Raja R Harinath  <rharinath@novell.com>
7962
7963         * flowanalysis.cs (MyBitVector): Simplify representation.
7964         (MyBitVector.Clone): Avoid allocating BitArray.
7965         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7966         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7967         (*): Update.  Change all references to MyBitVector.And and
7968         MyBitVector.Or to &= and |=.
7969
7970 2006-05-29  Raja R Harinath  <rharinath@novell.com>
7971
7972         Fix cs0231-[34].cs.
7973         * cs-parser.jay (formal_parameter_list): Extend the pattern below
7974         to param arguments too.
7975
7976 2006-05-26  Miguel de Icaza  <miguel@novell.com>
7977
7978         * cs-parser.jay: Catch another parsing form for arglist being
7979         followed by other arguments.  Fixes #78313.
7980
7981 2006-05-24  Raja R Harinath  <rharinath@novell.com>
7982
7983         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7984         checking of out parameters to ...
7985         (FlowBranchingToplevel.Merge): ... here.
7986         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7987         set, propagate the origin upward, and only complain if there was
7988         no other error.
7989         (FlowBranchingException.AddContinueOrigin): Likewise.
7990         (FlowBranchingException.AddReturnOrigin): Likewise.
7991         (FlowBranchingException.AddGotoOrigin): Likewise.       
7992
7993 2006-05-23  Raja R Harinath  <rharinath@novell.com>
7994
7995         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7996         unreachable, skip it.
7997         (FlowBranchingException.Merge): Always propagate jumps, even if
7998         the finally block renders subsequent code unreachable.
7999
8000 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8001
8002         Fix #77601
8003         * statement.cs (Goto.Resolve): Move responsibility for resolving
8004         'goto' to FlowBranching.AddGotoOrigin.
8005         (Goto.SetResolvedTarget): New.  Callback to set the
8006         LabeledStatement that's the target of the goto.
8007         (Goto.DoEmit): Use Leave instead of Br when crossing an
8008         unwind-protect boundary.
8009         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8010         LookupLabel and adjust to new semantics.
8011         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8012         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8013         Goto.SetResolvedTarget to update target.
8014         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8015         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8016         AddBreakOrigin & co.  Delay propagation until ...
8017         (FlowBranchingException.Merge): ... this.
8018
8019         * statement.cs (Block.Resolve): Always depend on flow-branching to
8020         determine unreachability.  Kill workaround that originally emitted
8021         only one statement after an "unreachable" label (see infloop in
8022         test-515.cs).
8023
8024         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8025         This is still "wrong", but anything better would probably need a
8026         multi-pass algorithm.
8027         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8028         usage vector.  Force current usage vector to be reachable, to
8029         optimistically signify backward jumps.
8030         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8031         detected.
8032         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8033         detected, return the original salted-away usage vector instead,
8034         updated with appropriate changes.  Print unreachable warning if
8035         necessary.
8036         * statement.cs (Block.Resolve): Don't print unreachable warning on
8037         a labeled statement.
8038
8039 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8040
8041         * driver.cs: Pass filename without path to AssemblyBuilder's 
8042         AddResourceFile. Fixes bug #78407.
8043
8044 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8045
8046         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8047         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8048         (FlowBranching.MergeChild): Overwrite
8049         reachability information from Labeled branchings too.
8050
8051 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8052
8053         * statement.cs (Goto.Resolve): Merge jump origins here ...
8054         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8055
8056         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8057         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8058         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8059         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8060         here, ...
8061         * statement.cs (Goto.Resolve): ... not here.
8062         (Goto.Emit): Remove CS1632 check.
8063
8064 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8065
8066         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8067         error message.
8068
8069 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8070
8071         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8072         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8073         (FlowBranchingException.Label): Likewise.
8074
8075         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8076         given value.
8077         (MyBitVector.Or): Use it to avoid losing information (Count).
8078         (FlowBranching.MergeOrigins): Likewise.
8079
8080         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8081         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8082         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8083         (UsageVector.ToString): Simplify.
8084         (UsageVector.MergeSiblings): Move here from ...
8085         (FlowBranching.Merge): ... here.
8086         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8087         not a MyBitVector.
8088
8089 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8090
8091         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8092         null bitvector is treated as all-true.
8093
8094         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8095         (MyBitVector): Rationalize invariants.  'vector != null' implies
8096         that we have our own copy of the bitvector.  Otherwise,
8097         'InheritsFrom == null' implies all inherited bits are true.
8098
8099 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8100
8101         * statement.cs (LocalInfo): Add IsConstant.
8102         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8103         local variable for constants.
8104
8105 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8106
8107         * flowanalysis.cs (MyBitVector.Empty): New.
8108         (MyBitVector): Don't allow InheritedFrom to be null.
8109         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8110         (UsageVector, FlowBranching): Update to changes.
8111
8112         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8113         recursion.  The 'Parent == null' condition isn't sufficient for
8114         anonymous methods.
8115         (FlowBranching.AddBreakOrigin): Likewise.
8116         (FlowBranching.AddContinueOrigin): Likewise.
8117         (FlowBranching.AddReturnOrigin): Likewise.
8118         (FlowBranching.StealFinallyClauses): Likewise.
8119         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8120         (FlowBranching.CheckOutParameters): Likewise.
8121         (FlowBranchingToplevel): Terminate all the above recursions here.
8122         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8123         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8124
8125         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8126         toplevel block.
8127         (FlowBranchingToplevel): New.  Empty for now.
8128         (FlowBranching.MergeTopBlock): Update.
8129         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8130         branching for the anonymous delegate.
8131         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8132
8133         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8134         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8135         information at the start of the merge.  Reorganize.
8136
8137 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8138
8139         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8140
8141 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8142
8143         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8144         to newly introduced ctor.
8145
8146         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8147         message to one place.
8148         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8149         global namespace.
8150
8151 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8152
8153         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8154
8155         * ecore.cs (Expression.ResolveAsConstant): Updated.
8156
8157         * statement.cs (ResolveMeta): Updated.
8158
8159 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8160
8161         * cs-parser.jay: __arglist cannot be used in initializer.
8162
8163 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8164
8165         A fix for #77879
8166         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8167         private types.
8168
8169 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8170
8171         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8172         (LabeledStatement): Add 'name' parameter.
8173         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8174         (Block.AddLabel): Update to changes.
8175         * cs-parser.jay (labeled_statement): Likewise.
8176
8177         * flowanalysis.cs (BranchingType.Labeled): New.
8178         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8179         (FlowBranchingLabeled): New.  Does nothing for now, but will
8180         eventually handle 'goto' flows.
8181         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8182         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8183         that's terminated ...
8184         (Block.Resolve): ... here.
8185
8186         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8187         (UsageVector.MergeFinallyOrigins): Likewise.
8188         (FlowBranching.InTryOrCatch): Likewise.
8189         (FlowBranching.AddFinallyVector): Likewise.
8190         (FlowBranchingException): Update to changes.
8191
8192         Fix #78290
8193         * statement.cs (Return.Resolve): Move error checking to ...
8194         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8195         (FlowBranchingException): Handle return origins like break and
8196         continue origins.
8197         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8198
8199 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8200
8201         A fix for #76122
8202         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8203         filter.
8204
8205 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8206
8207         A fix for #77543
8208         * class.cs (MethodData.Define): Do public accessor check only when method
8209         implements an interface.
8210
8211 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8212
8213         Remove special handling of 'break'
8214         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8215         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8216         (UsageVector.Break): Remove.
8217         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8218         reachability.
8219         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8220
8221         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8222         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8223
8224 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8225
8226         A fix for #75726
8227         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8228         be the interface member.
8229
8230 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8231
8232         A fix for #60069
8233         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8234         for emitting small (int) values.
8235
8236 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8237
8238         Fix #59427
8239         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8240         control-flow passes through the 'finally' after merging-in all the
8241         control-flows from 'try' and the 'catch' clauses.
8242
8243         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8244         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
8245         always true at the only non-recursive entry point.
8246         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8247         FlowBranchingBreakable.
8248         (FlowBranchingLoop): Remove.
8249         * statement.cs (Return.DoResolve): Update to changes.
8250
8251         Fix #76471, #76665
8252         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8253         (FlowBranching.CreateBranching): Handle it: create a
8254         FlowBranchingContinuable.
8255         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8256         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8257         except that it handles the 'continue' command.
8258         (FlowBranching.UsageVector.MergeOrigins): Rename from
8259         MergeBreakOrigins.
8260         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8261         except that it overrides AddContinueOrigin.
8262         (FlowBranchingException): Override AddContinueOrigin, similar to
8263         AddBreakOrigin.
8264         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8265         Create a new branching around the embedded statement.
8266         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
8267         control flow after the embedded statement.
8268         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8269
8270         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8271         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8272         FlowBranchingBreakable.
8273         (FlowBranchingSwitch): Remove.
8274
8275         Fix test-503.cs
8276         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8277         error reporting to ...
8278         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8279         Rename from 'AddBreakVector'.  Add new location argument.  Return
8280         a bool indicating whether the 'break' crosses an unwind-protect.
8281         (FlowBranchingException.AddBreakOrigin): Add.
8282         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8283         flowbranching after updating with the effects of the 'finally'
8284         clause.
8285         (FlowBranchingBreakable): New common base class for
8286         FlowBranchingLoop and FlowBranchingSwitch.
8287
8288         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8289         embedded statement.
8290         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8291
8292 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8293
8294         * statement.cs (Do.Resolve): If the loop is infinite, set the
8295         barrier.
8296         (While.Resolve, For.Resolve): Set a barrier after the embedded
8297         statement.  There's no direct control flow that goes from the end
8298         of the embedded statement to the end of the loop.
8299         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8300         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8301         above ensure that the reachability is correctly computed.
8302
8303         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8304         (UsageVector.MergeBreakOrigins): If the current path is
8305         unreachable, treat it as if all parameters/locals are initialized.
8306         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8307         infinite loops before merging-in break origins.
8308
8309         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8310         (Reachability.Reachable): Split part into ...
8311         (Reachability.Unreachable): ... this.  Simplify.
8312         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8313
8314         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8315         (Reachability.SetThrowsSometimes): Likewise.
8316         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8317         TriState.Always, use corresponding property.
8318         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8319         (Block.Resolve): Likewise.  Remove some redundant checks.
8320
8321 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8322
8323         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8324         (Reachability.Meet): Don't bother checking AlwaysThrows --
8325         barrier is always set.
8326         (FlowBranchingBlock.Merge): Likewise.
8327
8328 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8329
8330         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8331         checks for unreachable.
8332
8333 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8334
8335         A fix for #77980
8336         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8337
8338         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8339         whether field is really assigned.
8340
8341 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8342
8343         * flowanalysis.cs (Reachability): Make 4-argument constructor
8344         private.
8345         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8346         (Reachability.Always): Rename from the highly misleading
8347         'Reachability.Never'.
8348         (FlowBranching.Merge): Update to changes.  Mark an impossible
8349         situation with a 'throw'.
8350         (*): Update to changes.
8351
8352 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8353
8354         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8355         Remove 'Undefined'.
8356         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8357         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8358         (*): Update to changes.
8359         * statement.cs: Update to changes.
8360
8361 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8362
8363         A fix for #78049
8364         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8365
8366 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8367
8368         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8369         dummy UsageVector.
8370
8371         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8372         argument to two arguments: an usage-vector and a bool.  Move call
8373         to FlowBranching.Merge () ...
8374         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8375
8376         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8377         handling of loop and switch reachability to ...
8378         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8379
8380 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8381
8382         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8383         handling to FlowBranchingLoop.InLoop.
8384         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8385
8386 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
8387
8388         A fix for #78115
8389         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8390         anonymous method is allowed from AnonymousContainer here.
8391
8392         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8393
8394 2006-04-24  Raja R Harinath  <rharinath@novell.com>
8395
8396         Fix #78156
8397         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8398
8399 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
8400
8401         A fix for #49011.
8402         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8403         (DoubleConstant.Reduce): Ditto.
8404
8405 2006-04-23  Raja R Harinath  <rharinath@novell.com>
8406
8407         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8408         Remove 'lvalue_right_side' argument.  Move parts to ...
8409         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8410         (LocalVariable.DoResolveLValue): ... these.
8411
8412 2006-04-21  Raja R Harinath  <rharinath@novell.com>
8413
8414         Fix cs1655.cs
8415         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8416         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8417         (LocalVariableReference.DoResolveBase): Use it to implement new
8418         CS1655 check.
8419         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8420         (Argument.Resolve): Simplify.  Move CS1510 check ...
8421         * ecore.cs (Expression.ResolveLValue): ... here.
8422         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8423         (PropertyExpr.DoResolveLValue): Likewise.
8424         (FieldExpr.Report_AssignToReadonly): Likewise.
8425         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
8426         LValueMemberAccess or LValueMemberOutAccess on instance depending
8427         on it.
8428         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8429         DoResolve as appropriate.
8430
8431 2006-04-20  Raja R Harinath  <rharinath@novell.com>
8432
8433         Fix #75800
8434         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8435         implicit conversions on 'out' and 'ref' arguments.
8436
8437         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8438         improve clarity.  Remove dead code.
8439
8440         Fix #66031
8441         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8442         (Catch.Resolve): Resolve VarBlock if it exists.
8443
8444 2006-04-19  Miguel de Icaza  <miguel@novell.com>
8445
8446         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8447         twice, this was some residual code, the enumerator was emitted
8448         properly in the two branche of if later.
8449
8450 2006-04-19  Raja R Harinath  <rharinath@novell.com>
8451
8452         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
8453         cast is never an lvalue.
8454         (Cast.DoResolve, Cast.ResolveRest): Combine.
8455         (Argument.Emit): Simplify slightly.  Move 'Expr is
8456         IMemoryLocation' check ...
8457         (Argument.Resolve): ... here.
8458         (Argument.Error_LValueRequired): Remove.  Inline into only user.
8459
8460         Simplifications.  Fix cs0191-2.cs
8461         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8462         CS1649 and CS1651 to ...
8463         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
8464         the actual selection of the error code and message to a lookup
8465         table.  Add a dummy return value to simplify callsites.
8466         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8467         readonly fields of other instances of the same type.  Move CS0197
8468         warning from ...
8469         * expression.cs (Argument.Resolve): ... here.  Simplify code.
8470         Ensure that ec.InRefOutArgumentResolving is only set during LValue
8471         resolution of an out or ref argument.  The code simplification
8472         above uses this invariant.
8473
8474 2006-04-18  Raja R Harinath  <rharinath@novell.com>
8475
8476         Possibly fix #77752.  Fix cs1690-[4-7].cs.
8477         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8478         CheckMarshallByRefAccess.  Drop parameter.
8479         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
8480         warning.
8481         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8482         InstanceExpression.
8483         * report.cs (AllWarnings): Add CS1690.
8484         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8485         for ref access too.
8486         (LocalVariableReference.DoResolveBase): Update.
8487
8488 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8489
8490         * class.cs (MethodOrOperator): Moved common parts from method class.
8491         detect obsolete attributes.
8492         (Method.Define): Simplified as it reuses code from base.
8493         (Constructor.ValidAttributeTargets): Fixed issue found during
8494         refactoring.
8495         (Destructor.ValidAttributeTargets): Fixed issue found during
8496         refactoring.
8497         (Operator): Finished refactoring set off by #78020. Operator class is now
8498         ordinary method class.
8499
8500         * anonymous.cs: Updated.
8501
8502         * decl.cs (DeclSpace): Add IsGeneric
8503
8504 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8505
8506         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8507
8508 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8509
8510         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8511         detect obsolete attributes.
8512         (Method.CreateEmitContext): Moved to MethodOrOperator.
8513
8514 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8515
8516         A fix for #78048.
8517         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8518         customized exception to make crash detection easier.
8519         (MethodOrOperator): Started to work on new base class for methods and
8520         operators.
8521         (Method): Derives from MethodOrOperator.
8522         (Constructor.Emit): Emits its own attributes.
8523         (AbstractPropertyEventMethod.Emit): Ditto.
8524         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8525         patch.
8526         (Operator.Emit): It's temporary more tricky than should be.
8527         
8528         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8529
8530         * report.cs (InternalErrorException): Add ctor with inner exception.
8531
8532 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8533
8534         A fix for #76744.
8535         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8536         only not visible.
8537
8538 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8539
8540         A fix for #77916.
8541         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8542         array.
8543
8544 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8545
8546         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8547         attribute is present and Guid not.
8548         (Interface.ApplyAttributeBuilder): Ditto.
8549
8550         * attribute.cs: Add error message.
8551
8552 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8553
8554         A fix for #78020.
8555
8556         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8557         sources (it's composite) so hold them in extra array as they are used in
8558         Emit phase only. It worked in the previous versions by mistake.
8559         (Attribute.Emit): Emit attribute for more owners when exist.
8560
8561         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8562         it has now different behaviour.
8563
8564 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8565
8566         * constant.cs (Constant.IsDefaultInitializer): New method.
8567
8568         * class.cs: Updated.
8569
8570         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8571         re-initialize default values. It saves KBs almost for every assembly.
8572         Thanks Zoltan for the idea.
8573         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8574         (ArrayCreation.DoResolve): Resolve only once.
8575         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8576         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8577
8578 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8579
8580         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8581         From #77961.
8582
8583 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8584
8585         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8586         in an embedded statement too.
8587
8588 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8589
8590         Fix #77958
8591         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8592
8593 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8594
8595         A fix for #77966.
8596
8597         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8598         was not specified.
8599
8600         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8601
8602 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8603
8604         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8605         phase.
8606
8607         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8608         LocalTemporary change.
8609
8610         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8611         TypeContainer.
8612         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8613         initializers optimization.
8614         (ClassOrStruct.TypeAttr): Moved from modifiers.
8615         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8616         (FieldBase.ResolveInitializer): Resolves initializer.
8617         (FieldBase.HasDefaultInitializer): New property.
8618
8619         * cs-parser.jay: Removed message.
8620
8621         * expression.cs (CompilerGeneratedThis): New specialization.
8622
8623         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8624
8625 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8626
8627         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8628
8629 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8630
8631         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8632         be now EnumConstants only.
8633
8634 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8635
8636         * attribute.cs, driver.cs: Reset more caches.
8637
8638 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8639
8640         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8641
8642 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8643
8644         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8645         for easier reuse. Updated all overrides.
8646         (IntegralConstant): New base class for all integral constants.
8647         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8648         of the constant range, report custom error.
8649         (UIntConstant.Reduce): Fixed uint conversion.
8650
8651         * ecore.cs, literal.cs: Reduce updates.
8652
8653 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8654
8655         A fix for #75813.
8656
8657         * class.cs (Constructor.Define): Removed extra if for default ctors.
8658         A patch from Atsushi Enomoto.
8659
8660 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8661
8662         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8663         GetAttributableValue.
8664
8665         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8666         when required.
8667
8668         * convert.cs (ImplicitConversionRequired): Error message moved to
8669         DoubleLiteral.
8670
8671         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8672         automatic implicit conversion of an output value.
8673         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8674
8675         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8676         conversion.
8677         (TypeOf.GetAttributableValue): Add extra handling for object type.
8678
8679         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8680         special error message.
8681
8682 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8683
8684         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8685         InternalCall.
8686         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8687         compatible with MS runtime.
8688
8689 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8690
8691         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8692         attribute arguments here.
8693
8694         * class.cs (Indexer.Define): The check was moved to attribute class.
8695
8696 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8697
8698         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8699         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8700         easier.
8701
8702 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8703
8704         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8705         mcs to keep code differences small.
8706         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8707         * typemanager.cs (parameter_default_value_attribute_type): New.
8708         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8709         CS1908 check.
8710
8711 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8712
8713         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8714
8715 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8716
8717         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8718
8719         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8720         the blocks too.
8721
8722 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8723
8724         * doc-bootstrap.cs : fix build.
8725
8726 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8727
8728         * expression.cs (StringConcat.Append): Issue a warning when empty string
8729         is going to append.
8730
8731 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8732
8733         * assign.cs (CompoundAssign.ResolveSource): Removed.
8734
8735         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8736         clean up.
8737
8738         * class.cs (TypeContainer.FindMethods): Removed.
8739         (TypeContainer.CheckMemberUsage): Made static.
8740
8741         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8742
8743         * constant.cs (CheckRange): Removed unused type argument.
8744         (CheckUnsigned): Removed unused type argument.
8745
8746         * cs-parser.jay: Updated after MemberAccess clean up.
8747         Uses Length for empty string test.
8748
8749         * cs-tokenizer.cs: Uses Length for empty string test.
8750         (IsCastToken): Made static.
8751         (is_hex): Made static.
8752         (real_type_suffix): Made static.
8753
8754         * decl.cs (SetupCache): Made static.
8755         (OnGenerateDocComment): Removed unused ds argument.
8756
8757         * delegate.cs (VerifyDelegate): Removed unused argument.
8758
8759         * doc.cs: Uses Length for empty string test.
8760
8761         * driver.cs: Uses Length for empty string test.
8762
8763         * enum.cs (IsValidEnumType): Made static
8764
8765         * expression.cs (EnumLiftUp): Removed unused argument.
8766         (ResolveMethodGroup): Ditto.
8767         (BetterConversion): Ditto.
8768         (GetVarargsTypes): Ditto.
8769         (UpdateIndices): Ditto.
8770         (ValidateInitializers): Ditto.
8771         (MemberAccess.ctor): Ditto.
8772         (GetIndexersForType): Ditto.
8773
8774         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8775
8776         * iterators.cs: Updated after MemberAccess clean up.
8777
8778         * location.cs: Uses Length for empty string test.
8779
8780         * namespace.cs: Uses Length for empty string test.
8781
8782          * report.cs (CheckWarningCode): Made static.
8783
8784         * statement.cs (LabeledStatement): Removed unused argument.
8785
8786         * typemanager.cs (FilterNone): Removed.
8787
8788 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8789
8790         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8791         obsolete.
8792
8793         * class.cs: Updated.
8794
8795 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8796
8797         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8798
8799 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8800
8801         A fix for #77822.
8802
8803         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8804         reporting, it's more tricky than I thought.
8805
8806 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8807
8808         A fix for #77816.
8809
8810         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8811         host container.
8812         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8813         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8814         Add more error reporting; Fixed issue with params.
8815
8816         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8817
8818         * cs-parser.jay: AnonymousMethod requires host container.
8819
8820         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8821
8822 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8823
8824         * class.cs: Change 'TypeContainer ds' constructor argument to
8825         'DeclSpace parent'.  Some classes were missed below due to
8826         different naming convention.
8827
8828         * class.cs (MemberCore.Parent): Delete.  This makes the
8829         ParentContainer changes below enforceable by the compiler.
8830
8831         Treat pointers to enclosing declaration space as 'DeclSpace', not
8832         'TypeContainer'.
8833         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8834         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8835
8836         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8837         of TypeContainer.
8838         (Block.AddThisVariable): Likewise.
8839         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8840         (AbstractPropertyEventMethod.Emit): Likewise.
8841         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8842         (GetMethod.Define, SetMethod.Define): Likewise.
8843         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8844         (DelegateMethod.EmitMethod): Likewise.
8845
8846         Fix regression test-partial-13.cs.
8847         Rationalize use of PartialContainer.  Ensure that the partial
8848         class semantics can be tied to type-correctness, i.e., any
8849         violation will cause a compile error.
8850         * class.cs, const.cs: Access all fields that belong to class
8851         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8852         Resolve()-like functions still use 'Parent'.
8853
8854         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8855         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8856         (PropertyMethod.CheckModifiers): Remove unused argument.
8857         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8858         DeclSpace.
8859
8860 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8861
8862         Make semantics of PartialContainer simpler.
8863         * decl.cs (DeclSpace.IsPartial): Remove.
8864         * class.cs (TypeContainer.IsPartial): Likewise.
8865         (TypeContainer..ctor): Set PartialContainer to point to self.
8866         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8867         (TypeContainer.FindNestedType): Likewise.
8868         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8869
8870 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8871
8872         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8873
8874 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8875
8876         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8877         classes.
8878
8879 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8880
8881         * class.cs (Operator.Define): An error for base conversion was not
8882         reported correctly.
8883
8884 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8885
8886         * iterator.cs : yield break is allowed in try statement which has
8887           catch clauses. Fixed bug #77767.
8888
8889 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8890
8891         A fix for #77593, #77574.
8892
8893         * class.cs (MethodCore.CheckBase): Another if for operator.
8894
8895 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8896
8897         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8898         were not resolved
8899
8900         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8901         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8902         conversion test.
8903         
8904         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8905         not needed.
8906
8907         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8908         Updated after another emitcontext usage was clean up. It should help us to
8909         synchronize with gmcs easier.
8910
8911 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
8912
8913         A fix for #77353.
8914
8915         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8916         (Event.Define): ditto
8917         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8918
8919         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8920         Removed redundant code and set NewSlot for Invoke method too.
8921
8922         * parameter.cs (Parameters.ctor): Add custom, type ctor.
8923         (Parameters.MergeGenerated): New method. Use this method when you merge
8924         compiler generated argument with user arguments.
8925
8926 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
8927
8928         * attribute.cs (ResolveAsTypeTerminal): Removed.
8929
8930         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8931         specialization for predefined types; 30% speed up.
8932         Finally placed obsolete check to right place.
8933         (Expression.ResolveType): Removed.
8934
8935         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8936         Updated after ResolveType was removed.
8937
8938         * expression.cs (Cast.ctor): Check void cast.
8939         (Binary.ResolveAsTypeTerminal): Is never type.
8940         (Conditional.ResolveAsTypeTerminal): Is never type.
8941
8942         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8943
8944 2006-03-01  Raja R Harinath  <rharinath@novell.com>
8945
8946         Fix #77679.
8947         * expression.cs (ParameterReference.DoResolveBase): Change return
8948         type to bool.
8949         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8950         Update.
8951
8952         Fix #77628.
8953         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8954
8955         Fix #77642.
8956         * typemanager.cs (GetFullNameSignature): Don't nullref on
8957         protected accessors.
8958
8959 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
8960
8961         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8962         these two separated members to simplify the code.
8963         (Attribute.Resolve): Refactored to use new fields and methods.
8964         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8965         implemented obsolete attribute checking.
8966         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8967         implemented obsolete checking again. It look line never ending quest ;-)
8968         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8969
8970         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8971
8972         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8973
8974         *class.cs (Property.Define): Add RegisterProperty call.
8975
8976         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8977         argument groups (only 2).
8978
8979         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8980         encoding expression to arguments.
8981         (Expression.ExprClassToResolveFlags): Just turned to property.
8982
8983         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8984         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8985         optimized as well as implemented support for zero-length attributes.
8986
8987         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8988         Add caching of PropertyInfo's.
8989
8990 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8991
8992         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8993         error multiple times.
8994
8995 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8996
8997         New partial class implementation.
8998         A fix for #77027, #77029, #77403
8999
9000         * attribute.cs (Attributable): Made attributes protected.
9001
9002         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9003         the replacements of ClassPart and PartialContainer.
9004         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9005         (TypeContainer.AddInterface): Ditto.
9006         (TypeContainer.AddPartial): The main method for partial classes. It checks
9007         for errors and merges ModFlags and attributes. At the end class is added to
9008         partial_parts list.
9009         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9010         required here.
9011         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9012         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9013         from the rest of partial classes.
9014         (TypeContainer.GetClassBases): Simplified.
9015         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9016         DefineType.
9017         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9018         (TypeContainer.HasExplicitLayout): Uses Flags now.
9019         (PartialContainer): Removed.
9020         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9021         (StaticClass): Was merged with Class.
9022         (Class.GetClassBases): class and static class bases are verified here.
9023         (Class.TypeAttr): Added static attributes when class is static.
9024         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9025         (MemberBase): In some cases we need to call parent container for partial
9026         class. It should be eliminated but it's not easy now.
9027
9028         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9029
9030         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9031         partial classed to accumulate class comments.
9032         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9033
9034         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9035
9036         * driver.cs (MainDriver): Tree.GetDecl was removed.
9037
9038         * modifiers.cs (Modifiers): Add partial modifier.
9039
9040         * tree.cs (Tree.decl): Removed.
9041         (RootTypes): Started to use this class more often for root types
9042         specializations.
9043
9044 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9045
9046         A fix for #77615
9047
9048         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9049         external interface does not have an attribute.
9050
9051 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9052
9053         Another prerequisites for new partial classs implementation.
9054         
9055         * attribute.cs (Attribute.Equal): Implemented.
9056         (Attribute.Emit): Changed as attributes can be applied more than twice.
9057         (Attributes.Emit): Check for duplicate attributes here.
9058
9059         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9060         as a parameter, clean-up.
9061
9062 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9063
9064         A fix for #77485
9065
9066         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9067         contains obsolete attribute check which can in some cases look for base
9068         type of current class which is not initialized yet.
9069         (TypeContainer.BaseType): Replacement of ptype.
9070
9071         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9072
9073 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9074
9075         First of prerequisites for new partial classs implemention.
9076         
9077         * attribute.cs (Attributable): Extended by ResolveContext;
9078         Attributes finally have correct context for resolving in all cases.
9079         (AttachTo): Attribute owner is assigned here.
9080
9081         * codegen.cs (IResolveContext): Introduce new interface to hold
9082         all information needed in resolving phase.
9083         (EmitContext): Implements IResolveContext; more clean-up needed here.
9084         
9085         * decl.cs (MemberCore): Implemented IResolveContext.
9086
9087         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9088         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9089         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9090         Refactored to use new IResolveContext instead of EmitContext; cleanup
9091
9092 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9093
9094         * codegen.cs (EmitScopeInitFromBlock): check here the
9095         capture_context, there is no need to make two calls to the
9096         EmitContext. 
9097
9098         * anonymous.cs: Add some debugging messages that might help me
9099         track other instances of this problem in the future (the
9100         regression of test 467).
9101
9102         * cs-parser.jay: track the variable block, as we need to initalize
9103         any captured variables declared in this block for the "catch"
9104         portion of the "Try" statement.
9105
9106         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9107         scope initialization for captured variables. 
9108
9109         Also, move the emit for the variables after the block location has
9110         been marked.
9111
9112 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9113
9114         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9115
9116 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9117
9118         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9119         commit yesterday, the initialization for the roots is necessary.
9120         What is not necessary is the scope activation.
9121
9122 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9123
9124         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9125         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9126         CS0206 checks.
9127         (Argument.Resolve): Remove CS0206 checks.
9128
9129 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9130
9131         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9132         scopes for all the roots, the scopes will now be emitted when the
9133         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9134
9135         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9136         code.  This reduces a lot of existing cruft.
9137         
9138         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9139         that the ScopeInfo is generated as we enter the scope, not at the
9140         time of use, which is what we used to do before.
9141
9142         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9143         every time a Block is about to be emitted if we have a
9144         CaptureContext. 
9145
9146 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9147
9148         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9149         (Reset): Update.
9150         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9151
9152         * typemanager.cs (cons_param_array_attribute): Make private.
9153         (Reset): Set it to null.
9154         (InitCoreHelpers): Don't initialize it.
9155         (ConsParamArrayAttribute): New.  Initialize it as needed.
9156         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9157
9158 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9159
9160         * expression.cs: There might be errors reported during the
9161         selection of applicable methods.  If there are errors, do not
9162         continue execution as it will lead the compiler to crash.
9163
9164 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9165
9166         * expression.cs: Member access is not allowed on anonymous
9167         methods.  Fixes #77402.
9168
9169 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9170
9171         Fix #77401
9172         * cs-parser.jay (VariableDeclaration): Don't set
9173         current_array_type to null.
9174         (field_declaration, event_declaration, declaration_statement):
9175         Set it to null here.
9176
9177 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9178
9179         * typemanager.cs (GenericParameterPosition): New.
9180         * doc.cs: Use it.
9181
9182 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9183
9184         * doc.cs : To process "include" elements, first we should create
9185           another list than XmlNodeList, because it could result in node
9186           removal, which could result in that the XmlNodeList gives up
9187           yielding next node.
9188
9189           (Also made code identical to gmcs again.)
9190
9191 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9192
9193         * ecore.cs: Introduce an error report that we were not catching
9194         before, if not silent, we must report the error.  Gonzalo ran into
9195         it.
9196
9197 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9198
9199         A fix for bug: #76957
9200         
9201         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9202         ComputeMethodHost before creating the method, this is a new
9203         requirement. 
9204
9205         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9206         that this method references (RegisterScope).  The actual scope
9207         where the method is hosted is computed with the ComputeMethodHost
9208         before we create the method.
9209
9210         Moved the Deepest routine here.
9211
9212         (AnonymousContainer.ComputeMethodHost): New routine used to
9213         compute the proper ScopeInfo that will host the anonymous method.
9214
9215         (ScopeInfo): Deal with multiple roots.  The problem was that we
9216         did not have a unique root where all ScopeInfos could be hanged
9217         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9218         of roots.  
9219
9220         Remove AdjustMethodScope which is now computed at the end.  Remove
9221         LinkScope which did a partial link, instead link all ScopeInfos
9222         before code generation from the new "LinkScopes" routine. 
9223
9224         Simplify all the Add* routines as they no longer need to maintain
9225         the tree, they just need to record that they are using variables
9226         from a ScopeInfo.
9227
9228         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9229         routines to produce the forest of ScopeInfo trees.
9230
9231         * class.cs (TypeContainer.AppendMethod): This is just like
9232         AddMethod, but ensures that an interface implementation method
9233         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9234         methods, but at the end.
9235
9236         We use this functionality to ensure that the generated MoveNext
9237         method in the iterator class is resolved/emitted before the
9238         enumerator methods created.   
9239
9240         This is required because the MoveNext method computes the right
9241         ScopeInfo for the method.  And the other methods will eventually
9242         need to resolve and fetch information computed from the anonymous
9243         method. 
9244
9245 2006-01-21  Raja R Harinath  <harinath@gmail.com>
9246             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
9247
9248         Fix rest of #76995.
9249         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9250         the 'aliases' hash.
9251         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9252         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9253
9254 2006-01-18  Raja R Harinath  <rharinath@novell.com>
9255
9256         Fix #76656, cs0231-2.cs.
9257         * cs-parser.jay (formal_parameter_list): Make error case catch
9258         more issues.
9259         (parenthesized_expression_0): Add CS1026 check.
9260         (invocation_expression): Remove unused { $$ = lexer.Location }.
9261
9262 2006-01-17  Raja R Harinath  <rharinath@novell.com>
9263
9264         Fix #76824.
9265         * cs-parser.jay (statement_expression): Don't list out the
9266         individual statement-expressions.  Convert syntax error into
9267         CS0201 check.
9268
9269 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9270
9271         Fix #76874.
9272         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9273         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9274         CheckIntermediateModification.
9275         (FieldExpr.DoResolve): Add new two-argument version that
9276         allows us to resolve the InstanceExpression as an lvalue.
9277         The one-argument variant is now just a wrapper.
9278         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9279         Resolve the lhs as an lvalue if the it has a value type.
9280         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9281         from Assign.DoResolve.
9282         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9283         resolved as an lvalue.
9284         (PropertyExpr.DoResolve): Update.
9285         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9286         has a value type.  Move CS1612 check here from
9287         CheckIntermediateModification.
9288         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9289         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9290         'right_side' of a ResolveLValue on an 'out' argument.
9291         (EmptyExpression.LValueMemberAccess): New.  Used as the
9292         'right_side' of a propagated ResolveLValue on a value type.
9293         (LocalVariableReference.DoResolveBase): Recognize
9294         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9295         Add CS1654 check.
9296         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9297         EmptyExpression.Null.
9298
9299 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9300
9301         * typemanager.cs : added IsGenericParameter(). In mcs it always
9302           return false.
9303         * doc.cs : for generic parameters, use GenericParameterPosition,
9304           not FullName.
9305
9306 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9307
9308         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9309
9310 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9311
9312         This fixes the problem where we used ldfld instead of ldflda to
9313         load the "THIS" pointer on captured parameters, when THIS is a
9314         value type.  See bug #77205.
9315         
9316         * iterators.cs (CapturedThisReference.Emit): Pass false to
9317         EmitThis (we do not need the address).
9318
9319         * codegen.cs (EmitThis): it needs to know whether we need the
9320         address of `this' or not.  This is used by value types.  
9321
9322         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9323         every other call passes false.
9324
9325 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9326
9327         Fix #77221.
9328         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9329         GetOverride.
9330         * expression.cs (Invocation.OverloadResolve): Update.
9331         (Invocation.DoResolve): Avoid double resolution of invocation.
9332
9333 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9334
9335         Fix #77180.
9336         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9337         unary negation of floating point types as 0-expr; negation cannot
9338         overflow in floating point types.
9339
9340         Fix #77204.
9341         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9342         on operands of 'void' type.
9343
9344         Fix #77200.
9345         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9346         and ExclusiveOr for boolean constants too.
9347
9348 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9349
9350         Fix #75636.
9351         * expression.cs (Invocation.OverloadResolve): Replace reflected
9352         override methods with their base virtual methods, rather than
9353         skipping over them.
9354         * typemanager.cs (TypeManager.GetOverride): New.
9355
9356 2006-01-05  Jb Evain  <jbevain@gmail.com>
9357
9358         * class.cs (Property.Define, Indexer.Define): do not tag the
9359         properties as SpecialName | RTSpecialName.
9360
9361 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9362
9363         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9364         doing a low-level comparission of parameter types.  It was lacking
9365         a check for __argslist. 
9366
9367 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9368
9369         * expression.cs (ParameterReference.DoResolveBase): Allow
9370         reference parameters if they are local to this block. 
9371
9372         This allows the ref and out parameters of a delegate to be used in
9373         an anonymous method, for example:
9374
9375         delegate void set (out int x);
9376
9377         set s = delegate (out int x){
9378                 x = 0;
9379         };
9380
9381         This is used by functionality introduced late in the C# language.
9382         
9383         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9384         method that take ref and out parameters. 
9385
9386         Fixes #77119 which was a late change in the spec.
9387
9388 2005-12-23  Miguel de Icaza  <miguel@novell.com>
9389
9390         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9391         parent if its the same scope.  Fixes #77060.
9392
9393 2005-12-21  Miguel de Icaza  <miguel@novell.com>
9394
9395         * driver.cs: Report the case of no source files and no -out:
9396         argument provided.
9397
9398 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9399
9400         Fix #77035.
9401         * expression.cs (ComposedCast.GetSignatureForError): Define.
9402
9403 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9404
9405         Fix #76995
9406
9407         * namespace.cs (NamespaceEntry): Add extern_aliases as a
9408         ListDictionary, to contain the ExternAliasEntry entries (in
9409         addition to the NamespaceEntry.aliases hashtable). This field is
9410         shared between the original entry and its doppelganger (bodyless 
9411         copy of it).
9412         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9413         extern_aliases field.
9414         (NamespaceEntry.Lookup): Move the IsImplicit check after the
9415         lookup in extern_aliases.
9416
9417 2005-12-16  Raja R Harinath  <rharinath@novell.com>
9418
9419         Fix #77006.
9420         * class.cs (TypeContainer.Mark_HasEquals): New.
9421         (TypeContainer.Mark_HasGetHashCode): New.
9422         (ClassPart): Override them.
9423         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9424
9425         Fix #77008.
9426         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9427         'parent' argument to the base constructor.
9428
9429         Remove all mention of TypeContainer from decl.cs.
9430         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9431         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9432         (DeclSpace.DeclSpace): Likewise.
9433         (DeclSpace.DefineMembers): Remove unused argument.
9434         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
9435         debugging check -- we don't care if the debug code throws an
9436         InvalidCastException instead of an InternalErrorException.
9437         * class.cs (TypeContainer.DefineMembers): Update to changes.
9438         (TypeContainer.DoDefineMembers): Likewise.
9439         (TypeContainer.GetMethods): Likewise.
9440         (PropertyMember.Define): Likewise.
9441         (MemberBase.Parent): New property that forwards to
9442         MemberCore.Parent, but ensures that we get a TypeContainer.
9443         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9444         (RootContext.PopulateTypes): Likewise.  Remove special case code
9445         for !RootContext.StdLib: DefineMembers is idempotent.
9446
9447 2005-12-14  Miguel de Icaza  <miguel@novell.com>
9448
9449         * convert.cs (ExplicitConversionCore): Check the return value from
9450         ExplicitConversionCore which can return null on failure.  Fixes #76914
9451
9452 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
9453
9454         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9455
9456 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
9457
9458         * doc.cs : The search for referenced namespace was insufficient to
9459           get global one as it used to do. Fixed bug #76965.
9460
9461 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
9462
9463         * doc.cs : check name in cref in the last phase that whether it is
9464           namespace or not.
9465
9466 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9467
9468         * cs-tokenizer.cs : reverted the latest change: it somehow broke
9469           Mono.C5.
9470
9471 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9472
9473         * doc.cs : so it turned out that we cannot skip override check for 
9474           interface members. Fixed bug #76954.
9475
9476 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9477
9478         * cs-tokenizer.cs : fixed bug #75984:
9479           - #warning and #error should not be handled when the source line
9480             is disabled.
9481           - #line is not checked strictly when the source line is disabled.
9482           - #define and #undef is on the other hand checked strictly at any
9483             state.
9484
9485 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
9486
9487         * cs-tokenizer.cs : missing Location (actually, filename) in one of
9488           CS1027 report.
9489
9490 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9491
9492         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9493
9494         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9495         event initializers.
9496         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9497         (FieldBase.Initializer): Initializer is now optional.
9498         (EventField.Define): Only event field can have initializer.
9499
9500         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9501
9502         * const.cs (Const): Reuse initializer.
9503
9504         * cs-parser.jay: Updated after FieldBase changes.
9505         Added current_array_type to simplify array initializers.
9506
9507         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9508
9509         * expression.cs, iterators.cs: Updated.
9510
9511         * namespace.cs (NamespaceEntry): Made UsingFound private.
9512
9513 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9514
9515         * parameterCollection.cs: Obsolete, removed.
9516         * parser.cs: Obsolete, removed.
9517
9518 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9519
9520         Fix #76849.
9521         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9522
9523         * enum.cs (Enum.Define): Set obsolete context here.
9524
9525 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9526
9527         * doc.cs :
9528           - FindDocumentedMember() now expects 1) paramList as null
9529             when "we don't have to check the number of parameters" and
9530             2) Type.EmptyTypes when "there is no arguments".
9531           - Introduced FoundMember struct to hold the exact type which was
9532             used to find the documented member (the above change broke
9533             test-xml-044; it might be better just to use DeclaringType than
9534             what MS does, like this change does, but it depends on usage.)
9535
9536 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9537
9538         * doc.cs : documented member might be from DeclaringType for nested
9539           types. Fixed bug #76782.
9540
9541 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9542
9543         * anonymous.cs: Have the param code handle leaving copies on the
9544         stack etc. Allows anonymous params to take part in the assignment
9545         code (++, +=, etc). Fixes bug #76550
9546
9547         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9548         it down to the anon code.
9549
9550         * iterators.cs: Use dummy var here
9551
9552         * codegen.cs: Handle new vars
9553
9554 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9555
9556         Fix #76849.
9557         * class.cs (MethodData.Define): Set proper Obsolete context.
9558
9559         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9560         obsolete context.
9561         (FieldExpr.DoResolve): Ditto.
9562
9563 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9564
9565         Fix #76849.
9566         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9567         parent is not obsolete.
9568
9569 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9570
9571         * doc.cs : (FindDocumentedMember) find parameterless members first
9572           and get CS0419 in the early stage. Fixed first case of bug #76727.
9573
9574 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9575
9576         Fix #76859.
9577         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9578         no error was reported.
9579
9580         *expression.cs (Binary.DoResolve): left can be null.
9581
9582 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9583
9584         Fix #76783.
9585         * class.cs (MethodData.Emit): Parameters should be labeled first.
9586
9587 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9588
9589         Fix #76761.
9590         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9591
9592 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9593
9594         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9595
9596         * class.cs (MethodCore): Parameter clean up.
9597         (IMethodData): Added ParameterInfo.
9598         (MethodData): Parameter clean up.
9599         (Indexer.Define): Parameter clean up.
9600
9601         * anonymous.cs,
9602         * codegen.cs,
9603         * cs-parser.jay,
9604         * decl.cs,
9605         * doc.cs,
9606         * ecore.cs,
9607         * flowanalysis.cs,
9608         * iterators.cs,
9609         * pending.cs,
9610         * statement.cs,
9611         * typemanager.cs: Parameter clean up.
9612
9613         * delegate.cs (Define): Get rid of duplicated code.
9614
9615         * expression.cs (ParameterReference): Removed useless parameters
9616         and simplified.
9617         (Invocation): Ditto.
9618
9619         * parameter.cs (ParamsParameter): New class, params specialization.
9620         (ArglistParameter): Attemp to separate arglist.
9621         (Parameter): Refactored to be reusable and faster.
9622         (Parameter.Modifier): Made understandable.
9623         (Parameters): Changed to be used as a class for `this' assembly
9624         parameters. Refactored to use new specialized classes.
9625
9626         * support.cs (ParameterData): Added Types property.
9627         (InternalParameters): Deleted.
9628
9629 2005-08-20  Martin Baulig  <martin@ximian.com>
9630
9631         Merging this patch from GMCS to fix #75867.
9632
9633         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9634         scope if we don't already have it.
9635
9636 2005-11-17  Martin Baulig  <martin@ximian.com>
9637
9638         * anonymous.cs
9639         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9640         inherit the scope from our parent.  Fixes #76653.
9641
9642 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9643
9644         * doc.cs : the previous patch does not actually fix the bug.
9645           PropertyInfo override check is now implemented and really fixed it.
9646         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9647
9648 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9649
9650         * doc.cs : apply "override filter" also to properties.
9651           Fixed bug #76730.
9652
9653 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9654
9655         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9656           no need to check overrides. For classes, omit those results from 
9657           interfaces since they must exist in the class. Fixed bug #76726.
9658
9659 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9660
9661         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9662           with different parameters. Fixed the second problem in #76685.
9663
9664 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9665
9666         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9667           get expected 'protected' access in CheckValidFamilyAccess()).
9668           Fixed bug #76692.
9669
9670 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9671
9672         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9673           Fixed bug #76705.  CS1569 was incorrectly commented out.
9674
9675 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9676
9677         * doc.cs : use Invocation.IsOverride() to do real override check.
9678         * expression.cs : made Invocation.IsOverride() internal.
9679
9680 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9681
9682         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9683           TypeBuilder.FindMembers() and filter overriden base members out.
9684           Fixed bug #76990.
9685
9686 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9687
9688         * doc.cs : ref/out parameters are represented as '@' (instead of
9689           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9690
9691 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9692
9693         * doc.cs : when there was no '.' in cref to methods in doc comment,
9694           then parameters were missing in the output. Fixed bug #76691.
9695
9696 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9697
9698         * driver.cs : don't output docs when there is an error.
9699           Fixed bug #76693.
9700
9701 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9702
9703         * doc.cs :
9704           Now it should detect indexers. Fixed primary concern in bug #76685.
9705           Fixed CS0419 message to not show the identical member signature in
9706           the message.
9707
9708 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9709
9710         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9711           instead of Type.FindMembers() since it does not handle events.
9712           Fixed bug #71604.
9713
9714 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9715
9716         * codegen.cs: Fixed typo (speficied -> specified).
9717
9718 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9719
9720         Fix #76369.
9721         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9722
9723 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9724
9725         * attribute.cs: Changed error message.
9726
9727         * cs-tokenizer.cs: One more check.
9728
9729 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9730
9731         * statement.cs (Block.Resolve): Ignore empty statement.
9732
9733 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9734
9735         * report.cs: Made error/warning methods more strict to avoid
9736         their misuse.
9737
9738         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9739         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9740         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9741         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9742
9743 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9744
9745         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9746         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9747
9748         * class.cs (TypeContainer.IsComImport): New property.
9749         (Constructor.Define): Create proper ctor for ComImport types.
9750
9751         * expression.cs (New.CheckComImport): Fixed.
9752
9753 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9754
9755         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9756         that a parameter has been captured does not mean that we do not
9757         have to do the rest of the processing.  This fixes the second part
9758         of #76592.  If there was another anonymous method capturing
9759         values in the past, the Scope would never be set for the second
9760         method that captured the same parameter.
9761
9762         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9763         properly manipulate the stack.   Second part of fix for #76592.
9764
9765         * expression.cs (New): Add support for invoking "new" on
9766         interfaces that have been flagged with the ComImport attribute and
9767         the CoClass.  Fixes #76637 
9768
9769         * statement.cs (Try.DoEmit): When a variable is captured, do not
9770         try to emit the vi.LocalBuilder variable as it has been captured.
9771         Create a temporary variable and store the results on the
9772         FieldBuilder.  Fixes #76642
9773
9774 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9775
9776         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9777
9778         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9779
9780         * expression.cs (Binary.DoResolve): Added && optimalization.
9781     
9782         * typemanager.cs (AddUserType): Removed useless argument.
9783
9784 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9785
9786         * statement.cs (Block.variables): Uses ListDictionary.
9787
9788 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9789
9790         Fix #75969.
9791         * class.cs (PartialContainer.EmitType): Customized to emit
9792         security attributes.
9793         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9794         for partial classes.
9795
9796 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9797
9798         Fix #76599.
9799         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9800         access has to be fixed.
9801         
9802         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9803
9804 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9805
9806         Fix #76590.
9807         * ecore.cs (NullCast.Reduce): Implemented.
9808
9809         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9810         constant type.
9811         
9812         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9813         properly.
9814         (Foreach.Resolve): Catch null properly.
9815
9816 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9817  
9818         * cs-tokenizer.cs: Warning text fix.
9819
9820         * driver.cs: AllWarningNumbers exposed on public interface.
9821
9822         * report.cs (): Reviewed warning numbers.
9823         (IsValidWarning): Use binary search.
9824
9825 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9826  
9827         * driver.cs: Implemeted resource visibility.
9828         (Resources): New class for code sharing between /res: and
9829         /linkres:
9830  
9831 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9832
9833         Fix #76568.
9834         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9835         folding.
9836         
9837         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9838         contants only.
9839         
9840         * ecore.cs (NullCast): Child is contant only.
9841         
9842         * literal.cs (NullLiteral.Reduce): null can be converted to any
9843         reference type.
9844
9845 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9846
9847         * driver.cs: Use Encoding.Default as default code page instead
9848           of ISO-28591.
9849
9850 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9851
9852         Fix #76085.
9853         * expression.cs (Invocation.Error_InvalidArguments): Handle
9854         __arglist parameters.
9855         (Invocation.VerifyArgumentsCompat): Likewise.
9856         * support.cs (ReflectionParameters.GetSignatureForError): Print
9857         __arglist parameters.
9858         (InternalParamters.GetSignatureForError): Likewise.
9859         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9860
9861 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9862
9863         * attribute.cs (GetPropertyValue): Made public.
9864
9865         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9866         Resolve.
9867         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9868         attribute.
9869         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9870         is not defined.
9871         
9872         * driver.cs: Reflect method name change.
9873         
9874         * statement.cs (Try.Resolve): Warn when try has both general
9875         exception handlers.
9876         
9877         * typemanager.cs: runtime_compatibility_attr_type new predefined
9878         type.
9879
9880 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9881
9882         Fix #76419.
9883         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9884         treat it as an empty parameter list.
9885
9886 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9887
9888         Fix #76271.     
9889         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9890         ResolveAsTypeStep silent.
9891         * statement.cs (Block.AddConstant): Mark block as used.
9892         (Block.ResolveMeta): Avoid piling on error messages
9893         if a constant initializer resolution fails.
9894
9895 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9896
9897         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9898         Remove.
9899         (NamespaceEntry.VerifyAllUsing): New.
9900         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9901         behaviour.  Delegates actual resolution of alias to ...
9902         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9903         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9904         Update.
9905         * driver.cs (Driver.MainDriver): Update.
9906         
9907         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9908         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9909         property.
9910         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9911         Remove.
9912         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9913         RootNamespace.DefineNamespacesForAll.
9914
9915 2005-10-24  Raja R Harinath  <harinath@gmail.com>
9916
9917         * typemanager.cs (assemblies, external_aliases, modules)
9918         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9919         (ComputeNamespaces, GetRootNamespace): Remove extra staging
9920         overhead.  Move resposibility ...
9921         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
9922         * driver.cs, attribute.cs, codegen.cs: Update to changes.
9923
9924 2005-10-23  Raja R Harinath  <harinath@gmail.com>
9925
9926         * namespace.cs (RootNamespace.all_namespaces): Renamed from
9927         cached_namespaces.  Improve usage.
9928         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9929         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9930         Move from GlobalRootNamespace and simplify.
9931         (RootNamespace.Global): Make instance variable.
9932         (RootNamespace.RootNamespace): Add "alias name" parameter.
9933         (GlobalRootNamespace): Simplify drastically.
9934         (Namespace.Lookup): Don't use GetNamespace.
9935         * typemanager.cs (GetRootNamespace): Rename from
9936         ComputeNamespaceForAlias.
9937         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9938
9939 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9940
9941         * anonymous.cs (AnonymousContainer): Don't crash when container
9942         doesn't exist.
9943
9944 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9945
9946         * expression.cs (Binary.DoResolve): Warn when comparing same
9947         values.
9948
9949 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9950
9951         Fix #76486.
9952         * expression.cs (Binary.DoResolve): It looks like there are no
9953         convetsion rules in enum context.
9954
9955 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9956
9957         Add support for extern alias qualifiers.
9958         * typemanager.cs: Move some LookupTypeReflection code
9959         to namespace.cs, to have cleaner code. Added some methods
9960         to help us keep track of the extern aliased references.
9961         * driver.cs: Add suport for extern alias assemblies on command
9962         line and check for their warnings/errors. Also keep track of the
9963         extern aliased assemblies.
9964         * namespace.cs: Move the global functionality of Namespace
9965         to GlobalRootNamespace/RootNamespace. Now the global namespace
9966         is GlobalRootNamespace.Globa. Also the code moved from 
9967         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
9968         Finally added LocalAliasEntry (AliasEntry before) and
9969         ExternAliasEntry, to handle alias statements.
9970         * cs-parser.jay: Add support in the grammar for extern alias
9971         statement.
9972         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
9973         Update callings to Namespace (now in GlobalRootNamespace).
9974
9975 2005-10-18  Raja R Harinath  <rharinath@novell.com>
9976
9977         Fix #76371.
9978         * class.cs (TypeContainer.DefineType): Move updating of
9979         topological sort earlier in the code.
9980         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9981
9982 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
9983
9984         Fix #76273.
9985         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9986         
9987         * constant.cs (Constant.TryReduce): Moved from Cast class.
9988         (Reduce): Made little bit more OO and fixed missing conversions.
9989         
9990         * ecore.cs (Reduce): Implemented.
9991         (Binary.EnumLiftUp): New method to upgrade values to enum values.
9992         
9993         * literal.cs (Reduce): Implemented.
9994         
9995         * class.cs: Reverted Miguel's wrong commit.
9996
9997 2005-10-14  Miguel de Icaza  <miguel@novell.com>
9998
9999         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10000
10001 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10002
10003         * cs-parser.jay, expression.cs : CS0214 was missing error location
10004           for constants. Fixed bug #76404.
10005
10006 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10007
10008         Fix #76370.
10009         * convert.cs (ExplicitConversionCore): Fixed object->enum
10010         conversion.
10011
10012 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10013
10014         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10015         InstanceExpression.
10016         (PropertyExpr.EmitCall): Likewise.
10017         * expression.cs (Invocation.EmitArguments): Handle case where
10018         arguments == null.
10019         (Invocation.EmitCall): Avoid allocating temporary variable if
10020         there are no arguments.
10021
10022 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10023
10024         Fix #76323.
10025         * convert.cs (ImplicitConversionStandard): Move conversion of
10026         void* to arbitrary pointer types ...
10027         (ExplicitConversionStandard): .. here.
10028         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10029         error to always print typenames.
10030
10031 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10032
10033         * convert.cs (GetConversionOperator): Rename from
10034         GetConversionOperators.  Move operator selection code from ...
10035         (UserDefinedConversion): ... here.
10036
10037 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10038
10039         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10040         conversion.
10041
10042 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10043
10044         * assign.cs (Assign.DoResolve): Error method changed.
10045
10046         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10047         
10048         * const.cs (ResolveValue): Reset in_transit immediately.
10049         
10050         * constant.cs: Error method changed.
10051         
10052         * convert.cs: Removed useless location parameter.
10053         (ExplicitNumericConversion): Don't do double enum check.
10054         (ExplicitConversionCore): Renamed from ExplicitConversion.
10055         (ExplicitUnsafe): Extracted from ExplicitConversion.
10056         (ExplicitConversion): Uses for error reporting.
10057         
10058         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10059         error messages.
10060         (ResolveBoolean): Uses common error method.
10061         (CastToDecimal): Get rid of ec.
10062         (CastFromDecimal): Optimized.
10063         (ConvCast): Get rid of ec.
10064         
10065         * enum.cs (ResolveValue): Reset in_transit immediately.
10066         (Emit): Return after first error.
10067         
10068         * expression.cs: Convert changes.
10069         
10070         * literal.cs: Error method changed.
10071         
10072         * statement.cs: Error method changed.
10073
10074 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10075
10076         * support.cs (SeekableStreamReader.Position): Don't error out when
10077         the requested position is just beyond the end of the current
10078         buffered data.
10079
10080 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10081
10082         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10083         try to keep in sync with the byte count of the underlying Stream.
10084         However, this limits us to a window size of 2048 characters: i.e.,
10085         the maximum lookahead of our lexer/parser can be 2048 characters.
10086
10087 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10088
10089         Fix #76255.
10090         * driver.cs: Fix compilation files with full root path.
10091
10092 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10093
10094         * report.cs (SymbolRelatedToPreviousError): Format the output so
10095         it does not use an open parenthesis that is never closed. 
10096
10097         * driver.cs: Follow coding guidelines
10098
10099 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10100
10101         Fix #72930.
10102         * const.cs (Const.ResolveValue): Check for assigning non-null
10103         value to reference type.
10104
10105 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10106
10107         * anonymous.cs: Implemented ExprClassName.
10108         
10109         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10110         delegate.
10111         
10112         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10113         check.
10114         
10115         * class.cs (StaticClass.DefineContainerMembers): Report protected
10116         members as error.
10117         
10118         * codegen.cs: if(ed) PRODUCTION.
10119         
10120         * convert.cs (Error_CannotImplicitConversion): Better error
10121         distinction.
10122         
10123         * cs-parser.jay: More error checks.
10124         
10125         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10126         
10127         * driver.cs (CSCParseOption): Enabled wrong option check.
10128         
10129         * ecore.cs (Expression.ExprClassName): Turned to property.
10130         (MemberExpr.CheckIntermediateModification): For checking boxed
10131         value types     modification.
10132         
10133         * statement.cs (Fixed.Resolve): Expression type must be
10134         convertible to fixed type.
10135         (CollectionForeach.GetEnumeratorFilter,TryType):
10136         Small refactoring for easier error checking.
10137
10138 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10139
10140         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10141         attributes.
10142         
10143         * class.cs (GeneratedBaseInitializer): New class for customization
10144         compiler generated initializers.
10145         (MemberBase.DoDefine): Check Obsolete attribute here.
10146         (FieldMember.DoDefine): Ditto.
10147         
10148         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10149         constants.
10150         
10151         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10152         (MemberCore.GetObsoleteAttribute): Removed argument.
10153         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10154         (MemberCore.CheckObsoleteType): New helper.
10155         
10156         * delegate.cs,
10157         * enum.cs,
10158         * statement.cs: Updates after MemberCore changes.
10159         
10160         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10161         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10162         
10163         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10164         obsolete attribute for compiler construct.
10165         (As.DoResolve): Cache result.
10166         
10167         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10168
10169 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10170
10171         Fix #76133.
10172         * expression.cs (This.VerifyFixed): In a value type T, the type of
10173         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10174         value type R, 'this' is treated as a value parameter.
10175
10176 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10177
10178         * statement.cs (Lock): Use the TemporaryVariable class instead of
10179         manually using local variables as those do not work when variables
10180         are captured.
10181
10182         * ecore.cs: Moved the TemporaryVariable class from being a nested
10183         class inside Foreach to be a public class that can be employed in
10184         other places. 
10185
10186 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10187
10188         * cs-parser.jay: interface_accessors replaced by
10189         accessor_declarations.
10190
10191         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10192         location.
10193         
10194         * statement.cs (GotoCase.Resolve): Convert null constant to
10195         null case.
10196         (SwitchLabel.ResolveAndReduce): Ditto.
10197         (SwitchLabel.NullStringCase): Custom null stamp.
10198         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10199         
10200         typemanager.cs (CSharpSignature): Don't skip first argument
10201         for full names.
10202
10203 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10204
10205         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10206
10207         * location.cs (InEmacs): in this mode, do not report column
10208         location as it confuses Emacs.
10209
10210 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10211
10212         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10213         expression.cs, iterators.cs, literal.cs: Store constants and
10214         literals location.
10215         
10216         * class.cs (MemberBase.ShortName): Pass location.
10217         
10218         * cs-parser.jay: Some location fixes.
10219         
10220         * ecore.cs (Expression.Location): Made virtual.
10221
10222 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10223
10224         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10225         if the underlying types are the same, otherwise we need to produce
10226         code that will do the proper cast.
10227
10228         This was exposed by Marek's constant rewrite which produced
10229         invalid code for the call site:
10230
10231         enum X : long { a }
10232         void Method (X v) {}
10233
10234         Method ((X) 5)
10235
10236         This fixes test-49.cs
10237
10238 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10239
10240         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10241           Type/Object should be allowed as well. Fixed bug #75968.
10242
10243 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10244
10245         * expression.cs : (Binary.DoResolve): when one is enum constant and
10246           another is constant 0, then return enum one *as enum type*.
10247           Fixed bug 74846.
10248
10249 2005-09-02  Raja R Harinath  <rharinath@novell.com>
10250
10251         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10252         internal.
10253
10254         Fix #75941.
10255         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10256         flow-branching for LocalVariableReferences in case we were invoked
10257         from a MemberAccess.
10258         * expression.cs (LocalVariableReference.VerifyAssigned): New.
10259         Carved out of ...
10260         (LocalVariableReference.DoResolveBase): ... this.
10261         (MemberAccess.Resolve): Do the check that was disabled during
10262         SimpleNameResolve.
10263
10264 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10265
10266         * class.cs :
10267           (PartialContainer.Create): check abstract/sealed/static strictly
10268           but abstract/sealed can exist only at one side. Fixed bug #75883.
10269
10270 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10271
10272         Fix #75945.
10273         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10274         specified, don't default to UnmanagedType.I4.
10275
10276 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10277
10278         * expression.cs : conditional operator should check possibly
10279           incorrect assign expression. Fixed bug #75946.
10280
10281 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10282
10283         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10284           Reverting the change. gmcs is much complex than mcs on this matter.
10285
10286 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10287
10288         * cs-tokenizer.cs : To read another token ahead of the actual 
10289           consumption, use new SavedToken and cache token instead of moving
10290           back the stream with SeekableStreamReader (it seemed problematic).
10291         * cs-parser.jay,
10292           driver.cs : Thus use StreamReader directly.
10293         * support.cs : Thus removed SeekableStreamReader.
10294
10295 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10296
10297         Fix #75934.
10298         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10299         (ScopeInfo.EmitScopeType): Use it to construct field names from
10300         names of captured locals.
10301
10302         Fix #75929.
10303         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10304         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10305         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10306         (ExplicitConversion): Remove enum cases already handled by
10307         implicit conversion.  Move implicit conversion check to the beginning.
10308         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10309         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10310         Don't treat System.Enum as a struct.
10311
10312 2005-08-30  Jb Evain  <jbevain@gmail.com>
10313
10314         * attribute.cs: handles as expression in parameters.
10315
10316 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10317
10318         Fix #75802.
10319         * class.cs (TypeContainer.VerifyClsName): Don't use a
10320         PartialContainer when verifying CLS compliance.
10321         (AbstractPropertyEventMethod): Set Parent here, ...
10322         (PropertyMethod): ... not here.
10323
10324 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10325
10326         * attribute.cs : escaped attribute name should not be allowed to be
10327           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10328
10329 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10330
10331         Fix #75927.
10332         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10333         when converting a long constant to unsigned long.
10334         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10335         detect where IsApplicable and VerifyArgumentsCompat disagree.
10336
10337 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10338         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10339
10340         Fix #75848.
10341         * class.cs (TypeContainer.CanElideInitializer): New helper.
10342         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10343         can safely emitting the initializer of a field.
10344
10345 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10346
10347         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10348           allowed inside a switch (without loop). Fixed bug #75433.
10349
10350 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10351
10352         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10353         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10354
10355 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10356
10357         * driver.cs : kinda reverting the default encoding changes (not exact 
10358           revert since I noticed that "codepage:reset" might not work fine).
10359
10360 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10361
10362         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10363           Location. Now getter and setter store location correctly.
10364           (errors/cs0111-12.cs now reports the expected location.)
10365
10366 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10367
10368         * driver.cs : Use default encoding on the environment.
10369           Removed (now that) extra parameter for SeekableStreamReader.
10370         * support.cs : (SeekableStreamReader) third .ctor() argument for
10371           StreamReader is not required (always true). preamble size could
10372           be acquired in simpler and safe way.
10373
10374 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10375
10376         * cs-parser.jay: report CS0642 at warning level 3
10377           and report CS0642 for an if else statement also
10378           fixes bug #74745. Patch by John Luke (and a bit
10379           modified by me).
10380           Removed extra CS0642 warning check for "while",
10381           "for" and "fixed".
10382         * statement.cs: In Block.Resolve(), CS0642 check
10383           is reimplemented to check a sequence of an empty
10384           statement and a block.
10385
10386           Both fix bug #66777.
10387
10388 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
10389
10390         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10391         detection until I fix it.
10392         
10393         * cs-tokenizer.cs: Changed error message.
10394         
10395         * cs-parser.jay: Fixed 2 error locations.
10396         
10397         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10398         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10399         properties.
10400         
10401         * enum.cs (GetSignatureForError): Fixed.
10402         
10403         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10404         method detection.
10405         
10406         * class.cs,
10407         * typemanager.cs (RegisterProperty): Removed.
10408         
10409         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10410
10411 2005-08-24  Raja R Harinath  <rharinath@novell.com>
10412
10413         Fix #75874.
10414         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10415         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10416
10417 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10418
10419         * expression.cs : tiny fix is required for not warning positive ulong.
10420           See test-441.cs.
10421
10422 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10423
10424         * expression.cs : add CS0652 check for constant and integral
10425           expression. Fixed bug #53974.
10426
10427 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10428
10429         * expression.cs : in DoNumericPromotions(), check if there is implicit
10430           conversion overload for string (to check CS0034). Fixed bug #52492.
10431
10432 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10433
10434         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10435
10436 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10437
10438         * ecore.cs : report location when it is *not* Null.
10439
10440 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10441
10442         * codegen.cs,
10443           ecore.cs,
10444           flowanalysis.cs,
10445           expression.cs:
10446           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10447           correctly. Fixed bug #75721.
10448
10449 2005-08-23  Raja R Harinath  <rharinath@novell.com>
10450
10451         * support.cs (SeekableStreamReader.Position): Avoid an expensive
10452         loop that performs 'min (pos, char_count)'.
10453
10454         Fix #75862.
10455         * expression.cs (Unary.ResolveOperator): Don't discard implicit
10456         converted value in Operator.OnesComplement.
10457
10458 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
10459
10460         * anonymous.cs: If the anon method is pulled into a helper class,
10461         it needs to be `internal' not `private'. Fixes runtime behavior on
10462         msft. bug #75704
10463
10464 2005-08-20  Martin Baulig  <martin@ximian.com>
10465
10466         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10467         scope if we don't already have it.
10468
10469         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10470         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10471         fixes #75867.
10472
10473 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
10474
10475         Fix #75803
10476         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10477         is a partial class.
10478
10479 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
10480
10481         The big constants rewrite
10482         Fix #75746, #75685 and more
10483         As a side effect saved 1MB for MWF ;-)
10484         
10485         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10486         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10487         enum based for corlib compilation.
10488         
10489         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10490         subtractions.
10491         
10492         * class.cs (FixedField.Define): Use ResolveAsConstant.
10493         
10494         * const.cs (IConstant): Interface constants and enums.
10495         (Const.ResolveValue): New method for constant resolvning.
10496         (ExternalConstant): Constants from imported assemblies.
10497         
10498         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10499         conversion; like enums.
10500         (Constant.ToType): Converts this constant to different type.
10501         (Constant.Increment): Adds 1.
10502         
10503         * convert.cs (ImplicitConversionRequired): Simplified.
10504         
10505         * cs-parser.jay: Create EnumMember directly.
10506         
10507         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10508         
10509         * doc.cs (GenerateEnumDocComment): Removed.
10510         
10511         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10512         (ConvertIntLiteral): Removed.
10513         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10514         
10515         * enum.cs (EnumMember): Implement IConstant.
10516         (Enum.IsValidEnumConstant): Removed.
10517         (Enum.GetNextDefaultValue): Removed.
10518         (Enum.FindMembers): Updated.
10519         (Enum.GenerateDocComment): Iterate enum members.
10520         
10521         * expression.cs (Cast.TryReduce): Handle enums correctly.
10522         (New.Constantify): Made public.
10523         (MemberAccess.DoResolve): Removed contant specific if(s).
10524         
10525         * literal.cs (NullLiteral): Implement new abstract methods.
10526         
10527         * statement.cs (GotoCase.Resolve): Use new constant methods.
10528         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10529         
10530         * typemanager.cs (LookupEnum): Removed.
10531         (IsEnumType): Fixed to work with corlib.
10532         (RegisterConstant): Removed.
10533         (LookupConstant): Removed.
10534         (GetConstant): Changed to work with IConstant.
10535
10536 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10537
10538         * location.cs : Fixed overflown (>255) column number.
10539
10540 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10541
10542         First cut of the qualified-alias-member feature.
10543         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10544         token.
10545         * cs-parser.jay (DOUBLE_COLON): New token.
10546         (namespace_or_type_name): Add rule for recognizing
10547         qualified-alias-members.
10548         (primary_expression): Likewise.
10549         (element_access): Allow QualifiedAliasMember as a possible
10550         type-bearing expression.
10551         (local_variable_type, local_variable_pointer_type): Likewise.
10552         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10553         aliases in the current and enclosing namespace declarations.
10554         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10555         * decl.cs (MemberName.is_double_colon): New.
10556         (MemberName.MemberName): Add new constructor for alias-member.
10557         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10558         * expression.cs (QualifiedAliasMember): New expression type.
10559
10560 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10561
10562         * location.cs : it borked when no argument was specified.
10563
10564 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10565
10566         * location.cs : tiny ToString() format fix.
10567
10568 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10569
10570         * statement.cs : oops, it was missing.
10571
10572 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10573
10574         A set of fixes for precise line/column location.
10575
10576         * location.cs :
10577           "token" field now holds a file/line "delta", a line number offset 
10578           from the segment, and a column number. See also:
10579           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10580           December/009508.html
10581           Removed static IsNull. Use instance IsNull property instead.
10582         * cs-tokenizer.cs :
10583           For some tokens it stores Location. For Identifier it stores
10584           LocatedToken which is a pair of string name and location.
10585           Column numbers are adjusted only at getChar().
10586         * report.cs :
10587           Use Location.ToString() for reporting (it now contains column).
10588         * cs-parser.jay :
10589           Largely modified to use LocatedToken instead of
10590           string (IDENTIFIER), and to acquire Location from some tokens.
10591         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10592           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10593           codegen.cs :
10594           Now MemberName holds Location. DeclSpace.ctor() receives Location
10595           as a parameter. Removed extra parameters to all derived classes.
10596           Replaced Location.IsNull() with instance property.
10597         * assign.cs, expression.cs :
10598           Added .ctor() overload that omits Location.
10599         * attribute.cs :
10600           Added "nameEscaped" flag that indicates the identifier was escaped
10601           in the source file. This fixes bug #57047.
10602
10603 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10604
10605         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10606         New method, looking for lo-case imported cls type.
10607
10608         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10609         here.
10610
10611         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10612
10613         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10614
10615         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10616         all_imported_types.
10617         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10618
10619         Optimized to save 3.5 MB for SWF compilation.
10620
10621 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10622
10623         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10624         (PartialContainer.Create): Moved logic AddToContainer.
10625         (PartialContainer.MarkForDuplicationCheck): Shares name.
10626         
10627         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10628         place.
10629         
10630         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10631         initialization.
10632         (Namespace.GetSignatureForError): New method.
10633         
10634         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10635         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10636
10637 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10638
10639         Fix #75669.
10640         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10641         member lookup rather than qualifier_type, since qualifier_type can
10642         be null.
10643
10644 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10645
10646         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10647         enum member.
10648
10649 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10650
10651         * statement.cs: Copy the local exception into the exception
10652         captured local.  Fixes 75674
10653
10654 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10655
10656         Fix #75658.
10657         * expression.cs (Invocation.OverloadResolve): Don't report error
10658         CS1501 if error CS1502 has been reported.
10659         (New.DoResolve): Delegate CS1501 reporting to
10660         Invocation.OverloadResolve.
10661
10662         Fix #75656.
10663         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10664         invariant-meaning-in-block property in an enclosing block if
10665         necessary.
10666
10667 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10668
10669         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10670         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10671         (Switch.CheckSwitch): Just save 50kb for SWF.
10672
10673 2005-07-27  Martin Baulig  <martin@ximian.com>
10674
10675         * anonymous.cs (CaptureContext.AddField): Added
10676         `AnonymousContainer am' argument; compute its toplevel scope if
10677         it's not already computed.  Fixes #75649.
10678
10679 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10680
10681         Fix #75628.
10682         * class.cs (Constructor.Emit): Reset block to null if the block
10683         resolve fails.
10684
10685 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10686
10687         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10688
10689 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10690
10691         * class.cs (MethodData.Define): Check whether accessor implementing
10692         interface is public.
10693
10694         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10695
10696 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10697
10698         Fix #57245
10699         * namespace.cs (LookupType): Moved same type check to...
10700         
10701         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10702         with the same name.
10703
10704 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10705
10706         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10707         already found a typebuilder.
10708         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10709         MemberNames, not strings.
10710
10711         * const.cs (Error_ExpressionMustBeConst): 
10712         Rename from Error_EpressionMustBeConst.
10713         * const.cs, class.cs, statement.cd: Update.
10714
10715 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10716
10717         Fix #65573
10718
10719         * const.cs (Const.LookupConstantValue): Report missing contant expression
10720         everytime.
10721         (Error_EpressionMustBeConstant): Only one error method.
10722
10723         * class.cs, statement.c: Updated.
10724
10725 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10726
10727         * statement.cs (Block.Flags): Add back HasVarargs.
10728         (Block.flags): Make protected.
10729         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10730
10731         * typemanager.cs (types, typecontainers, user_types): Remove.
10732         (UserTypes, TypeContainers): Likewise.
10733         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10734         (CleanUp, Reset): Update.
10735         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10736         (GetNestedType): Use Type.GetNestedType.
10737         (CoreLookupType): Take two arguments, the namespace and the
10738         basename of the type.  Update to use the Namespace.Lookup
10739         mechanism.
10740         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10741         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10742         string concatenation and substring matches.
10743         * class.cs, enum.cs, delegate.cs: Update to changes.
10744
10745 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10746
10747         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10748         Expression and made virtual.
10749
10750         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10751         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10752
10753         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10754
10755         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10756         error message.
10757
10758         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10759         change.
10760
10761 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10762
10763         Fix #57707
10764         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10765         AssemblyCultureAttribute is not used on executable.
10766
10767         * rootcontext.cs,
10768         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10769
10770 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10771
10772         Fix #60638.
10773         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10774         New.  Reports CS0252/CS0253.
10775         Mostly taken from preliminary patch by Duncak Mak.
10776         (Binary.DoResolveOperator): Store results of operator lookup.
10777         Use them to detect if we need to warn about unintended reference
10778         comparisons.
10779
10780 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10781
10782         Fix #72969.
10783         * namespace.cs (Namespace.Lookup): Add back location parameter.
10784         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10785         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10786
10787         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10788         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10789         (Namespace.LookupType): ... this.
10790         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10791         of namespaces.
10792         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10793         purported to handle pointers.
10794         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10795         CoreLookupType.
10796
10797 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10798
10799         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10800         type as namespace.
10801
10802 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10803
10804         * namespace.cs (Namespace.Lookup): Drop location parameter.
10805         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10806         (NamespaceEntry.Lookup): ... this.
10807         (NamespaceEntry.Error_AmbiguousTypeReference):
10808         Move here from DeclSpace.
10809         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10810         names ...
10811         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10812         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10813         Move to NamespaceEntry.
10814         * delegate.cs, expression.cs: Update to changes.
10815
10816 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10817
10818         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10819         CheckAttributeType and refactored.
10820         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10821         ResolveAsTypeTerminal error handling.
10822         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10823         handling.
10824         (GetSignatureForError): Print errors in same way.
10825
10826         * class.cs,
10827         * codegen.cs: Reflect attribute GetSignatureForError change.
10828
10829         * ecore.cs,
10830         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10831
10832         * namespace.cs (UsingEntry): Refactored to make fields private.
10833
10834         * assign.cs,
10835         statement.cs: Error_UnexpectedKind has extra parameter.
10836
10837 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10838
10839         * ecore.cs (IAlias): Remove.
10840         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10841         that implement the interface.
10842         * namespace.cs (Namespace): Likewise.
10843         (Namespace.declspaces): Renamed from 'defined_names'.
10844         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10845         DeclSpace instead of an IAlias.
10846         * tree.cs (Tree.AddDecl): Update.
10847
10848 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10849
10850         * statement.cs (Block.Flags); Remove HasVarargs.
10851         (Block.HasVarargs): Move to ToplevelBlock.
10852         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10853         (Block.Variables): Make protected.  Initialize variable hashtable
10854         if necessary.
10855         (Block.AddVariable): Update.
10856         (Block.Resolve): Update to changes.
10857         (ToplevelBlock.HasVarargs): New boolean.
10858         (ToplevelBlock.ThisVariable): Move here from Block.
10859         (ToplevelBlock.AddThisVariable): Likewise.
10860         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10861         * expression.cs (This.ResolveBase): Update to changes.
10862         (ArglistAccess.DoResolve): Likewise.
10863
10864 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10865
10866         Fix #75321
10867         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10868
10869         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10870         not used and not used & assigned.
10871         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10872
10873 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10874
10875         Fix #75053
10876         * expression.cs (Is.DoResolve): null is never provided type.
10877
10878 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10879
10880         Fix #52496
10881         * cs-parser.jay: Less strict event error rule to catch more errors.
10882
10883 2005-07-08  Martin Baulig  <martin@ximian.com>
10884
10885         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10886         gettter (allowed) or setter (not allowed).
10887
10888         * class.cs (Accessor): Implement IIteratorContainer.
10889         (Accessor.Yields): New public field.
10890         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10891         per-accessor basis.
10892
10893         * cs-parser.jay
10894         (get_accessor_declaration, set_accessor_declaration): Set the
10895         `yields' flag on the accessor, not the property.
10896         (property_declaration): Do the iterators check on a per-accessor
10897         basis and not for the whole property.
10898
10899 2005-07-08  Martin Baulig  <martin@ximian.com>
10900
10901         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10902         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10903
10904 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10905
10906         Fix #74975
10907         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10908         (ExtractSecurityPermissionSet): Cope with self referencing security
10909         attributes properly.
10910
10911         * driver.cs (SetOutputFile): Made public property OutputFile.
10912
10913 2005-07-07  Raja R Harinath  <rharinath@novell.com>
10914
10915         Fix #75486.
10916         * class.cs (TypeContainer.first_nonstatic_field): Rename from
10917         has_nonstatic_fields.  Make into a FieldBase pointer.
10918         (TypeContainer.AddField): Add CS0282 check.
10919         (TypeContainer.EmitType): Update.
10920
10921 2005-07-06  Miguel de Icaza  <miguel@novell.com>
10922
10923         * cs-tokenizer.cs (consume_identifier): Do not create strings to
10924         compare if they start with __.
10925
10926 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10927
10928         * statement.cs (Switch.SwitchGoverningType): Only look at
10929         UserCasts that don't need implicit standard conversions to one of
10930         the allowed switch types (Fixes test-322.cs).
10931         (LocalInfo.Resolve): Re-enable sanity-test.
10932
10933 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
10934
10935         * cs-tokenizer.cs (consume_identifier): Detect double undescores
10936         
10937         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10938         
10939         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10940
10941 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10942
10943         Fix #75472.
10944         * ecore.cs (SimpleName.GetSignatureForError): Add.
10945         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10946         (MemberAccess.GetSignatureForError): Add.
10947
10948 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
10949  
10950         The big error and warning messages review.
10951         
10952         * anonymous.cs,
10953         * assign.cs,
10954         * attribute.cs,
10955         * class.cs,
10956         * codegen.cs,
10957         * convert.cs,
10958         * cs-parser.jay,
10959         * cs-tokenizer.cs,
10960         * decl.cs,
10961         * delegate.cs,
10962         * doc.cs,
10963         * driver.cs,
10964         * ecore.cs,
10965         * enum.cs,
10966         * expression.cs,
10967         * flowanalysis.cs,
10968         * iterators.cs,
10969         * literal.cs,
10970         * location.cs,
10971         * modifiers.cs,
10972         * namespace.cs,
10973         * parameter.cs,
10974         * pending.cs,
10975         * report.cs,
10976         * rootcontext.cs,
10977         * statement.cs,
10978         * support.cs,
10979         * tree.cs,
10980         * typemanager.cs: Updated.
10981         
10982         * class.cs: (MethodCore.SetYields): Moved here to share.
10983         (PropertyMethod.Define): Moved iterator setup here.
10984         
10985         * iterators.cs: Add orig_method to have full access to parent
10986         container.
10987
10988 2005-07-05  Raja R Harinath  <rharinath@novell.com>
10989
10990         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10991         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10992         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10993         variable of struct type.
10994         * expression.cs (Unary.ResolveOperator): Update to change.
10995         (Indirection.VerifyFixed): Likewise.
10996         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10997         (ParameterReference.VerifyFixed): Value parameters are fixed.
10998         (This.VerifyFixed): Treat 'this' as a value parameter.
10999         * statement.cs (LocalInfo.IsFixed): Remove.
11000
11001 2005-07-01  Martin Baulig  <martin@ximian.com>
11002
11003         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11004         `ec.EmitThis ()' to get the correct scope.
11005
11006 2005-07-01  Martin Baulig  <martin@ximian.com>
11007
11008         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11009         instance is a ParameterReference; fixes #75299.
11010
11011 2005-07-01  Martin Baulig  <martin@ximian.com>
11012
11013         Reverted Marek's latest patch (r46725):
11014         - it contains structural changes which are neither mentioned in
11015           the ChangeLog nor explained anywhere; for example the additional
11016           argument of EmitContext's and Iterator's .ctor's and the
11017           TypeContainer.DefineMembers() change.
11018         - structural changes like this should go in in seperate patches
11019           and not be hidden in a huge patch which just seems to affect
11020           warnings and errors.
11021           a big and hard to understand patch.
11022         - it breaks iterators and causes regressions, for instance in
11023           test-iter-03.cs.      
11024
11025 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11026
11027         Fix #75412.
11028         * expression.cs (Indexers.map): Remove.
11029         (Indexers.Append): Filter out inaccessible setters and getters.
11030         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11031
11032         Fix #75283.
11033         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11034         Refactored from ...
11035         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11036         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11037         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11038         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11039
11040 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11041
11042         Fix #75322
11043         * class.cs (FieldBase.GetInitializerExpression): One more field
11044         for backup.
11045
11046 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11047
11048         * pending.cs: Do not define a proxy if the base method is virtual,
11049         it will be picked up by the runtime (bug 75270).
11050
11051 2005-06-08  Martin Baulig  <martin@ximian.com>
11052
11053         The big Iterators rewrite :-)
11054
11055         * iterators.cs: Rewrite this to use the anonymous methods framework.
11056
11057         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11058         before the TypeContainers; see 2test-21.cs.
11059
11060         * class.cs
11061         (TypeContainer.DefineType): Don't create a new EmitContext if we
11062         already have one (this only happens if we're an Iterator).
11063         (TypeContainer.Define): Also call Define() on all our iterators.
11064         (Method.CreateEmitContext): Added support for iterators.
11065
11066         * anonymous.cs
11067         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11068         (AnonymousContainer.CreateMethodHost): Moved here from
11069         AnonymousMethod and made abstract.
11070         (AnonymousContainer.CreateScopeType): New abstract method.
11071         (AnonymousContainer.IsIterator): New public property.
11072         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11073         get the ScopeTypeBuilder rather than manually defining it here. 
11074         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11075         iterators here.
11076
11077         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11078         before RootContext.DefineTypes().
11079
11080         * codegen.cs (EmitContext.RemapToProxy): Removed.
11081         (EmitContext.CurrentAnonymousMethod): Changed type from
11082         AnonymousMethod -> AnonymousContainer.
11083         (EmitContext.ResolveTopBlock): Protect from being called twice.
11084         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11085         (EmitContext.EmitThis): Removed the iterators hacks; use the
11086         anonymous methods framework for that.
11087
11088         * statement.cs
11089         (ToplevelBlock.Container): Make this a property, not a field.
11090         (ToplevelBlock.ReParent): New public method; move the
11091         ToplevelBlock into a new container.
11092         (Foreach.TemporaryVariable): Simplify.
11093
11094 2005-06-05  Martin Baulig  <martin@ximian.com>
11095
11096         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11097         (Block.AddTemporaryVariable): New public method; creates a new
11098         `LocalInfo' for a temporary variable.
11099         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11100         variables here.
11101         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11102         non-iterator variables.
11103
11104 2005-06-05  Martin Baulig  <martin@ximian.com>
11105
11106         * statement.cs (Foreach.TemporaryVariable): Create the
11107         LocalBuilder in the Emit phase and not in Resolve since in some
11108         situations, we don't have an ILGenerator during Resolve; see
11109         2test-19.cs for an example.
11110
11111 2005-06-04  Martin Baulig  <martin@ximian.com>
11112
11113         **** Merged r45395 from GCS ****
11114
11115         The big Foreach rewrite - Part II.
11116
11117         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11118         with `PropertyInfo ienumerator_getcurrent'.
11119
11120         * codegen.cs (VariableStorage): Removed.
11121
11122         * statement.cs
11123         (Foreach): Derive from Statement, not ExceptionStatement.
11124         (Foreach.CollectionForeach): New nested class.  Moved all the code
11125         dealing with collection foreach here.
11126         (Foreach.ForeachHelperMethods): Removed.
11127         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11128
11129 2005-05-23  Martin Baulig  <martin@ximian.com>
11130
11131         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11132         don't need to.  Fix #75014.
11133
11134 2005-05-20  Martin Baulig  <martin@ximian.com>
11135
11136         Merged r44808 from GMCS.
11137
11138         * class.cs (TypeContainer.CircularDepException): Removed.
11139         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11140         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11141         (CS0146) and interface (CS0529) dependencies here.
11142
11143 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11144
11145         * expression.cs (Invocation.EmitCall): Fix initialization
11146         'this_call' to reflect current behaviour.  Fix indentation.
11147
11148         * convert.cs (FindMostEncompassedType): Add two trivial special
11149         cases (number_of_types == 0 || number_of_types == 1).
11150         (FindMostEncompasingType): Likewise.
11151
11152 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11153
11154         Some cleanups preparing for the fix of #75283.
11155         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11156         error testing.
11157         (EventExpr.InstanceResolve): Likewise.
11158         (EventExpr.DoResolve): Remove redundant checks.
11159
11160 2005-06-10  Duncan Mak  <duncan@novell.com>
11161
11162         * cs-tokenizer.cs (process_directives): New flag for controlling
11163         the processing of preprocessor directives.
11164         (x_token): After seeing a '#', return Token.NONE instead of going
11165         to handle_preprocessing_directive() when not processing
11166         directives. This avoids unnecessary processing during the token peek in
11167         is_punct().
11168
11169         This fixes #74939.
11170
11171         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11172         the existing error reporting methods instead of Report.Error.
11173
11174         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11175         after Raja's rewrite.
11176
11177 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11178
11179         * class.cs: Small fix.
11180
11181 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11182
11183         Fix #75160.
11184         * class.cs (GetPartialBases): Fix return value check of
11185         part.GetClassBases.
11186
11187 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11188
11189         Ensure that partial classes are registered in their enclosing
11190         namespace.  Initial part of fix of #75160.
11191         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11192         Register declspace with namespace here, not in
11193         DeclSpace.RecordDecl.
11194         * cs-parser.jay: Pass namespace to RecordDecl.
11195         * class.cs (PartialContainer.Create): Likewise.
11196         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11197         called.
11198         * decl.cs (Declspace.RecordDecl): Remove.
11199         * namespace.cs (NamespaceEntry.DefineName): Remove.
11200
11201 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11202
11203         * rootcontext.cs: Reset TargetExt as well.
11204
11205 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11206
11207         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11208         -langversion:ISO-1.
11209
11210 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11211
11212         Fix #75080, cs0119.cs.
11213         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11214         of ...
11215         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11216         allowing ExprClass.Type and ExprClass.Namespace for
11217         ResolveFlags.VariableOrValue.
11218         (Expression.Resolve) [1-argument variant]: Change default resolve
11219         flags based on language version.
11220         (Expression.Error_UnexpectedKind): Use a simple string array
11221         rather than an ArrayList.
11222         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11223         not ExprClass.Type.
11224         (TypeOfVoid.DoResolve): Likewise.
11225         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11226         flags argument -- it always has the same value.
11227
11228 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11229
11230         Fix #75081.
11231         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11232         Use it in the error message.
11233         * assign.cs, expression.cs, statement.cs: Update.
11234
11235 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11236
11237         Fix #75088.
11238         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11239         the "almostMatchedMember" case too.
11240         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11241         that failed the accessibility checks to 'almost_match'.
11242
11243 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11244
11245         * attribute.cs: Use internal MethodBuilder methods to set
11246         ExactSpelling and SetLastError on PInvoke methods, instead
11247         of passing them via charset.  Fixes #75060.
11248
11249 2005-05-27  Raja R Harinath  <rharinath@novell.com>
11250
11251         * parameter.cs (Parameter): Remove TODO comment.
11252         (Parameter.DefineParameter): Remove Location parameter.
11253         (Parameters.LabelParameters): Likewise.
11254         * class.cs (Constructor.Emit): Update to change.
11255         (MethodData.Emit): Likewise.
11256         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
11257         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11258
11259 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
11260
11261         * parameter.cs,
11262           Removed Parameters.Location and added Parameter.Location instead.
11263           Removed Location parameter from Emit() and GetSignature().
11264         * anonymous.cs,
11265           class.cs,
11266           cs-parser.jay,
11267           delegate.cs,
11268           iterators.cs,
11269           statement.cs :
11270           Modified all related calls.
11271
11272 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11273
11274         Improve user-defined conversion handling.
11275         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11276         applicable operators.
11277         (AddConversionOperators): New.  Helper for GetConversionOperators.
11278         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11279         there is only one most encompassed/encompassing type.
11280         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11281         "applicable operator" handling.
11282         (UserConversion): Move cache here from GetConversionOperators.
11283         Directly cache the chosen operator, rather than the whole
11284         MethodGroup.
11285         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11286         case.  Allow conversion of decimal to sbyte and byte too.
11287         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11288         New static methods.  Used to avoid allocating EmptyExpressions in
11289         convert.cs.
11290
11291 2005-05-24  Duncan Mak  <duncan@novell.com>
11292
11293         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11294         another class, used in Convert.ExplicitNumericConversion.
11295         (CastToDecimal): New class, similar to above, but casts to
11296         System.Decimal, used in Convert.ImplicitNumericConversion and also
11297         in explicit convesion from double/float to decimal.
11298
11299         * convert.cs (ImplicitNumericConversion): Handle implicit
11300         conversions to System.Decimal.
11301         (ExplicitNumericConversion): handle explicit conversions to
11302         System.Decimal.
11303
11304         This fixes #68711.
11305         
11306 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11307
11308         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11309         know the type at this stage, just break through.   Fixes #75008 
11310
11311 2005-05-19  Martin Baulig  <martin@ximian.com>
11312
11313         * delegate.cs
11314         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11315         to disable error reporting.
11316
11317         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11318         here since we don't want to report an error; see the new test-336.cs.
11319
11320 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11321
11322         * statement.cs (ToplevelBlock.GetParameterReference)
11323         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11324         Move here from class Block.
11325         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11326         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11327
11328 2005-05-18  Martin Baulig  <martin@ximian.com>
11329
11330         Fix #74978.
11331
11332         * flowanalysis.cs
11333         (FlowBranching.Reachability): Add non-static public And() and Or()
11334         methods.
11335         (FlowBranchingSwitch): New class; do the `break_origins' thing
11336         like in FlowBranchingLoop.
11337         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11338         reachability, not just locals and parameters.
11339         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11340         switch; MergeBreakOrigins() now takes care of that.
11341
11342 2005-05-18  Martin Baulig  <martin@ximian.com>
11343
11344         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11345         a loop and may leave it, reset the barrier; fixes #74974.
11346
11347 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11348         
11349         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11350         is back.
11351         
11352         * cs-parser.jay: Catch more lexical errors.
11353         
11354         * report.cs: Add one more Error method.
11355         
11356         * rootcontext.cs,
11357         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11358
11359 2005-05-17  Martin Baulig  <martin@ximian.com>
11360
11361         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11362         #70970. 
11363
11364 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11365
11366         Fix test-382.cs.  Emit values of decimal constants.
11367         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11368         Carved out of ...
11369         (TypeContainer.AddField): ... this.
11370         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11371         with initializers to include 'Const's.
11372         (ClassPart.RegisterFieldForInitialization): Forward to
11373         PartialContainer.
11374         * const.cs (Const.Const): Pass initializer to base class.
11375         (Const.Define): In case of decimal constants, register them for
11376         initialization in a static constructor.
11377
11378 2005-05-14  Martin Baulig  <martin@ximian.com>
11379
11380         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11381         do not call ResolveUnreachable() on unreachable statements in
11382         here, see the comment in the source code.
11383
11384 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11385
11386         Fix #74934.
11387         * expression.cs (BinaryResolveOperator): If one of the operands of
11388         an equality comparison is 'null' and the other is a pointer type,
11389         convert the null to a NullPointer.
11390         * convert.cs (ImplicitReferenceConversion): If the expression is a
11391         NullLiteral and the target type is a pointer type, return a
11392         NullPointer instead.
11393         (ImplicitConversionStandard): Likewise.
11394
11395 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
11396         
11397         * cs-parser.jay: Set readonly context based on special constructs.
11398         
11399         * expression.cs (LocalVariableReference.DoResolveBase): Improved
11400         readonly variable error handling.
11401         
11402         * rootcontext.cs (EmitCode): Don't verify members when error
11403         occurred.
11404         
11405         * statement.cs (LocalInfo): Add reaodnly context information.
11406         (SetReadOnlyContext, GetReadOnlyContext): New methods.
11407
11408 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11409
11410         * statement.cs (Block.Resolve): Revert change below.  Modify fix
11411         for #74041 to initialize 'resolved' to false only for explicit
11412         blocks.  Fixes #74873.
11413
11414 2005-05-12  Raja R Harinath  <harinath@gmail.com>
11415
11416         Fix #74920.
11417         * typemanager.cs (unmanaged_enclosing_types): New.
11418         (IsUnmanagedType): Avoid infloops by using
11419         'unmanaged_enclosing_types' to talk with recursive invocations.
11420
11421 2005-05-13  Martin Baulig  <martin@ximian.com>
11422
11423         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11424         instance variable, not a local.  Fix #74873.
11425         (Block.ResolveUnreachable): Set it to true here.
11426
11427 2005-05-11  Duncan Mak  <duncan@novell.com>
11428
11429         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11430         continuing to process for 'arg'.
11431         (handle_preprocessing_directive): Check the argument of the #endif
11432         directive and report error CS1025 if there are any trailing
11433         characters.
11434
11435         According to the C# spec, having even whitespace after the #endif
11436         directive is illegal; however, because we call arg.TrimEnd ()
11437         beforehand, we have the same behavior as csc, allowing whitespace
11438         after the directive.
11439
11440         Fixes #74892.
11441
11442 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
11443
11444         Fix #74863.
11445         
11446         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11447         (Constructor.GetObsoleteAttribute): Implemented correctly.
11448
11449 2005-05-10  Martin Baulig  <martin@ximian.com>
11450
11451         * support.cs (ReflectionParameters.ParameterModifier): Use
11452         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11453         and `ParameterAttributes.In'.  Fixes #74884.
11454
11455 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
11456
11457         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11458         
11459         * expression.cs (Argument.GetParameterModifier): Turned to property.
11460         (Invocation.Error_InvalidArguments): Add more descriptive errors.
11461         
11462         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11463         its C# equivalent.
11464         
11465 2005-05-09  Raja R Harinath  <rharinath@novell.com>
11466
11467         Fix #74852.
11468         * decl.cs (MemberCache.AddMethods): Register override methods,
11469         rather than non-override methods.
11470         * typemanager.cs (RegisterOverride): New.
11471         (IsOverride): Update.
11472
11473 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
11474
11475         Fix #73105.
11476         
11477         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11478         recursive declaration.
11479         
11480         * statement.cs (Block.ResolveMeta): Report any error in resolving.
11481         
11482 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
11483
11484         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11485         
11486         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11487
11488 2005-05-05  Raja R Harinath  <rharinath@novell.com>
11489
11490         Fix #74797.
11491         * decl.cs (DeclSpace.FamilyAccessible): 
11492         Use TypeManager.IsNestedFamilyAccessible.
11493
11494         Fix reopened #64812.
11495         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11496         internal'.
11497
11498 2005-05-04  Raja R Harinath  <rharinath@novell.com>
11499             Abin Thomas  <projectmonokochi@rediffmail.com>
11500             Anoob V E  <projectmonokochi@rediffmail.com>
11501             Harilal P R  <projectmonokochi@rediffmail.com>
11502
11503         Fix #64812.
11504         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11505         allow access to all static members.
11506
11507 2005-05-04  Martin Baulig  <martin@ximian.com>
11508
11509         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11510
11511 2005-05-04  Martin Baulig  <martin@ximian.com>
11512
11513         Fix #74655.
11514
11515         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11516         section at the end; make things work if `default' is not the last
11517         section.        
11518
11519 2005-05-04  Martin Baulig  <martin@ximian.com>
11520
11521         Fix #70400.
11522
11523         * statement.cs (Switch): Replaced the `got_default' field with a
11524         `default_section' one.
11525         (Switch.CheckSwitch): Set `default_section' here.
11526         (Switch.Resolve): If we're a constant switch and the constant is
11527         not found, use the default section.
11528
11529 2005-05-03  Martin Baulig  <martin@ximian.com>
11530
11531         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11532
11533         * statement.cs (Foreach.ArrayForeach): New nested class.
11534         (Foreach.TemporaryVariable): New nested class.
11535         (Foreach.EmitArrayForeach): Removed; this is now in the new
11536         ArrayForeach class.
11537
11538 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11539
11540         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11541         more conservative.
11542         (VerifyPendingMethods): Revert change below.
11543
11544         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11545         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11546         that used to trigger warning -28.  Remove warning -28.
11547         * expression.cs (Invocation.OverloadResolve): Use
11548         TypeManager.IsOverride to distinguish override methods.
11549
11550         Fix #74773.
11551         * pending.cs (VerifyPendingMethods): If a base type implements the
11552         requested interface, don't bother checking individual methods of
11553         the base type.  As a side-effect, this prevents the creation of
11554         unnecessary proxies.
11555
11556 2005-05-02  Martin Baulig  <martin@ximian.com>
11557
11558         Fix #70182.
11559
11560         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11561         Also `And' the locals if the old vector is null.
11562         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11563         null; in this case we basically reset all the variables.        
11564
11565 2005-05-02  Martin Baulig  <martin@ximian.com>
11566
11567         Fix #74529.
11568
11569         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11570         Added `FlowBranching branching' argument; always `and' the
11571         variables instead of `or'ing them unless we're an infinite loop.
11572
11573         * statement.cs (While.Resolve): Create a new sibling unless we're
11574         infinite.       
11575
11576 2005-05-02  Martin Baulig  <martin@ximian.com>
11577
11578         Fix #70140.
11579
11580         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11581         arguments; use it instead of creating a new TopLevelBlock.
11582         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11583         our ConstructorInitializer.
11584
11585         * statement.cs
11586         (TopLevelBlock.TopLevelBranching): New public property.
11587         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11588         and create our `TopLevelBranching'.
11589
11590         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11591         anonymous method host, use `block.TopLevelBranching' rather than
11592         creating a new branching.
11593
11594 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11595
11596         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11597         a ScopeInfo, if any of the current children is a child of the new
11598         entry, move those children there.
11599
11600 2005-04-30  Martin Baulig  <martin@ximian.com>
11601
11602         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11603         at the beginning of a SwitchSection.  Fix #73335.
11604
11605 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11606
11607         Fix #74378
11608         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11609         
11610         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11611         (FieldExpr.DoResolve): Obsolete members are ignored for field
11612         initializers.
11613         
11614 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11615
11616         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11617         of arrays detection.
11618
11619         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11620         verification.
11621         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11622
11623         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11624         arrays report.
11625
11626 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11627
11628         * cs-parser.jay: Use the prefered version of -unsafe in error
11629         message.
11630
11631 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11632
11633         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11634         circumstances.
11635
11636 2005-04-20  John Luke  <john.luke@gmail.com>
11637
11638         * driver.cs: fix typo in error message, --outout to --output
11639
11640 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11641
11642         * codegen.cs (InRefOutArgumentResolving): New field.
11643         
11644         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11645         fields outside contructor.
11646         
11647         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11648         
11649 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11650
11651         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11652         parameter code was not completed ever, so it was not as up-to-date
11653         as local variables.  Must finish it.
11654
11655         The bug fix was to compare the Toplevel of the block, not the
11656         current block.  Thanks for Ben for pointing this out. 
11657
11658 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11659
11660         * decl.cs (AddMethods): Use the declaring type of the problem
11661         method to determine if we want to squash a warning.
11662
11663 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11664
11665         * attribute.cs: Removed debug output.
11666
11667         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11668         
11669         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11670         Report.Stderr.
11671         
11672 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11673
11674         Fix #74481.
11675         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11676         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11677         all null comparisons against reference types.
11678
11679 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11680
11681         Fix# 74565
11682         * class.cs (TypeContainer.CircularDepException) New nested
11683         exception class.
11684         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11685         (TypeContainer.DefineType): Removed error, reset InTransit before
11686         exit.
11687         (Class.DefineType): Throw exception when is in Transit.
11688         Catch exception and report error.
11689         (Struct.DefineType): Throw exception when is in Transit.
11690         Catch exception and report error.
11691         (Interface.DefineType): Throw exception when is in Transit.
11692         Catch exception and report error.
11693
11694         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11695         handle nested exception handlers.
11696
11697         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11698         a catch.
11699
11700         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11701         InFinally and InCatch storage.
11702
11703         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11704         (Catch.Resolve): Set and Restore ec.InCatch.
11705         (Try.Resolve): Set and Restore ec.InFinally.
11706         (Try.HasCatch): True when try has catch.
11707
11708 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11709
11710         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11711           for the same event member, so exclude such cases from warning 419.
11712           Fixed bug #74633.
11713
11714 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11715
11716         * expression.cs (Binary.ResolveOperator): Apply patch from John
11717         Luke to fix bug 59864: operators &, | and ^ on enumerations
11718         require that the same enum type on both sides.
11719
11720         * driver.cs: Add warnings to old flag usage, this is to assist
11721         people who produce Makefiles and hope that the Makefiles will be
11722         used on Windows.
11723
11724         * class.cs (TypeContainer.EmitType): Moved the definition of the
11725         special $PRIVATE$ field from the resolve phase to the Emit phase.
11726         During resolve we do not know if we are a struct with
11727         HasExplicitLayout, we know this only after the attributes for the
11728         type are emitted.
11729
11730         Set the FieldOffset to zero on the dummy field that we create for
11731         the class.   Fixes 74590.
11732
11733 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11734
11735         Fix #73834.
11736         * ecore.cs (PropertyExpr.resolved): New.
11737         (DoResolve): Use it to handle a case of double resolution here.
11738         Handle a case of identical-name-and-type-name.
11739         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11740         resolution by storing the results of expression resolution back
11741         into the "probes" array.
11742
11743 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11744
11745         Fix cs0208-7.cs and cs0208-8.cs.
11746         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11747         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11748         error reporting to point out the reason a struct is not unmanaged.
11749
11750 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11751
11752         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11753           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11754
11755 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11756
11757         Fix #74528.
11758         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11759         IdenticalNameAndTypeName here.
11760         (EventExpr.InstanceResolve): Likewise.
11761
11762 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11763
11764         C# 2.0 DefaultCharSetAttribute implementation
11765         
11766         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11767         which allows us to set GlobalNamespace for every resolve.
11768         (Attribute.ResolveArguments): Cut from Resolve.
11769         (Attribute.GetCharSetValue): Returns CharSet named argument.
11770         (Attribute.DefinePInvokeMethod): Gets default charset from
11771         module settings.
11772         (GlobalAttribute.ResolveAsTypeStep): Override.
11773         (GlobalAttribute.ResolveArguments): Override.
11774         
11775         * class.cs (TypeAttr): Is protected.
11776         
11777         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11778         (ModuleClass.DefaultCharSetType): New memeber.
11779         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11780         
11781         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11782         charset from module.
11783         
11784         * delegate.cs (TypeAttr): Override.
11785         (Delegate.DefineType): Use this TypeAttr.
11786         
11787         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11788         at very early stage (before types are defined) to resolve model
11789         module attributes. It will probably not work with corlib but it
11790         should be ok.
11791         
11792         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11793         charset from module.
11794         
11795         * typemanager.cs (default_charset_type): New type.
11796
11797 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11798
11799         * decl.cs (MemberCache.AddMethods): Don't warn if
11800         System.Object.Finalize has buggy MethodAttributes.
11801
11802         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11803         removed below.
11804
11805 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11806
11807         * doc.cs : detect ambiguous reference to overloaded members.
11808           Fixed bug #71603. MS 1.1 csc does not detect it.
11809
11810 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11811
11812         * doc.cs : delegates must not be referenced with parameters.
11813           Fixed bug #71605.
11814
11815 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11816
11817         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11818
11819 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11820
11821         * driver.cs (MainDriver): Stop processing if the CLS stage found
11822         errors. 
11823
11824         (CompilerCallableEntryPoint.InvokeCompiler): Always
11825         reset after execution;   Take a TextWriter argument for the
11826         output.
11827
11828         * report.cs: Use the error stream instead of hardcoding stderr. 
11829
11830 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11831
11832         * class.cs: Reduce code paths to test, too small of an
11833         optimization to make it worth the extra testing.  Always perform
11834         it. 
11835
11836 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11837
11838         Fix #74510.
11839         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11840         operators that had errors reported on them.
11841
11842 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11843
11844         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11845         argument types.
11846         (Attribute.Resolve): Add named argument type checking.
11847         
11848         * class.cs (FixedField.Define): Use IsPrimitiveType
11849         
11850         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11851         
11852         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11853         unsafe parameter types.
11854         
11855         * statement.cs (Using.ResolveExpression): Add better error description.
11856         
11857         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11858         
11859 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11860
11861         Fix #74484.
11862         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11863         AttributeUsageAttribute in the emitcontext of the attribute class,
11864         not in the emitcontext of the attributable entity it was attached to.
11865         * cs-parser.jay: Use 'current_class', not 'current_container',
11866         when creating a GlobalAttribute.
11867
11868 2005-04-08  Alp Toker  <alp@atoker.com>
11869
11870         * pending.cs: The fix to #58413 failed to compile methods implementing
11871         interfaces with/without params modifiers and vice versa, even though
11872         params modifiers aren't part of the signature. Make the modifier check
11873         less strict as in csc.
11874
11875 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11876             Anoob V E  <projectmonokochi@rediffmail.com>
11877             Harilal P R  <projectmonokochi@rediffmail.com>
11878
11879         Fix #58413.
11880         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11881         modifiers of pending methods.
11882         (PendingImplementation.PendingImplementation): Initialize it.
11883         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11884         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11885         with ParameterData.  Add check for modifiers.
11886         * class.cs (MethodData.Define): Update to changes.
11887
11888 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11889
11890         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11891
11892 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11893
11894         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11895         property.
11896         
11897         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11898         
11899         * rootcontext.cs,
11900         * typemanager.cs: Registered RequiredAttributeAttribute.
11901         
11902 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11903
11904         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11905         Warning CS0169 is back at level 3.
11906         (IMethodData.SetMemberIsUsed): New method.
11907         
11908         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11909         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11910         
11911         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11912
11913         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11914         contants.
11915         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11916         is used.
11917         
11918         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11919         is used.
11920         
11921         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11922         to avoid the problems with nested types.
11923
11924 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
11925             Anoob V.E  <projectmonokochi@rediffmail.com>
11926             Harilal P.R  <projectmonokochi@rediffmail.com>
11927             Raja R Harinath  <rharinath@novell.com>
11928
11929         Fix #73820.
11930         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11931         attribute.
11932         * typemanager (GetConstructor): Make public.
11933
11934 2005-04-05  John Luke  <john.luke@gmail.com>
11935             Raja R Harinath  <rharinath@novell.com>
11936
11937         Fix #62232.
11938         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11939         struct too.  Return false quicker in a few cases.
11940         (VerifyUnManaged): Use it.
11941
11942 2005-04-05  Raja R Harinath  <rharinath@novell.com>
11943
11944         Fix #74041.
11945         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11946         not 'unreachable_seen'.
11947
11948 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
11949
11950         * attribute.cs (Attribute.GetValue): Removed unused.
11951         
11952         * codegen.cs (CodeGen.TrimExt): Removed unused.
11953         
11954         * cs-parser.jay (output): Removed unused.
11955         
11956         * cs-tokenizer.cs (hex_digits): Removed unused.
11957         
11958         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11959         
11960         * expression.cs (Indirection.LoadExprValue): Removed unused.
11961         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11962         
11963         * iterators.cs (Iterator.param_types): Removed unused.
11964         
11965         * statement.cs (Goto.block): Removed unused.
11966         (ToplevelBlock.did): Removed unused.
11967         (Switch.ResolveConstantSwitch): Removed unused.
11968
11969 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
11970
11971         * rootcontext.cs: Allow mcs to bootstrap with the compilation
11972         resetting thingy.
11973
11974 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11975
11976         Fix #74232 and cs0208-3.cs.
11977         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11978         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11979         unmanaged type.  Don't use FieldBuilders when 't' is a
11980         TypeBuilder.  Use ModFlags and MemberType fields.
11981         * class.cs (MemberBase.member_type): Rename from MemberType.
11982         (MemberBase.MemberType): New property.  Determines member_type on
11983         demand.
11984         (MemberBase.DoDefine): Don't initialize MemberType here.
11985         (FieldMember.Define): Likewise.
11986
11987 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
11988
11989         Fix #74241
11990         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11991         Attributes are emitted there.
11992         
11993 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11994
11995         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11996         keyword in 'partial enum' too.
11997         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11998         is not allowed).
11999         Report from Kamil Skalski <nazgul@omega.pl>.
12000
12001         Fix #74309.
12002         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12003         have partial containers too.
12004
12005         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12006         in block' checks to Block.CheckInvariantMeaningInBlock.
12007         * statement.cs (Block.GetKnownVariableInfo): Make private.
12008         (Block.IsVariableUsedInChildBlock): Remove.
12009         (Block.IsVariableUsedInBlock): Likewise.
12010         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12011         conflicting declaration.
12012         (Block.AddVariable): Make error messages less long-winded and more
12013         specific.  Show location of conflicting declaration.
12014         * parameter.cs (Parameters.Location): New readonly property.
12015
12016 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12017
12018         Clean up semantics of invoking ResolveMemberAccess.
12019         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12020         can have an instance, ensure that we pass in a non-TypeExpression
12021         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12022         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12023         argument.  Update to changes and simplify.
12024         (FieldExpr.Emitinstance): Remove CS0120 check.
12025         (PropertyExpr.EmitInstance): Likewise.
12026         * expression.cs (Argument.Resolve): Likewise.
12027         (Invocation.DoResolve): Update to changes in semantics of
12028         InstanceExpression.
12029
12030 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12031
12032         Fix #74241
12033         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12034         customization.
12035         
12036         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12037
12038 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12039
12040         Fix difference in behaviour with commandline invocation.
12041         * driver.cs (Driver.Reset): New.
12042         (CompilerCallableEntryPoint): Call it.
12043
12044         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12045         variable" warnings if the boolean expression failed to resolve.
12046
12047 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12048
12049         * attribute.cs: Fix the union of several permissions when some of them
12050         are unrestricted (so the result isn't an unrestricted permission set).
12051         Fix #74036.
12052
12053 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12054
12055         * ecore.cs (MemberExpr): New class.  Convert from interface
12056         IMemberExpr.
12057         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12058         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12059         error checks.
12060         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12061         (MethodGroupExpr.IsExplicitImpl): Remove.
12062         (Expression.GetFieldFromEvent): Remove.
12063         (SimpleName.MemberStaticCheck): Remove.
12064         (SimpleName.DoSimpleNameResolve): Update to changes.
12065         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12066         (MemberAccess.IdenticalNameAndTypeName): Remove.
12067         (MemberAccess.error176): Move to MemberExpr.
12068         (MemberAccess.DoResolve): Update to changes.
12069         (BaseAccess.DoResolve): Likewise.
12070
12071 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12072
12073         C# 2.0 Conditional attribute class implementation
12074         
12075         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12076         Analyzes class whether it has attribute which has ConditionalAttribute
12077         and its condition is not defined.
12078         
12079         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12080         (Class.IsExcluded): New method. Search for at least one defined
12081         condition in ConditionalAttribute of attribute class.
12082
12083 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12084
12085         * ecore.cs (PropertyExpr): Derive from Expression, not
12086         ExpressionStatement.
12087         (PropertyExpr.EmitStatement): Remove.
12088
12089 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12090
12091         Fix #74060.
12092         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12093         internal field "value__" of an enum be private.  The examples for
12094         "value__" that I found on MSDN all used FieldAttributes.Private.
12095
12096         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12097         Don't mention IL method attribute names.
12098
12099         Fix #47991.  Remove a TODO.
12100         * statement.cs (Block.Toplevel): Make into a field.
12101         (Block.Parameters): Move into ToplevelBlock.
12102         (Block.known_variables): Rename from child_variable_names.
12103         (Block.Block): Remove variants that take Parameters.  Initialize
12104         'Toplevel' with the immediately surrounding toplevel block.
12105         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12106         LocalInfo parameter.
12107         (Block.GetKnownVariableInfo): New.
12108         (Block.IsVariableNameUsedInChildBlock): Update.
12109         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12110         the block, even though it may not be in scope.
12111         (Block.AddVariable): Remove Parameters parameter.  Use
12112         Toplevel.Parameters instead.
12113         (Block.AddConstant): Remove Parameters parameter.
12114         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12115         (Block.IsParamaterReference): Likewise.
12116         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12117         (ToplevelBlock.Parameters): New.  Moved from Block.
12118         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12119         initialize Parameters to a non-null value.
12120         * cs-parser.jay: Update to changes.
12121         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12122         simple names that mean different things in the same block.  Use
12123         Block.IsVariableNameUsedInBlock.
12124
12125 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12126
12127         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12128         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12129         GetTypeHandle.  It is possible for a reflected type to derive from
12130         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12131         System.Array during mscorlib compilation).
12132         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12133         contain a method_hash, don't create one either.  Don't create a
12134         deep copy of the base cache's method_hash.
12135         (MemberCache.SetupCache): Rename back from DeepCopy.
12136         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12137         already initialized.  If we see an override function, add its
12138         underlying base virtual function to the member_hash too.
12139
12140         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12141
12142 2005-03-26  Raja R Harinath  <harinath@acm.org>
12143
12144         Fix #73038.
12145         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12146         fails to resolve, ensure that the LHS is still resolved as an
12147         lvalue.
12148
12149 2005-03-25  Raja R Harinath  <harinath@acm.org>
12150
12151         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12152         ec.ContainerType.
12153         (Enum.current_ec): Remove.
12154         (Enum.LookupEnumValue): Remove EmitContext argument.
12155         Just uses the one created during DefineType.
12156         (Enum.FindMembers): Update.
12157         * expression.cs (MemberAccess.DoResolve): Update.
12158
12159 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12160
12161         * assign.cs (Assign.DoResolve): Check for CS1717 when
12162         source and target are same (uses Equals).
12163
12164         * expression.cs (LocalVariableReference, ParameterReference,
12165         This): Implemented Equals, GetHashCode.
12166
12167         * statement.cs (Block.GetParameterReference): Removed useless
12168         local variable.
12169
12170 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12171
12172         Fix cs0128.cs
12173         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12174         blocks before deciding whether the error is cs0136 or cs0128.
12175
12176         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12177         (using_alias_directive, using_namespace_directive): Pass
12178         MemberName, not an expression to Namespace.UsingAlias and
12179         Namespace.Using.
12180         (MakeName): Use the MemberName of the namespace.
12181         * namespace.cs (Namespace.MemberName): New.
12182         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12183         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12184         Likewise.
12185         * decl.cs (MemberName.Name): Make readonly.
12186         (MemberName.FromDotted): New "constructor".
12187         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12188         (MemberCore.Name): Compute from MemberName on demand.
12189         (MemberCore.SetMemberName): Provide a way to change the
12190         MemberName.
12191         (MemberCore.AddToContainer): Don't take a fullname parameter.
12192         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12193         fully qualified name of the container to the member name.
12194         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12195         only if the type is a member of the root container.
12196         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12197         MemberName.Left rather than searching for an embedded ".".
12198         (PartialContainer.CreatePart): Update to changes in RootContext.
12199         (MemberBase.ShortName): Turn into a property.  Use
12200         MemberCore.SetMemberName.
12201         (MemberBase.ExplicitInterfaceName): Remove.
12202         (MemberBase.UpdateMemberName): Remove.
12203         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12204         (PropertyBase.SetMemberName): New override.
12205         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12206         (Tree.GetDecl): New.
12207         (Tree.AllDecls): Rename from Decls.
12208         * attribute.cs, enum.cs, report.cs: Update to changes.
12209         * driver.cs (MainDriver): Use MemberName.FromDotted on
12210         RootContext.MainClass.
12211
12212 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12213
12214         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12215         checks.
12216
12217         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12218
12219 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12220
12221         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12222         property accessor modifiers.
12223
12224         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12225         fixed buffer attribute (CS1716).
12226         (PropertyMethod.HasCustomAccessModifier): When property accessor
12227         has custom modifier.
12228
12229         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12230         modifiers.
12231         (PropertyExpr.DoResolveLValue): Add CS0272.
12232
12233 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12234
12235         * convert.cs: When converting to a pointer, use the proper Conv.U
12236         or Conv.I depending on the source data type.
12237
12238         * cs-tokenizer.cs: Make the size for large decimal constants,
12239         fixes #72957.
12240
12241 2005-03-17  Martin Baulig  <martin@ximian.com>
12242
12243         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12244         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
12245
12246 2005-03-17  Martin Baulig  <martin@ximian.com>
12247
12248         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12249         to bool so we can return an error condition.
12250         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12251         returned an error.
12252
12253 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12254
12255         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12256         attributes.
12257
12258 2005-03-16  Raja R Harinath  <rharinath@novell.com>
12259
12260         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12261         Refactor to avoid traversing the list of assemblies, and to avoid
12262         string concatenation.
12263         * typemanager.cs (guid_attr_type): Remove.
12264         (negative_hits, pointers, references): Remove hashes.
12265         (type_hash): New.
12266         (GetConstructedType): New.  Uses type_hash to handle constructed
12267         types (arrays, references, pointers).
12268         (GetReferenceType, GetPointerType): Use it.
12269         (GetNestedType): New.  Uses type_hash to handle nested types of
12270         reflected types.
12271         (LookupType, LookupTypeDirect): Remove.
12272         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12273         'types' hash and LookupTypeReflection directly.
12274         (params_string, params_object): Use GetConstructedType.
12275         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12276         top-level types.
12277         (Namespace.Lookup): Use cached_types.
12278         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12279         provided by old TypeManager.LookupType.
12280         * rootcontext.cs (MakeFQN): Remove.
12281         * decl.cs (DeclSpace.MakeFQN): Likewise.
12282         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12283         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12284         TypeManager.GetConstructedType.
12285         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12286
12287 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12288
12289         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12290         indexers.
12291
12292         * cs-parser.jay: Reports CS1527 for any namespace element.
12293
12294         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12295         Added CS0407.
12296
12297         * expression.cs (ParameterReference.IsAssigned): Changed error to
12298         CS0269.
12299         (Error_WrongNumArguments): Moved CS0245 detection here.
12300
12301         * statement.cs (Return.Resolve): Add CS1622 report.
12302
12303 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12304
12305         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12306
12307 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12308
12309         * attribute.cs expression.cs: Get rid of some allocations.
12310
12311 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12312
12313         * doc.cs : just eliminate the latest change.
12314
12315 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12316
12317         * doc.cs : commented out the latest change. It breaks xml-030.cs
12318
12319 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12320
12321         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12322           fail. So invoke CreateType() in FindDocumentedType().
12323
12324 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12325
12326         * cs-tokenizer.cs : added IsKeyword().
12327         * doc.cs : Detect keyword incorrectly used as identifier.
12328           Allow identifiers prefixed by @.
12329
12330 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12331
12332         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12333         It caused exception in namespace resolving (again!).
12334         
12335         * class.cs (Class.ctor): Removed exit.
12336         (PropertyMethod.ctor): ditto.
12337         
12338         * codegen.cs (Codegen.Reset): Reset static data.
12339         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12340         
12341         * cs-tokenizer.cs (Cleanup): Removed.
12342         
12343         * driver.cs (GetSystemDir): Rewrote to one line command.
12344         It caused problem with unloaded dynamic modules.
12345         (UnixParseOption): Removed Exit.
12346         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12347         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12348         Now can be mcs used as library.
12349         
12350         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12351         empty location.
12352         
12353         * location.cs (Reset): Reset static data.
12354         
12355         * namespace.cs (Reset): Reset static data.
12356         
12357         * report.cs (Report.Reset): Reset static data.
12358         
12359         * rootcontext.cs (RootContext.Reset): Reset static data.
12360         
12361         * tree.cs (RootTypes.ctor): Use Location.Null
12362         
12363         * typemanager.cs (TypeManager.Reset): Reset static data.
12364         (CoreLookupType): Removed Exit.
12365         (TypeHandle.Reset): Reset static data.
12366         
12367 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12368
12369         Fix #73516.
12370         * typemanager.cs (ComputeNamespaces): Import namespaces from
12371         referenced modules too.
12372
12373 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12374
12375         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12376         than '.'.
12377
12378 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12379
12380         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12381         enclosing DeclSpace.  This ensures that a name-lookup populates
12382         more caches and there are fewer 'TypeExpression's.  Carve out
12383         nested type lookup into ...
12384         (LookupNestedTypeInHierarchy): ... this.
12385
12386 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12387
12388         Clean up a few partial-class semantics.  
12389         Fixes test-357.cs and cs1618-2.cs.
12390         * cs-parser.jay (struct_declaration): Use 'current_class' as
12391         parent of newly-created struct.  Remove call to Register ().
12392         Use 'pop_current_class' to complete handing the current struct.
12393         (interface_declaration): Likewise.
12394         (class_declaration): Likewise.
12395         (enum_declaration): Use 'current_class' as parent of newly created
12396         enum.
12397         (delegate_declaration): Likewise.
12398         (pop_current_class): New function.  This is used to handle closing
12399         up the 'current_class' and 'current_container', and pointing them
12400         to the enclosing class/container.
12401         (CSharpParser): Initialize 'current_class' too.
12402         * decl.cs (MemberCore): Add check for invariant: a partial
12403         container is not a parsed entity, and thus does not enclose any
12404         parsed members.
12405         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12406         (DeclSpace.BaseTypeExpr): Use it.
12407         (DeclSpace.LookupType): Add check for invariant.
12408         * class.cs (TypeContainer): Add check for invariant: a nested
12409         class should have the same NamespaceEntry as its enclosing class.
12410         (TypeContainer.EmitFieldInitializers): Make virtual.
12411         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12412         MemberCore.
12413         (TypeContainer.Register): Remove.
12414         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12415         null.  Use TypeResolveEmitContext for resolving base types and
12416         interfaces.  Move initialization of Parts.TypeBuilder here from
12417         ...
12418         (TypeContainer.DefineNestedTypes): ... here.
12419         (PartialContainer): Take a Namespace not a NamespaceEntry.
12420         (PartialContainer.Create): Don't use Register.  Call the
12421         appropriate Add... function directly.
12422         (ClassPart): Take both the PartialContainer and the enclosing
12423         class as constructor arguments.
12424         (ClassPart.EmitFieldInitializers): Override.
12425         (ClassPart.PartFindNestedTypes): Remove.
12426         (FieldBase.GetInitializerExpression): Resolve the initializer
12427         expression in the emit context of the enclosing class.
12428         * tree.cs (RootTypes): Remove Register ().
12429         
12430 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
12431
12432         * cs-parser.jay: Removed CS0134.
12433         
12434         * driver.cs: Removed CS1901.
12435         
12436         * expression.cs (SizeOf.DoResolve): Don't report CS0233
12437         for predefined types.
12438
12439 2005-03-07  Duncan Mak  <duncan@novell.com>
12440
12441         * codegen.cs (Save):  Catch UnauthorizedAccessException as
12442         well. Fixes bug #73454.
12443
12444 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
12445
12446         * cs-tokenizer.cs (xtoken): Add CS1035.
12447         
12448         * class.cs (MethodData.Define): Add CS0683.
12449         (FieldMember.ctor): Add CS0681.
12450
12451 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12452
12453         * ecore.cs (SimpleName.DoResolve): Rename from
12454         SimpleName.DoResolveAllowStatic.
12455         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12456         Pass 'intermediate' flag to MemberStaticCheck.
12457         (SimpleName.MemberStaticCheck): Skip "static check" only in case
12458         of "intermediate" lookups via MemberAccess.
12459         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
12460         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12461
12462 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12463
12464         Fix #73394.
12465         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12466         slipped in because of variable names that are identical to a
12467         builtin type's BCL equivalent ('string String;', 'int Int32;').
12468         (PropertyExpr.EmitInstance): Likewise.
12469
12470 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
12471
12472         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12473         
12474         * report.cs (warning_ignore_table): Made public.
12475
12476 2005-03-04  Raja R Harinath  <rharinath@novell.com>
12477
12478         Fix #73282.
12479         * class.cs (MethodData.Emit): Pass 'container' to
12480         container.GetObsoleteAttribute instead of 'container.Parent'.
12481
12482 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
12483
12484         * cs-parser.jay: Add 1534 error test.
12485
12486         * iterators.cs (Yield.CheckContext): Add error 1629.
12487         (Iterator.ctor): Save unsafe modifier.
12488         (MoveNextMethod.DoEmit): Restore unsafe context.
12489
12490         * namespace.cs (UsingAlias): Better error message.
12491
12492 2005-03-03  Dan Winship  <danw@novell.com>
12493
12494         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12495         the warning message [#73219]
12496
12497 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12498
12499         Fix compile with MCS 1.0.0.0.
12500         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12501         w_restore to not depend on string constant folding.
12502
12503 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12504
12505         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12506         CS0246 check to users who passed 'silent = false'.
12507         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12508         check.
12509         (SimpleName.SimpleNameResolve): Update.
12510         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12511         (MemberAccess.IdenticalNameAndTypeName): Update.
12512         * doc.cs (FindDocumentedTypeNonArray): Update.
12513
12514 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12515
12516         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12517         * parameters.cs (ComputeAndDefineParameters): Remove.
12518         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12519         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12520         Use GetParameterInfo.
12521
12522 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12523
12524         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12525
12526 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12527
12528         Unify DeclSpace.LookupType and DeclSpace.FindType.
12529         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12530         is in charge of defining nested types on demand.
12531         (DeclSpace.LookupType): Use it when the current_type is a
12532         TypeBuilder.  Use LookupTypeDirect for reflected types.
12533         (DeclSpace.FindType): Remove.
12534         (DeclSpace.LookupInterfaceOrClass): Likewise.
12535         (DeclSpace.DefineTypeAndParents): Likewise.
12536         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12537         DeclSpace.LookupType.
12538         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12539         * typemanager.cs (LookupType): Simplify.
12540         (AddUserType): Remove type from negative_hits.
12541         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12542         * class.cs (TypeContainer.FindMembers): Move handling of nested
12543         types ...
12544         (TypeContainer.FindMembers_NestedTypes): ... here.
12545         (TypeContainer.FindNestedType): Implement override.
12546         (ClassPart.FindNestedType): Delegate to PartialContainer.
12547         (ClassPart.PartFindNestedType): Looks up the nested types of the
12548         part alone.
12549
12550 2005-03-02  Martin Baulig  <martin@ximian.com>
12551
12552         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12553         static constructor in static classes.
12554
12555 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12556
12557         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12558         sizeParamIndex is not specified.
12559
12560 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12561
12562         Fix #73117
12563         * report.cs (WarningMessage.IsEnabled): Missing null check.
12564
12565 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12566
12567         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12568         in the fields and not in the properties.
12569
12570 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12571
12572         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12573         fields as well.
12574
12575 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12576
12577         * attribute.cs: Small refactoring (improved robustness).
12578         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12579         (ValidateGuid): Removed.
12580         (Resolve): Removed referenced to above mentioned.
12581         (GetAttributeUsage): Made private and changed to work without
12582         class assistance.
12583         (GetIndexerAttributeValue): Don't crash.
12584         (GetConditionalAttributeValue): Ditto.
12585         (GetClsCompliantAttributeValue): Ditto.
12586         (ExtractSecurityPermissionSet): All attributes exceptions are
12587         error 648.
12588         (GetPropertyValue): New helper.
12589         (GetMethodImplOptions): New method.
12590         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12591         some missing properties.
12592         
12593         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12594         (Method.ApplyAttributeBuilder): Updated.
12595         
12596         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12597         exception.
12598
12599 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12600
12601         Fix #73052.
12602         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12603         non-simple types (array, pointer, reference).
12604
12605 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12606
12607         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12608
12609         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12610         for operators.
12611         (Method.CheckBase): Catch wrong destructor here.
12612         (MethodData.Define): Add errors 550, 668.
12613
12614         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12615
12616         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12617
12618         * pending.cs (VerifyPendingMethods): Add error 551.
12619
12620         * typemanager.cs (CSharpName): Next error report helper.
12621
12622 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12623
12624         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12625         attributes. Removed useless attribute double check.
12626         It saves almost 2MBs for corlib.
12627
12628 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12629
12630         Fix #72924.
12631         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12632         called twice in case of error.
12633
12634 2005-02-23  Chris Toshok  <toshok@ximian.com>
12635
12636         Fix compiler portions of #72827.
12637         * statement.cs (Block.Emit): call Begin/EndScope on the
12638         EmitContext instead of the ILGenerator.
12639
12640         * codegen.cs (EmitContext.BeginScope): new method, call
12641         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12642         we have one.)
12643         (EmitContext.BeginScope): same, but EndScope and CloseScope
12644
12645         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12646         offset and call the superclass's OpenScope(int) with it.
12647         (SymbolWriter.CloseScope): get the current il
12648         offset and call superclass's CloseScope(int) with it.
12649
12650 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12651
12652         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12653         CS1677 for out and ref as well.
12654
12655         * class.cs (Method.Define): Add error CS1599 detection.
12656         
12657         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12658         
12659         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12660         
12661         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12662         
12663         * support.cs.cs (ModifierDesc): New helper method.
12664
12665 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12666             Abin Thomas  <projectmonokochi@rediffmail.com>
12667             Anoob V E  <projectmonokochi@rediffmail.com>
12668             Harilal P R  <projectmonokochi@rediffmail.com>
12669
12670         Fix #57851, #72718.
12671         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12672         MemberLookup (used for error reporting) actually returns a result.
12673         Fix error report number (122, not 112).
12674
12675 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12676             Anoob V E  <projectmonokochi@rediffmail.com>
12677             Harilal P R  <projectmonokochi@rediffmail.com>
12678
12679         Fix #71134.
12680         * pending.cs (PendingImplementation.GetAbstractMethods):
12681         Find NonPublic members too.
12682
12683 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12684
12685         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12686         Fixed error 217.
12687         
12688         * class.cs (MethodCore.CheckMethodAgainstBase):
12689         Add error 239 report.
12690
12691 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12692
12693         Fix #68955.
12694         * expression.cs (Invocation.IsApplicable): Make public.
12695         (Invocation.IsParamsMethodApplicable): Likewise.
12696         * delegate.cs (Delegate.VerifyApplicability): Don't use
12697         Invocation.VerifyArgumentCompat for parameter applicability
12698         testing.  Use Invocation.IsApplicable and
12699         Invocation.IsParamsMethodApplicable.
12700
12701 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12702
12703         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12704         
12705         * class.cs (Operator.Define): Add error 217 report.
12706         
12707 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12708
12709         * namespace.cs (UsingEntry.Resolve): Undo change below.
12710
12711 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12712
12713         Fix #72756.
12714         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12715         disable the error message when the extended MemberLookup also
12716         fails.
12717         (Expression.MemberLookupFinal): Update.
12718         (SimpleName.DoSimpleNameResolve): Update.
12719         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12720         Don't use MemberLookupFinal.
12721         (New.DoResolve): Update.
12722         (BaseAccess.CommonResolve): Update.
12723
12724 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12725
12726         Fix #72732.
12727         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12728         occured previously, don't resolve again.
12729
12730 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12731
12732         Fix #69949
12733         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12734         argument. Call ResolveAttributeUsage for unresolved.
12735         when types doesn't match ctor arguments.
12736         
12737         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12738         for nested attribute classes.
12739         (Class.attribute_usage): Removed.
12740         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12741         for attribute class.
12742         
12743         * ecore.cs (IsAttribute): Removed.
12744         
12745         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12746         
12747         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12748         now normal types.
12749         (attribute_types): Removed.
12750         (EmitCode): Global attributes are emited as the latest.
12751
12752 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12753
12754         * class.cs (EmitFieldInitializers): Don't emit field initializer
12755         for default values when optimilization is on.
12756         
12757         * constant.cs (Constant.IsDefaultValue): New property.
12758         
12759         * driver.cs: Add /optimize handling.
12760         
12761         * constant.cs,
12762         * ecore.cs,
12763         * literal.cs: Implement new IsDefaultValue property.
12764         
12765         * rootcontext.cs (Optimize): New field, holds /optimize option.
12766
12767 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12768
12769         Fix crasher in re-opened #72347.
12770         * namespace.cs (Namespace.Lookup): Return null if
12771         DeclSpace.DefineType returns null.
12772
12773         Fix #72678.
12774         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12775
12776 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12777
12778         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12779         now returns null if it cannot resolve to an lvalue.
12780         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12781         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12782         returned null.  Remove check for SimpleName.
12783         (EventExpr.DoResolveLValue): New.
12784         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12785         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12786         error from ...
12787         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12788         avoid CS0131 error.
12789         (Unary.ResolveOperator): Move CS0211 check ...
12790         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12791         CS0131 error.
12792         (Unary.DoResolveLValue): Simplify.
12793         (AddressOf.DoResolveLValue): New.
12794         (ArrayAccess.DoResolveLValue): New.
12795
12796 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12797
12798         * attribute.cs (Attribute.Resolve): Add arguments casting for
12799         when types doesn't match ctor arguments.
12800
12801 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12802
12803         Fix parts of #63202.
12804         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12805         lookup of operator in base type.  Ensure that all checks happen
12806         when the operator resolves to an "op_..." method.
12807
12808 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12809
12810         Fix #71992.
12811         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12812         'ignore_cs0104' parameter.  Pass it to ...
12813         (NamespaceEntry.Lookup): ... this.
12814         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12815         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12816         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12817         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12818         Update.  Request that cs0104 errors be ignored.
12819         (ComposedCast.ResolveAsTypeStep): Update.
12820
12821 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12822
12823         Fix #59209.
12824         * expression.cs (Invocation.BetterFunction): Remove support for
12825         comparing virtual functions and their overrides.
12826         (Invocation.IsOverride): New.
12827         (Invocation.OverloadResolve): Don't consider 'override' functions
12828         during candidate selection.  Store them in a lookaside list.
12829         If the selected method is a 'virtual' function, use the list to
12830         find any overrides that are closer to the LHS type.
12831
12832 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12833
12834         * expression.cs (New.DoResolve): Add complex core type reduction.
12835         (New.Constantify): Converts complex core type syntax like 'new int ()'
12836         to simple constant.
12837         
12838 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12839
12840         * decl.cs (EntryType.EntryType): New constructor to create an
12841         updated copy of a cache entry.
12842         (MemberCache.AddMethods): Use it.
12843         (MemberCache.ClearDeclaredOnly): Remove.
12844         (MemberCache.MemberCache): Update.
12845
12846 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12847
12848         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12849         variable.  This one is represents the actual low-level declaration
12850         of the method, as opposed to the semantic level `IsStatic'.   
12851
12852         An anonymous method which is hosted into a static method might be
12853         actually an instance method.  IsStatic would reflect the
12854         container, while MethodIsStatic represents the actual code
12855         generated.
12856
12857         * expression.cs (ParameterReference): Use the new MethodIsStatic
12858         instead of IsStatic.
12859
12860         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12861         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12862         set on the current EmitContext. 
12863
12864         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12865         resolve our casted expression as an LValue.  This triggers the
12866         proper LValue processing that is later required by Assign.
12867
12868         This fixes 72347.
12869
12870         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12871
12872 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12873
12874         C# 2.0 Fixed buffer implementation
12875
12876         * anonymous.cs: Update after RegisterHelperClass renaming.
12877
12878         * attribute.cs (AttributeTester.fixed_buffer_cache):
12879         Cache of external fixed buffers.
12880         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12881         implementation if field is fixed buffer else null.
12882
12883         * class.cs
12884         (TypeContainer.AddField): Accept FieldMember instead of Field.
12885         (FieldBase.IsFieldClsCompliant): Extracted code from
12886         VerifyClsCompliance descendant customization.
12887         (FixedField): New class handles fixed buffer fields.
12888         (FixedFieldExternal): Keeps information about imported fixed
12889         buffer.
12890         (IFixedField): Make access to internal or external fixed buffer
12891         same.
12892
12893         * cs-parser.jay: Add fixed buffer parsing.
12894
12895         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12896         buffer.
12897
12898         * expression.cs (Indirection): Extended implementation to accept
12899         fixed buffer field.
12900         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12901         (ElementAccess.MakePointerAccess): Get type as parameter.
12902         (DoResolve): Add fixed buffer field expression conversion.
12903         (DoResolveLValue): Ditto.
12904         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12905         (ArrayPtr): Derives from FixedBufferPtr.
12906         (ArrayPtr.Emit): Add extra emit for array elements.
12907
12908         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12909
12910         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12911         for compiler generated types.
12912         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12913
12914         * statement.cs (Fixed): Refactored to be easier add fixed buffer
12915         and consume less memory.
12916         (Fixed.Resolve): Add fixed buffer case.
12917
12918         * typemanager.cs (compiler_generated_attr_ctor,
12919         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12920         (HasElementType): Add our own implementation to work on every
12921         runtime.
12922
12923 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12924
12925         * anonymous.cs (CaptureContext): Track whether `this' has been
12926         referenced.   
12927
12928         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
12929         only captured `this' if it was implicitly done (instance
12930         methods/variables were used). 
12931
12932         * codegen.cs (EmitContext.CaptureThis): New method to flag that
12933         `this' must be captured.
12934
12935 2005-01-30  Miguel de Icaza  <miguel@novell.com>
12936  
12937         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12938         is null it means that there has been no need to capture anything,
12939         so we just create a sibling.
12940
12941         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12942
12943         Just a partial fix.  The other half is fairly elusive.
12944         
12945 2005-02-10  Raja R Harinath  <rharinath@novell.com>
12946
12947         Fix #52586, cs0121-4.cs.
12948         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
12949         and return a hashtable.
12950         (MemberCache.ClearDeclaredOnly): New.
12951         (MemberCache.MemberCache): Update to change.  Make a deep copy of
12952         the method_hash of a base type too.
12953         (MemberCache.AddMethods): Adapt to having a deep copy of the base
12954         type methods.  Overwrite entries with the same MethodHandle so
12955         that the ReflectedType is correct.  The process leaves in base
12956         virtual functions and their overrides as distinct entries.
12957         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
12958         matters since it was boxed in a ArrayList before.
12959         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12960         modifier.
12961         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
12962         case of a virtual function and its override (choose the overload
12963         as better).
12964         (Invocation.OverloadResolve): Avoid 'override' members during
12965         'applicable_type' calculation.
12966
12967 2005-02-09  Raja R Harinath  <rharinath@novell.com>
12968
12969         Combine two near-redundant caches.
12970         * typemanager.cs (method_params): Rename from method_internal_params.
12971         (TypeManager.GetParameterData): New.  Replace
12972         Invocation.GetParameterData.
12973         (TypeManager.LookupParametersByBuilder): Remove.
12974         * expression.cs (Invocation.method_parameter_cache): Remove.
12975         (Invocation.GetParameterData): Remove.
12976         Update to changes.
12977         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12978         Update to changes.
12979
12980 2005-02-08  Raja R Harinath  <rharinath@novell.com>
12981
12982         Fix #72015.
12983         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12984         TypeManager.multicast_delegate_type is null, resolve it by looking
12985         up "System.MulticastDelegate".
12986         * rootcontext.cs (RootContext.ResolveCore): Simplify.
12987
12988 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
12989             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
12990             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
12991
12992         Fix cs0164.cs.
12993         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12994         (LabeledStatement.AddReference): New.  Set 'referenced'.
12995         (Goto.Resolve): Use it.
12996
12997 2005-02-05  John Luke  <john.luke@gmail.com>
12998
12999         * driver.cs: remove duplicate -doc line in Usage ()
13000
13001 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13002
13003         * location.cs (Location.AddFile): Fix CS2002 error report.
13004
13005 2005-02-02  Martin Baulig  <martin@ximian.com>
13006
13007         * delegate.cs (Delegate.DefineType): Report an internal error if
13008         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13009         details.        
13010
13011 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13012
13013         Fix a crasher in a variant of #31984.
13014         * const.cs (Constant.CheckBase): New override that defers the
13015         new-or-override check in case the base type hasn't been populated
13016         yet.
13017         (Constant.Define): Ensure the new-or-override check is performed.
13018
13019 2005-02-01  Duncan Mak  <duncan@ximian.com>
13020
13021         * const.cs (LookupConstantValue): Check that `ce' is not null
13022         before calling GetValue ().
13023
13024 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13025
13026         Fix test-334.cs (#69519).
13027         * cs-parser.jay (using_alias_directive): Pass in an expression to
13028         NamespaceEntry.UsingAlias.
13029         (using_namespace_directive): Pass in an expression to
13030         NamespaceEntry.Using.
13031         (namespace_name): Don't flatten to a string.
13032         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13033         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13034         ResolveAsTypeStep.
13035         (NamespaceEntry.UsingEntry): Likewise.
13036         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13037         changes.
13038         (NamespaceEntry.LookupForUsing): Remove.
13039         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13040         names.
13041         (NamespaceEntry.Lookup): Remove support for dotted names.
13042
13043 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13044
13045         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13046         split into two.
13047         (NamespaceEntry.ImplicitParent): Compute on demand.
13048         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13049         parallels the current.
13050         (NamespaceEntry.LookupForUsing): Use it.
13051         (NamespaceEntry.Lookup): If the current namespace-entry is
13052         implicit, don't search aliases and using tables.
13053
13054 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13055
13056         Fix #31984.
13057         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13058         BaseCache here.
13059         (TypeContainer.BaseCache): Compute on demand.
13060         (TypeContainer.FindMembers): Define constants and types if they're
13061         not already created.
13062         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13063         check.
13064         * const.cs (Constant.Define): Make idempotent.
13065
13066 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13067
13068         * pending.cs: Produce better code (no nops produced by using Ldarg
13069         + value).
13070         
13071         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13072         i - 1' it should be arg + 1.
13073
13074         Fixes bug #71819.
13075
13076 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13077
13078         * attribute.cs (Attribute.CheckAttributeType): Make private
13079         non-virtual.
13080         (Attribute.ResolveType): Make virtual.
13081         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13082         handling of RootContext.Tree.Types.
13083
13084 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13085
13086         Update attribute-handling to use the SimpleName/MemberAccess
13087         mechanisms.
13088         * cs-parser.jay (attribute): Pass in an expression to the
13089         constructors of Attribute and GlobalAttribute.
13090         * attribute.cs (Attribute): Take an expression for the name.
13091         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13092         passed in attribute name expression.
13093         (Attribute.CheckAttributeType): Use it.
13094         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13095         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13096         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13097         argument to prevent error messages if the lookup fails.
13098
13099 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13100
13101         * expression.cs (Indirection): Implemented IVariable interface
13102         to support indirection in AddressOf operator.
13103         (PointerArithmetic.Emit): Add optimalization for case where
13104         result can be precomputed.
13105
13106 2005-01-26  Martin Baulig  <martin@ximian.com>
13107
13108         * class.cs (TypeContainer.AttributeTargets): Return the correct
13109         AttributeTargets depending on our `Kind' instead of throwing an
13110         exception; fixes #71632.
13111
13112 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13113
13114         Fix #71257
13115         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13116         constant members.
13117
13118 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13119
13120         Fix #71602.
13121         * expression.cs (MemberAccess.DoResolve): Don't complain with
13122         cs0572 when the LHS of a member access has identical name and type
13123         name.
13124
13125 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13126
13127         Fix #71651, #71675
13128         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13129         CreatePermission.
13130         Create custom PermissionSet only for PermissionSetAttribute.
13131
13132 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13133
13134         Fix #71649
13135         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13136         delegates in static class.
13137
13138 2005-01-24  Martin Baulig  <martin@ximian.com>
13139
13140         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13141         merging an implicit block, just use its reachability.
13142
13143         * statement.cs (Block.Resolve): Make the unreachable code check
13144         work wrt. implicit blocks; see test-337 from #63842.
13145
13146 2005-01-21  Alp Toker  <alp@atoker.com>
13147  
13148         * cs-parser.jay: destructor_declaration's container is PartialContainer
13149         not Class when partial types are used, so use Kind prop instead of
13150         'is'.
13151         
13152 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13153
13154         * cs-parser.jay: Improve error reporting when an interface
13155         declares new types.
13156
13157 2005-01-20  Dick Porter  <dick@ximian.com>
13158
13159         * support.cs: SeekableStreamReader fix from Sandor Dobos
13160         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13161         chars are read.  Fixes bug 70369.
13162
13163 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13164
13165         * cs-parser.jay (catch_clause): Simplify current_block handling
13166         somewhat.
13167
13168 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13169
13170         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13171         code with ImplicitStandardConversion to handle the implicit
13172         conversion of method groups into valid delegate invocations. 
13173
13174         The problem is that in parameter handling we were using this code
13175         path.  Fixes bug #64698
13176
13177 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13178
13179         * cs-parser.jay: Fix several infelicities.
13180         - Avoid assigning to the parser value stack.  Code like 
13181           '$3 = null' is unclean.  Synthesize a value for the code block
13182           instead. 
13183         - Avoid using oob_stack for storing location information.  Use ...
13184         (_mark_): ... this.  New (empty) rule.  Saves the current location
13185         in $$.
13186         (foreach_statement): Avoid using oob_stack for current_block
13187         handling.  Use technique used in for_statement and
13188         using_statement.  Synthesize a value for the code block to store
13189         additional intermediate information.
13190
13191 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13194         of a different type is only allowed to private fields of a
13195         containing type, not on fields of a base class.
13196
13197         See test-174.cs and error cs0122-9.cs
13198
13199 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13200
13201         Fix test-335.cs (bug #58126).
13202         * cs-parser.jay (argument): Split out non-expression parts of the
13203         rule into 'non_simple_argument'.
13204         (invocation_expression): Support parenthesized invocations with
13205         multiple arguments, and with single non-simple arguments.
13206
13207 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13208
13209         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13210         places.
13211
13212 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13213
13214         Fix cs0038-1.cs, cs1640-6.cs.
13215         * ecore.cs (Expression.Resolve): Remove special-case for
13216         SimpleName in error-handling.
13217         (Expression.almostMatchedMembers): Relax access permission to
13218         protected.
13219         (Expression.MemberLookupFailed): Handle duplicates in
13220         almostMatchedMembers list.
13221         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13222         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13223         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13224         overload if the passed in MemberInfo is a MethodBase.
13225
13226 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13227
13228         Fix #70749
13229         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13230         for non-CAS & merge permission sets properly.
13231
13232 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13233
13234         Improve standard-compliance of simple name and member access 
13235         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13236         * ecore.cs (FullNamedExpression): New abstract base class 
13237         for Namespaces and TypeExpressions.
13238         (ResolveFlags.SimpleName): Remove.
13239         (SimpleName): Remove support for dotted names.
13240         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
13241         DeclSpace.FindType and DeclSpace.LookupType.
13242         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13243         (Expression.ExprClassName): Make member function.
13244         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13245         a namespace.  Remove creation of dotted "SimpleName"s.
13246         (MemberAccess.DoResolve): Likewise.
13247         * decl.cs (DeclSpace.Cache): Make private.
13248         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13249         (DeclSpace.FindType): Update.
13250         (DeclSpace.LookupType): Move here from RootContext.  Return a 
13251         FullNamedExpression.
13252         * namespace.cs (Namespace): Derive from FullNamedExpression
13253         so that it can be part of expression resolution.
13254         (Namespace.Lookup): Return an FullNamedExpression.
13255         (NamespaceEntry.LookupAlias): Lookup aliases only in current
13256         namespace.
13257         * rootcontext.cs (NamespaceLookup): Remove.
13258         (LookupType): Move to DeclSpace.
13259         * attribute.cs (CheckAttributeType): Update.
13260         * doc.cs (FindDocumentedType): Remove allowAlias argument.
13261         (FindDocumentedTypeNonArray): Likewise.
13262
13263 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13264
13265         Fix cs0509.cs, cs1632.cs.
13266         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13267         is the same as IsInterface.
13268         (TypeContainer.GetClassBases): Likewise.
13269         * statement.cs (LabeledStatement.ig): New field.
13270         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13271         label.
13272         (LabeledStatement.DoEmit): Check that the label was created with
13273         the same ILGenerator.
13274
13275 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13276
13277         Fix #71058
13278         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13279         accessors to its properties.
13280
13281         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13282         from accessors to property.
13283         
13284 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13285
13286         Fix #70722
13287         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13288         only for overrides.
13289         
13290 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13291
13292         * attribute.cs: Check for null and empty strings.  
13293
13294         I have lost another battle to Paolo.
13295
13296 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13297
13298         Fix #70942
13299         * class.cs (PropertyMethod): Set Parent field in ctors.
13300         (SetMethod.InternalParameters): Add unsafe switch hack.
13301         Override MarkForDuplicationCheck where it is appropriate.
13302
13303         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13304         It says whether container allows members with the same name.
13305         Base default is no.
13306         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13307         Removed is_method parameter.
13308
13309 2005-01-06  Duncan Mak  <duncan@ximian.com>
13310
13311         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13312         because the previous change led to incorrect reporting of CS1032
13313         ("Cannot define/undefine preprocessor symbols after first token in
13314         file"). Instead of using `tokens_seen' as the only flag that
13315         triggers CS1040, introduce `comments_seen'. This new flag is used
13316         to signify having seen comments on the current line, so it is
13317         unset after a newline.
13318
13319 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13320
13321         * doc.cs : When searching for a type, find nested type too.
13322           This fixes bug #71040.
13323
13324 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13325
13326         * doc.cs :
13327           - Warn missing member comment on those classes which also does not
13328             have doc comments. Fixed bug #71041.
13329           - Don't warn missing doc comment on default constructor.
13330             Fixed bug #71042.
13331
13332 2005-01-06  Duncan Mak  <duncan@ximian.com>
13333
13334         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13335         comments, set `tokens_seen' to true. This allows us to detect
13336         misplaced preprocessor directives (i.e. not at the beginning of
13337         the a line, nor after whitespaces). In that case, report error
13338         CS1040. This fixes bug #56460.
13339
13340         * cs-parser.jay (interface_member_declaration): Add checks for
13341         IsExplicitImpl, and report CS0541 error if an interface member is
13342         defined as an explicit interface declaration.
13343
13344 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13345
13346         Fix #70817
13347         * class.cs (PropertyMethod): Set Parent field in ctors.
13348         (SetMethod.InternalParameters): Add unsafe switch hack.
13349         
13350         * decl.cs (MemberCore.Parent): Cannot be readonly.
13351
13352 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13353
13354         * decl.cs (DeclSpace.ResolveType): Remove.
13355         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13356         Merge in code from ...
13357         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13358         * class.cs, enum.cs: Update to changes.
13359
13360 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * anonymous.cs: Ensure that we init the scope of our parent if it
13363         has not been initialized yet.
13364
13365 2004-12-30  Duncan Mak  <duncan@ximian.com>
13366
13367         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13368         if field.FieldBuilder is null. Fixes #70758.
13369
13370         * convert.cs: Fixed some typos and updated some of the comments.
13371         (ImplicitStandardConversionExists):
13372         (TryImplicitIntConversion): If `target_type' is an interface and
13373         the type of `ic' implements this interface, return true or a new
13374         BoxedCast instead of null. This fixes #70468.
13375
13376 2004-12-29  Duncan Mak  <duncan@ximian.com>
13377
13378         * expression.cs (Argument.Emit): Check that Expr is
13379         IMemoryLocation before casting to it, and report CS1510 otherwise.
13380
13381         This fixes #70402.
13382
13383 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
13384
13385         * statement.cs (Block.ThisVariable): remove the recursion here, to
13386         make the --profile more sane.
13387
13388 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
13389
13390         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13391         assembly, by JB Evain.
13392
13393 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13394
13395         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
13396           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13397         "parent" refers to enclosing type/class.  "base" refers to superclass.
13398
13399 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13400
13401         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13402         Ensure that we only have GlobalAttributes.
13403         * attribute.cs (Attribute.Emit): Make non-virtual.
13404         (GlobalAttribute.Emit): Remove.
13405         (Attribute.Resolve): Make virtual.
13406         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
13407         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13408         the argument. Don't create one.
13409         (Attribute.GetObsoleteAttribute): Likewise.
13410         (Attribute.GetClsCompliantAttributeValue): Likewise.
13411         * class.cs, decl.cs: Update to changes.
13412
13413 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
13414
13415         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13416         
13417         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13418         
13419         * statement.cs (Foreach.Resolve): Add error 186 report.
13420
13421 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
13422
13423         * expression.cs (Conditional.DoResolve): Add warning 429.
13424         
13425         * statement.cs (If.Resolve): Add warning 665.
13426
13427 2004-12-16  Raja R Harinath  <rharinath@novell.com>
13428
13429         New invariant: RootContext.Tree.Types.NamespaceEntry == null
13430         except when in the parser, and in GlobalAttribute.
13431         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13432         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13433         RootContext.Tree.Types.NamespaceEntry once work is done.
13434         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
13435         and resets RootContext.Tree.Types.NamespaceEntry.
13436
13437 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
13438
13439         * cs-parser.jay: Don't create a block for every variable.
13440
13441 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
13442
13443         * location.cs: Provide extra information.
13444
13445         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13446         variables from the captured environment, it is the ldarg_0.
13447
13448 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13449
13450         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13451         find a conclusion.
13452         
13453         * class.cs: Changed warning level for 169 to avoid developer
13454         displeasure from warning flooding. It will be changed back when they
13455         fix most of current BCL warnings.
13456         
13457         * RootContext.cs: Pushed default WarningLevel to 3.
13458         
13459         * statement.cs: Removed unused variable.
13460
13461 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13462
13463         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13464         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13465         Add error 502 report.
13466         (StaticClass.DefineType): Add error 441 report.
13467         (Class.AllowedModifiersProp): New virtual property as temporary
13468         extension to AllowedModifiers.
13469         (Class.DefineType): Add error 418 report. Moved ModFlags check here
13470         to share implementation with StaticClass and don't call virtual
13471         methods from ctor.
13472         
13473         * driver.cs (MainDriver): Add error 1558 test.
13474
13475         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13476         report. Moved error 36 test here.
13477
13478         * statement.cs (Throw.Resolve): Add error 724 report.
13479
13480         * typemanager.cs: Add out_attribute_type core type.
13481         
13482 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
13483
13484         * class.cs (TypeContainer.VerifyClsCompliance): Add error
13485         3018 report.
13486         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13487
13488         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13489         3017 report.
13490         
13491         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13492
13493         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
13494         Add error 3023 report.
13495         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13496
13497         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13498         implementation.
13499
13500 2004-12-12  John Luke  <john.luke@gmail.com>
13501
13502         * driver.cs (AddArgs): take -- into account when
13503         adding arguments, fixes bug 65710 
13504
13505 2004-12-12  Martin Baulig  <martin@ximian.com>
13506
13507         * expression.cs (Unary.TryReduceNegative): Added support for
13508         SByteConstant and ByteConstant.
13509         (Unary.Reduce): Check error values from TryReduceNegative().
13510
13511 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13512
13513         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13514         and report exception as error 182.
13515
13516 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13517
13518         * driver.cs (Main): Fix message when there are warnings.
13519
13520 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13521
13522         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13523
13524 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13525
13526         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13527         Reduced number of warnings.
13528         
13529         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13530
13531 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * driver.cs: Removed message.
13534
13535         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13536
13537 2004-12-08    <vargaz@freemail.hu>
13538
13539         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13540
13541 2004-12-08  Martin Baulig  <martin@ximian.com>
13542
13543         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13544         instead of a CS3002 for properties and indexer.
13545
13546 2004-12-08  Martin Baulig  <martin@ximian.com>
13547
13548         * decl.cs (MemberName.ToString): Make this work again.
13549
13550 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13551
13552         * attribute.cs (Resolve): Add error 591 detection.
13553
13554         * class.cs (FieldMember.Define): Add error 1547 detection.
13555         (Indexer.Define): Add error 620 detection.
13556         (Operator.Define): Add error 590 detection.
13557
13558         * ecore.cs: Missing argument for error 79.
13559
13560         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13561         detection.
13562
13563 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13564
13565         Fix #70106
13566         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13567         only.
13568
13569 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13570
13571         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13572           Some operator comments were suppressed.
13573         * doc.cs : Implicit/explicit operator name in doc comments are like
13574           "op_Explicit(type)~returnType", so added suffix handling.
13575
13576 2004-12-07  Martin Baulig  <martin@ximian.com>
13577
13578         * decl.cs
13579         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13580         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13581         (DeclSpace.ec): New protected field; store the EmitContext here.
13582         (DeclSpace.EmitContext): New public property; moved here from
13583         `TypeContainer'.
13584         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13585         EmitContext.
13586
13587         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13588         (Enum.Emit): Don't create a new EmitContext.
13589
13590         * delegate.cs (Delegate.DefineType): Always create the
13591         EmitContext.
13592
13593         * iterators.cs (Iterators.DefineIterator): Create a new
13594         EmitContext and store it in `ec'.
13595
13596 2004-08-24  Martin Baulig  <martin@ximian.com>
13597
13598         * typemanager.cs
13599         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13600         this for accessibility checks.
13601         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13602         IsNestedFamilyAccessible.
13603         (TypeManager.IsSubclassOf): New method, do what the name actually
13604         says.   
13605
13606 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13607
13608         Fix crash on cs0657-17.cs.
13609         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13610         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13611         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13612         the case where the NamespaceEntry gets overwritten.
13613
13614 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13615
13616         Fixed #69195, #56821
13617         * ecore.cs (ResolveBoolean): Tiny refactoring.
13618
13619         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13620         of right expression resolving when left is false constant and
13621         operator is LogicalAnd OR true constant and operator is LogicalOr.
13622
13623         * statement.cs (ResolveUnreachable): Always reports warning.
13624
13625 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13626
13627         * class.cs: Distinguish between 1721 and 1722 (just a little help
13628         for the programmer).
13629
13630 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13631
13632         * delegate.cs: Only allow this on new versions of the language. 
13633
13634 2004-12-02  Duncan Mak  <duncan@ximian.com>
13635
13636         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13637         Expression class.
13638         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13639         here as a static method. Take an additional bool out parameter
13640         `must_do_cs1540_check' for signaling to InstanceResolve.
13641         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13642         member field from PropertyExpr class and made it an argument of
13643         the method instead.
13644         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13645         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13646         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13647         and `remove_accessor' as well as InstanceResolve: report CS0122
13648         where applicable.
13649
13650         Fixes #70129.
13651
13652 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13653
13654         Fix test-327.cs, test-328.cs, and put in early infrastructure
13655         for eventually fixing #52697.
13656         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13657         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13658         from other methods.
13659         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13660         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13661         (VerifyUsing, error246): Update.
13662         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13663         'NamespaceEntry.LookupNamespaceOrType'.
13664
13665 2004-12-03  Martin Baulig  <martin@ximian.com>
13666
13667         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13668         method as our child, call AnonymousMethod.Compatible() on it.
13669
13670 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13671
13672         Disable XML documentation support in 'basic' profile.
13673         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13674         Redirect XmlElement to System.Object.
13675         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13676         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13677         * mcs.exe.sources: Add doc-bootstrap.cs.
13678         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13679         of doc.cs.
13680
13681 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13682
13683         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13684           comments are allowed.
13685
13686 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13687
13688         * delegate.cs: Add checks for subtypes in paramaters and return values
13689         in VerifyMethod () to add support for Covariance/Contravariance
13690         in delegates.
13691         
13692 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * report.cs: Remove extra closing parenthesis.
13695
13696         * convert.cs (Error_CannotImplicitConversion): If the name of the
13697         types are the same, provide some extra information.
13698
13699         * class.cs (FieldBase): Use an unused bit field from the field to
13700         encode the `has_offset' property from the FieldMember.  This saves
13701         a couple of Ks on bootstrap compilation.
13702
13703         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13704         method as our child, return the AnonymousMethod resolved
13705         expression.
13706
13707         * expression.cs (New.DoResolve): Allow return values from
13708         NewDelegate to also include AnonymousMethods.
13709
13710         Fixes #70150.
13711
13712 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13713
13714         Fix bug #70102
13715         * attribute.cs (Resolve): Improved implementation of params
13716         attribute arguments.
13717
13718         * support.cs (ParameterData): Add HasParams to be faster.
13719
13720 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13721
13722         all things are for /doc support:
13723
13724         * doc.cs: new file that supports XML documentation generation.
13725         * mcs.exe.sources: added doc.cs.
13726         * driver.cs:
13727           Handle /doc command line option.
13728           Report error 2006 instead of 5 for missing file name for /doc.
13729           Generate XML documentation when required, after type resolution.
13730         * cs-tokenizer.cs:
13731           Added support for picking up documentation (/// and /** ... */),
13732           including a new XmlCommentState enumeration.
13733         * cs-parser.jay:
13734           Added lines to fill Documentation element for field, constant,
13735           property, indexer, method, constructor, destructor, operator, event
13736           and class, struct, interface, delegate, enum.
13737           Added lines to warn incorrect comment.
13738         * rootcontext.cs :
13739           Added Documentation field (passed only when /doc was specified).
13740         * decl.cs:
13741           Added DocComment, DocCommentHeader, GenerateDocComment() and
13742           OnGenerateDocComment() and some supporting private members for
13743           /doc feature to MemberCore.
13744         * class.cs:
13745           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13746         * delegate.cs:
13747           Added overriden DocCommentHeader.
13748         * enum.cs:
13749           Added overriden DocCommentHeader and GenerateDocComment().
13750
13751 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13752
13753         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13754         unwrapping the enumeration values, chain to
13755         DoConstantNumericPromotions again, so we can promote things to the
13756         fundamental types (takes care of enums that are bytes, sbytes).
13757
13758         Fixes bug #62054.
13759
13760 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13761
13762         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13763         Fix long-standing bug in type-lookup.  Use FindType instead of
13764         LookupType when ec.ResolvingTypeTree.
13765         (Attribute.ResolveType, Attribute.Resolve)
13766         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13767         Update to changes.
13768         (Attributes.Search): Remove internal version.  Update.
13769         (Attributes.SearchMulti): Update.
13770         (Attributes.GetClsCompliantAttribute): Remove.
13771         (Attributes.GetIndexerNameAttribute): Remove.
13772         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13773         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13774         * class.cs (Indexer.Define): Likewise.
13775
13776 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13777
13778         Fix bug #68790
13779         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13780         MarshallByReference members access.
13781
13782         * expression.cs: Use CheckMarshallByRefAccess;
13783         Better error CS0197 message.
13784
13785         * report.cs: Print whole related error message.
13786
13787 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13788
13789         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13790         the current directory to help debugging.
13791
13792 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13793
13794         * class (GetClassBases): Better error 60 report.
13795         (EventProperty): Disabled warning 67 detection.
13796
13797 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13798
13799         Fix bug #60324
13800         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13801
13802         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13803         precise values.
13804
13805 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13806
13807         Fix bug #49488
13808         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13809
13810         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13811
13812 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13813
13814         * attribute.cs (Attribute.Resolve): Refine error reporting and
13815         report a cs0117 if the identifier does not exist, to distinguish
13816         from 0617 which is a miss-use of the actual identifier.
13817
13818         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13819         between cs0070 and cs0079.
13820
13821         * class.cs (MemberBase.DoDefine): When reporting a wrong
13822         accessibility level, we use MethodCore to compare instead of
13823         Method (this was a regression in some refactoring effort).
13824
13825         So now we correctly report cs0056 again.
13826
13827         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13828         testing the target_type (which was known to be object_type) and
13829         not the source type (which is anonymous_method).
13830
13831         Fixed reporting of error cs1660.
13832
13833         * expression.cs (UserCast.Source): Expose the underlying cast.
13834
13835         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13836         allowed types to find a match to int32 first (most common).
13837
13838         In addition, it ignores any ImplicitUserConversions that did an
13839         internal implicit conversion (as the switch statement allows only
13840         one integral conversion to exist).
13841
13842         * class.cs (PartialContainer.Create): rename `name' to
13843         `member_name' for clarity.  Then replace the string calls with a
13844         call to MemberName.GetPartialName, as now using
13845         MemberName.ToString is an error (this is due to the side effects
13846         it had, that were fixed in the past).
13847
13848         This will restore the error reporting on a number of partial class
13849         errors that were missusing this (and getting an exception as a
13850         results, which is now just a plain textual warning, because
13851         yyparse debug output would crash otherwise).
13852
13853 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13854
13855         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13856
13857 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13858
13859         * rootcontext.cs (LookupType): Make sure to cache lookups that
13860         don't give us a negative result. This saves about 5% of corlib
13861         compilation time.
13862
13863 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13864
13865         * report.cs (AbstractMessage.Print): messages are sent to stderr
13866
13867         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13868         non-interface in the list of interfaces (at this point, either
13869         parent was properly set, or a base class is being listed in the
13870         interfaces section).
13871
13872         This flags error 1722, and resolves the crash from bug 69259.
13873
13874 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13875
13876         * statement.cs (Using.EmitExpressionFinally): make this work right
13877         for valuetypes. Fixes 69926.
13878
13879 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13882         converted to an enum" here, before we try to change the underlying
13883         type.  This code exists, but it is a different code path than the
13884         one used while encoding constants.
13885
13886         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13887         old bug: when converting from the null literal to a pointer,
13888         return an EmptyCast, not the NullLiteral.
13889
13890         This fixes #69921, the recent null_type changes probably made this
13891         bug more prominent.
13892
13893         (ImplicitReferenceConversionExists): In addition, resynchronized
13894         the code here, so it matches the same code in
13895         ImplicitReferenceConversionExists for the `from any class-type S
13896         to any interface-type T'.
13897         
13898
13899 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13900
13901         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13902
13903 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13904
13905         * cs-parser.jay: Use verbosity accordingly. 
13906
13907 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13908
13909         * expression.cs (Unary.ResolveOperator): Do not report warning;
13910         AddressOf reads from variable.
13911         
13912         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13913
13914 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13915
13916         Fix bug #69462
13917
13918         * attribute.cs (Attributable): Removed CheckTargets.
13919         (Attributes.Emit): Explicit attribute targets are tested here.
13920
13921         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13922         not enabled for interfaces.
13923
13924         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13925         (GetAssemblyName): Ouch next bug there.
13926
13927 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13928
13929         * expression.cs: Error 275 added.
13930         
13931 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
13932
13933         Fix bug #69177 (Implemented decimal constant support)
13934
13935         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13936         (BinaryFold): Add DecimalConstant.
13937
13938         * const.cs (Define): Decimal constant 
13939         (is not constant.
13940         (ChangeType): Add decimal type handling.
13941         (LookupConstantValue): Don't set value for decimal type but
13942         emit DecimalConstantAttribute. Needed for constant optimization.
13943
13944         * constant.cs (ToDecimal): New method.
13945         (ConvertToDecimal): New method.
13946         (IntConstant): Implemented ConvertToDecimal.
13947         (DecimalConstant.Emit): Emit optimized version for decimals in
13948         int range.
13949
13950         * expression.cs (ResolveOperator): Changed order of constant
13951         reduction to work correctly with native types which have
13952         overloaded operators.
13953         (ResolveMemberAccess): Extract constant value from attribute
13954         for decimal type.
13955
13956         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13957
13958         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13959         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13960         (ChangeType): Decimal is special.
13961         (TypeToCoreType): Add decimal type.
13962
13963 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13964
13965         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13966         decimal types.
13967
13968 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13969
13970         * class.cs (EventField.ApplyAttributeBuilder): Fix error
13971         test cs1667-5.cs.
13972
13973 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13974
13975         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13976
13977         * pending.cs (PendingImplementation): Grab only interfaces.
13978
13979 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13980
13981         * statement.cs (ForeachHelperMethods): Add location member and
13982         error 202 detection.
13983
13984 2004-11-19  Raja R Harinath  <rharinath@novell.com>
13985
13986         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
13987         automatically handled by executable.make.
13988         (PROGRAM): Make profile-specific.
13989
13990 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
13991
13992         * expression.cs (DoResolveBase): Fixed wrong warning for out
13993         variables.
13994
13995 2004-11-18  Martin Baulig  <martin@ximian.com>
13996
13997         Merged latest changes into gmcs.  Please keep this comment in
13998         here, it makes it easier for me to see what changed in MCS since
13999         the last time I merged.
14000
14001 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14002
14003         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14004         (TypeHandle.GetMemberCache): New.
14005         (TypeHandle.TypeHandle): Update.
14006         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14007         (TypeManager.LookupParentInterfacesCache):
14008         Rename from LookupInterfaceCache.  Optimize slightly.
14009         (TypeManager.MemberLookup_FindMembers): Update.
14010         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14011         multi-type variant.
14012         (AddCacheContents): Rename from AddHashtable.
14013         * class.cs (TypeContainer.parent_container): Remove.
14014         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14015         (TypeContainer.DoDefineMembers): Don't initialize it.
14016         Update to name changes.
14017         
14018 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14019
14020         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14021         that factors the code to check access modifiers on override.  
14022
14023         (PropertyBase): Use the code here.
14024
14025         Patch from Lluis S'anchez, fixes bug #69361.
14026
14027 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14028
14029         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14030         routine that is used to report the use of a captured variable
14031         whose address has been taken.
14032
14033         There are two checks: one when variables are being captured and
14034         the other check is when the address of a variable is taken. 
14035         
14036         (because an anonymous methods might be resolved before *or* after
14037         the address has been taken) and 
14038
14039         * expression.cs (Conditional.DoResolve): Remove the special
14040         casing that Martin added to trueExpr and falseExpr being both
14041         NullLiteral.  We get the right behavior now just by introducing
14042         the null_type into the compiler. 
14043
14044         * convert.cs (ExplicitConversion): Change the code to use
14045         null_type instead of testing `expr is NullLiteral'.
14046         (ImplicitConversionStandard): use null_type too.
14047         (ImplicitReferenceConversionExists): use null_type too.
14048         (ImplicitReferenceConversion): use null_type too.
14049
14050         * literal.cs: The type of `NullLiteral' is now null_type instead
14051         of object_type. 
14052         (Resolve): Set the type here.
14053
14054         * typemanager.cs: Introduce null_type.
14055
14056 2004-11-17  Martin Baulig  <martin@ximian.com>
14057
14058         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14059         direction, like FindMembers() does.  Fixes #69546, testcase is in
14060         test-315.cs.    
14061
14062 2004-11-16  Martin Baulig  <martin@ximian.com>
14063
14064         This is based on a patch from Marek Safar, see bug #69082.
14065         Fixes bugs #63705 and #67130.
14066
14067         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14068         method; create a MemberCache for an interface type and cache the
14069         result.
14070
14071         * decl.cs (IMemberContainer.ParentContainer): Removed.
14072         (IMemberContainer.ParentCache): New property.
14073         (MemberCache.SetupCacheForInterface): Removed.
14074         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14075         to create a cache for an interface's "parent".
14076
14077         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14078         interfaces too.
14079
14080 2004-11-16  Martin Baulig  <martin@ximian.com>
14081
14082         Merged back from gmcs; these changes already went into gmcs a
14083         couple of weeks ago.
14084
14085         * typemanager.cs
14086         (TypeManager.AddUserType): Removed the `ifaces' argument.
14087         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14088         `TypeExpr []'.
14089         (TypeManager.AddUserInterface): Removed.
14090         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14091         `TypeExpr []'.
14092         (TypeManager.GetInterfaces): Likewise.
14093         (TypeManager.GetExplicitInterfaces): Likewise.
14094
14095         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14096
14097         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14098         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14099
14100 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14101
14102         * statement.cs: Avoid adding bools to a hashtable.
14103
14104 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14105
14106         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14107         calling an unsafe method from a safe location.
14108
14109 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14110
14111         Fix #69167
14112         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14113
14114 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14115
14116         * namespace.cs (VerifyUsing): use GetPartialName instead of
14117         ToString. 
14118
14119 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * statement.cs (Return.Resolve): Fix regression in typo: if
14122         `in_exc', we have to request a NeedReturnLabel, this was a typo
14123         introduced in the anonymous method check-in.  Fixes #69131.
14124
14125         * Indexers were using the ShortName when defining themselves,
14126         causing a regression in the compiler bootstrap when applying the
14127         patch from 2004-11-02 (first part), now they use their full name
14128         and the bug is gone.
14129
14130 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14131
14132         * driver.cs: Strip the path from the names of embedded resources. Fixes
14133         #68519.
14134
14135 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14136
14137         Fix error message regression: cs0104-2.cs.
14138         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14139         (AliasEntry.Resolve): Update.
14140         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14141         'silent' flag.
14142         (RootContext.LookupType): Update.
14143
14144 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14145
14146         * cs-parser.jay: Add support for handling accessor modifiers
14147         * class: Add support port accessor modifiers and error checking,
14148         define PropertyMethod.Define as virtual (not abstract anymore)
14149         * ecore.cs: Add checking for proeprties access with access modifiers
14150         * iterators.cs: Modify Accessor constructor call based in the modified
14151         constructor
14152 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14153
14154         * expression.cs (StringConcat): Handle being called twice,
14155         as when we have a concat in a field init with more than two
14156         ctors in the class
14157
14158 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14159
14160         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14161         special case explicit implementations, we should always produce
14162         the .property or .event declaration.
14163         
14164         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14165         since it will not return correct data if people use this
14166         unresolved in the presence of using statements (see test-313).
14167
14168         * class.cs (MethodData.Define): If we are an explicit interface
14169         implementation, set the method name to the full name of the
14170         interface plus the name of the method.  
14171
14172         Notice that using the method.MethodName.GetFullName() does not
14173         work, as it will only contain the name as declared on the source
14174         file (it can be a shorthand in the presence of using statements)
14175         and not the fully qualifed type name, for example:
14176
14177         using System;
14178
14179         class D : ICloneable {
14180                 object ICloneable.Clone ()  {
14181                 }
14182         }
14183
14184         Would produce a method called `ICloneable.Clone' instead of
14185         `System.ICloneable.Clone'.
14186
14187         * namespace.cs (Alias.Resolve): Use GetPartialName.
14188         
14189 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14190
14191         * cs-parser.jay: Add error 1055 report.
14192
14193 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14194
14195         * assign.cs (Assign.DoResolve): Only do the transform of
14196         assignment into a New if the types are compatible, if not, fall
14197         through and let the implicit code deal with the errors and with
14198         the necessary conversions. 
14199
14200 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14201
14202         * cs-parser.jay: Add error 1031 report.
14203
14204         * cs-tokenizer.cs: Add location for error 1038.
14205
14206 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14207
14208         * cs-parser.jay: Add error 1016 report.
14209
14210 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14211
14212         * cs-parser.jay: Add errors 1575,1611 report.
14213
14214 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14215
14216         * cs-parser.jay: Add error 1001 report.
14217
14218 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14219
14220         Fix #68850
14221         * attribute.cs (GetMarshal): Add method argument for
14222         caller identification.
14223
14224         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14225         agument for GetMarshal and RuntimeMissingSupport.
14226
14227 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14228
14229         * attribute.cs (ExtractSecurityPermissionSet): Removed
14230         TypeManager.code_access_permission_type.
14231
14232         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14233
14234 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14237         for obsolete use of a variable here.   Fixes regression on errors
14238         cs0619-25 and cs0619-26.
14239
14240 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
14241
14242         Fix #62358, implemented security attribute encoding.
14243
14244         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14245         Tests permitted SecurityAction for assembly or other types.
14246         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14247         data from SecurityPermissionAttribute to PermisionSet class.
14248
14249         * class.cs (ApplyAttributeBuilder): Added special handling
14250         for System.Security.Permissions.SecurityAttribute based types.
14251
14252         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14253         special handling for System.Security.Permissions.SecurityAttribute
14254         based types.
14255
14256         * enum.cs (ApplyAttributeBuilder): Added special handling
14257         for System.Security.Permissions.SecurityAttribute based types.
14258
14259         * parameter.cs (ApplyAttributeBuilder): Added special handling
14260         for System.Security.Permissions.SecurityAttribute based types.
14261
14262         * rootcontext.cs: Next 2 core types.
14263
14264         * typemanager.cs (TypeManager.security_permission_attr_type):
14265         Built in type for the SecurityPermission Attribute.
14266         (code_access_permission_type): Build in type.
14267
14268 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14269
14270         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14271         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14272         all of this information into
14273         EmitContext.EmitCapturedVariableInstance.
14274         
14275         * codegen.cs (EmitCapturedVariableInstance): move here the
14276         funcionality of emitting an ldarg.0 in the presence of a
14277         remapping.   This centralizes the instance emit code.
14278
14279         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14280         then emit a load of this: it means that we have reached the
14281         topmost ScopeInfo: the one that contains the pointer to the
14282         instance of the class hosting the anonymous method.
14283
14284         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14285         captures to the topmost CaptureContext.
14286
14287 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14288
14289         * expression.cs (LocalVariableReference): Move the knowledge about
14290         the iterators into codegen's EmitCapturedVariableInstance.
14291
14292 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14293
14294         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14295         all code paths return a value from an anonymous method (it is the
14296         same as the 161 error, but for anonymous methods).
14297
14298 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14299
14300         The introduction of anonymous methods in the compiler changed
14301         various ways of doing things in the compiler.  The most
14302         significant one is the hard split between the resolution phase
14303         and the emission phases of the compiler.
14304
14305         For instance, routines that referenced local variables no
14306         longer can safely create temporary variables during the
14307         resolution phase: they must do so from the emission phase,
14308         since the variable might have been "captured", hence access to
14309         it can not be done with the local-variable operations from the runtime.
14310         
14311         * statement.cs 
14312
14313         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14314         is a toplevel block.
14315
14316         (ToplevelBlock): A new kind of Block, these are the blocks that
14317         are created by the parser for all toplevel method bodies.  These
14318         include methods, accessors and anonymous methods.
14319
14320         These contain some extra information not found in regular blocks:
14321         A pointer to an optional CaptureContext (for tracking captured
14322         local variables and parameters).  A pointer to the parent
14323         ToplevelBlock.
14324         
14325         (Return.Resolve): Catch missmatches when returning a value from an
14326         anonymous method (error 1662).
14327         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14328         phase.
14329
14330         (Break.Resolve): ditto.
14331
14332         (SwitchLabel): instead of defining the labels during the
14333         resolution phase, we now turned the public ILLabel and ILLabelCode
14334         labels into methods called GetILLabelCode() and GetILLabel() that
14335         only define the label during the Emit phase.
14336
14337         (GotoCase): Track the SwitchLabel instead of the computed label
14338         (its contained therein).  Emit the code by using
14339         SwitchLabel.GetILLabelCode ().
14340
14341         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14342         whether the Local has been captured or not.
14343
14344         (LocalInfo.IsCaptured): New property, used to tell whether the
14345         local has been captured.
14346         
14347         * anonymous.cs: Vastly updated to contain the anonymous method
14348         support.
14349
14350         The main classes here are: CaptureContext which tracks any
14351         captured information for a toplevel block and ScopeInfo used to
14352         track the activation frames for various local variables.   
14353
14354         Each toplevel block has an optional capture context associated
14355         with it.  When a method contains an anonymous method both the
14356         toplevel method and the anonymous method will create a capture
14357         context.   When variables or parameters are captured, they are
14358         recorded on the CaptureContext that owns them, for example:
14359
14360         void Demo () {
14361              int a;
14362              MyDelegate d = delegate {
14363                  a = 1;
14364              }
14365         }
14366
14367         Here `a' will be recorded as captured on the toplevel
14368         CapturedContext, the inner captured context will not have anything
14369         (it will only have data if local variables or parameters from it
14370         are captured in a nested anonymous method.
14371
14372         The ScopeInfo is used to track the activation frames for local
14373         variables, for example:
14374
14375         for (int i = 0; i < 10; i++)
14376                 for (int j = 0; j < 10; j++){
14377                    MyDelegate d = delegate {
14378                         call (i, j);
14379                    }
14380                 }
14381
14382         At runtime this captures a single captured variable `i', but it
14383         captures 10 different versions of the variable `j'.  The variable
14384         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14385         recorded on a child.  
14386
14387         The toplevel ScopeInfo will also track information like the `this'
14388         pointer if instance variables were referenced (this is necessary
14389         as the anonymous method lives inside a nested class in the host
14390         type of the method). 
14391
14392         (AnonymousMethod): Expanded to track the Toplevel, implement
14393         `AnonymousMethod.Compatible' to tell whether an anonymous method
14394         can be converted to a target delegate type. 
14395
14396         The routine now also produces the anonymous method content
14397
14398         (AnonymousDelegate): A helper class that derives from
14399         DelegateCreation, this is used to generate the code necessary to
14400         produce the delegate for the anonymous method that was created. 
14401
14402         * assign.cs: API adjustments for new changes in
14403         Convert.ImplicitStandardConversionExists.
14404
14405         * class.cs: Adjustments to cope with the fact that now toplevel
14406         blocks are of type `ToplevelBlock'. 
14407
14408         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14409         insteda of standard blocks.
14410
14411         Flag errors if params arguments are passed to anonymous methods.
14412
14413         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14414         `CurrentAnonymousMethod' which points to the current Anonymous
14415         Method.  The variable points to the AnonymousMethod class that
14416         holds the code being compiled.  It is set in the new EmitContext
14417         created for the anonymous method.
14418
14419         (EmitContext.Phase): Introduce a variable and an enumeration to
14420         assist in enforcing some rules about when and where we are allowed
14421         to invoke certain methods (EmitContext.NeedsReturnLabel is the
14422         only one that enfonces this right now).
14423
14424         (EmitContext.HaveCaptureInfo): new helper method that returns
14425         whether we have a CapturedContext initialized.
14426
14427         (EmitContext.CaptureVariable): New method used to register that a
14428         LocalInfo must be flagged for capturing. 
14429
14430         (EmitContext.CapturedParameter): New method used to register that a
14431         parameters must be flagged for capturing. 
14432         
14433         (EmitContext.CapturedField): New method used to register that a
14434         field must be flagged for capturing. 
14435
14436         (EmitContext.HaveCapturedVariables,
14437         EmitContext.HaveCapturedFields): Return whether there are captured
14438         variables or fields. 
14439
14440         (EmitContext.EmitMethodHostInstance): This is used to emit the
14441         instance for the anonymous method.  The instance might be null
14442         (static methods), this (for anonymous methods that capture nothing
14443         and happen to live side-by-side with the current method body) or a
14444         more complicated expression if the method has a CaptureContext.
14445
14446         (EmitContext.EmitTopBlock): Routine that drives the emission of
14447         code: it will first resolve the top block, then emit any metadata
14448         and then emit the code.  The split is done so that we can extract
14449         any anonymous methods and flag any captured variables/parameters.
14450         
14451         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14452         during this phase, the ILGenerator should not be used as labels
14453         and local variables declared here might not be accessible to any
14454         code that is part of an anonymous method.  
14455
14456         Exceptions to this include the temporary variables that are
14457         created by some statements internally for holding temporary
14458         variables. 
14459         
14460         (EmitContext.EmitMeta): New routine, in charge of emitting all the
14461         metadata for a cb
14462
14463         (EmitContext.TemporaryReturn): This method is typically called
14464         from the Emit phase, and its the only place where we allow the
14465         ReturnLabel to be defined other than the EmitMeta.  The reason is
14466         that otherwise we would have to duplicate a lot of logic in the
14467         Resolve phases of various methods that today is on the Emit
14468         phase. 
14469
14470         (EmitContext.NeedReturnLabel): This no longer creates the label,
14471         as the ILGenerator is not valid during the resolve phase.
14472
14473         (EmitContext.EmitThis): Extended the knowledge in this class to
14474         work in anonymous methods in addition to iterators. 
14475
14476         (EmitContext.EmitCapturedVariableInstance): This emits whatever
14477         code is necessary on the stack to access the instance to a local
14478         variable (the variable will be accessed as a field).
14479
14480         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14481         EmitContext.EmitAddressOfParameter): Routines to support
14482         parameters (not completed at this point). 
14483         
14484         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
14485         will also remove the parameters.
14486
14487         * convert.cs (Convert): Define a `ConstantEC' which points to a
14488         null.  This is just to prefity some code that uses
14489         ImplicitStandardConversion code and do not have an EmitContext
14490         handy.
14491
14492         The idea is to flag explicitly that at that point in time, it is
14493         known that the conversion will not trigger the delegate checking
14494         code in implicit conversions (which requires a valid
14495         EmitContext). 
14496
14497         Everywhere: pass new EmitContext parameter since
14498         ImplicitStandardConversionExists now requires it to check for
14499         anonymous method conversions. 
14500
14501         (Convert.ImplicitStandardConversionExists): If the type of an
14502         expression is the anonymous_method_type, and the type is a
14503         delegate, we invoke the AnonymousMethod.Compatible method to check
14504         whether an implicit conversion is possible. 
14505
14506         (Convert.ImplicitConversionStandard): Only do implicit method
14507         group conversions if the language level is not ISO_1.
14508
14509         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14510         MethodInfo for the Invoke method.  used by Delegate and
14511         AnonymousDelegate.
14512
14513         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14514         method conversions if the target type is a delegate.
14515
14516         Removed extra debugging nops.
14517
14518         (LocalVariableReference): Turn the `local_info' into a public
14519         field. 
14520
14521         Add `prepared' field, the same hack used for FieldExprs to cope
14522         with composed assignments, as Local variables do not necessarily
14523         operate purely on the stack as they used to: they can be captured
14524         fields. 
14525
14526         Add `temp' for a temporary result, like fields.
14527
14528         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14529
14530         It now copes with Local variables that are captured and emits the
14531         proper instance variable to load it from a field in the captured
14532         case. 
14533
14534         (ParameterReference.DoResolveBase): During the resolve phase,
14535         capture parameters if we are in an anonymous method.
14536
14537         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14538         anonymous method, use the EmitContext helper routines to emit the
14539         parameter reference.
14540
14541         * iterators.cs: Set RemapToProxy to true/false during the
14542         EmitDispose class.
14543
14544         * parameters.cs (GetParameterByName): New helper method. 
14545
14546         * typemanager.cs (anonymous_method_type) a new type that
14547         represents an anonyous method.  This is always an internal type,
14548         used as a fencepost to test against the anonymous-methodness of an
14549         expression. 
14550         
14551 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14552
14553         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14554         561 report.
14555         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14556
14557 2004-10-18  Martin Baulig  <martin@ximian.com>
14558
14559         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14560         `Type' directly, but call ResolveType() on it.
14561         (Catch.Resolve): Likewise.
14562         (Foreach.Resolve): Likewise.
14563
14564 2004-10-18  Martin Baulig  <martin@ximian.com>
14565
14566         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14567         `Type' directly, but call ResolveType() on it.
14568         (Probe.DoResolve): Likewise.
14569         (ArrayCreation.LookupType): Likewise.
14570         (TypeOf.DoResolve): Likewise.
14571         (SizeOf.DoResolve): Likewise.
14572
14573 2004-10-18  Martin Baulig  <martin@ximian.com>
14574
14575         * expression.cs (Invocation.BetterFunction): Put back
14576         TypeManager.TypeToCoreType().
14577
14578 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14579
14580         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14581         the ResolveType.
14582
14583 2004-10-18  Martin Baulig  <martin@ximian.com>
14584
14585         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14586         `Type' directly, but call ResolveType() on it.
14587
14588 2004-10-18  Martin Baulig  <martin@ximian.com>
14589
14590         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14591         `Type' directly, but call ResolveType() on it.
14592         (MemberBase.DoDefine): Likewise.
14593
14594         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14595         `Type' directly, but call ResolveType() on it.
14596         (ComposedCast.DoResolveAsTypeStep): Likewise.
14597
14598         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14599         `Type' directly, but call ResolveType() on it.
14600
14601 2004-10-17  John Luke  <john.luke@gmail.com>
14602
14603         * class.cs (Operator.GetSignatureForError): use CSharpName
14604
14605         * parameter.cs (Parameter.GetSignatureForError): Returns
14606         correct name even if was not defined.
14607
14608 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14609
14610         Fix #65816.
14611         * class.cs (TypeContainer.EmitContext): New property.
14612         (DefineNestedTypes): Create an emitcontext for each part.
14613         (MethodCore.DoDefineParameters): Use container's emitcontext.
14614         Pass type array to InternalParameters.
14615         (MemberBase.DoDefine): Use container's emitcontext.
14616         (FieldMember.Define): Likewise.
14617         (Event.Define): Likewise.
14618         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14619         Pass type array to InternalParameters.
14620         (SetIndexerMethod.GetParameterInfo): Likewise.
14621         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14622         * delegate.cs (Define): Pass emitcontext to
14623         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14624         array to InternalParameters.
14625         * expression.cs (ParameterReference.DoResolveBase): Pass
14626         emitcontext to GetParameterInfo.
14627         (ComposedCast.DoResolveAsTypeStep): Remove check on
14628         ec.ResolvingTypeTree.
14629         * parameter.cs (Parameter.Resolve): Change argument to
14630         EmitContext.  Use ResolveAsTypeTerminal.
14631         (Parameter.GetSignature): Change argument to EmitContext.
14632         (Parameters.ComputeSignature): Likewise.
14633         (Parameters.ComputeParameterTypes): Likewise.
14634         (Parameters.GetParameterInfo): Likewise.
14635         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14636         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14637         * support.cs (InternalParameters..ctor): Remove variant that takes
14638         a DeclSpace.
14639         * typemanager.cs (system_intptr_expr): New.
14640         (InitExpressionTypes): Initialize it.
14641
14642 2004-10-12  Chris Toshok  <toshok@ximian.com>
14643
14644         * cs-parser.jay: fix location for try_statement and catch_clause.
14645
14646 2004-10-11  Martin Baulig  <martin@ximian.com>
14647
14648         * report.cs: Don't make --fatal abort on warnings, we have
14649         -warnaserror for that.
14650
14651 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14652
14653         More DeclSpace.ResolveType avoidance.
14654         * decl.cs (MemberCore.InUnsafe): New property.
14655         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14656         with newly created EmitContext.
14657         (FieldMember.Define): Likewise.
14658         * delegate.cs (Delegate.Define): Likewise.
14659         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14660         only if normal name-lookup fails.
14661         (TypeExpr.DoResolve): Enable error-checking.
14662         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14663         (SizeOf.DoResolve): Likewise.
14664         (ComposedCast.DoResolveAsTypeStep): Likewise.
14665         (StackAlloc.DoResolve): Likewise.
14666         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14667         (Block.Unsafe): New property.
14668         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14669         (Unsafe): Set 'unsafe' flag of contained block.
14670         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14671         (Fixed.Resolve): Likewise.
14672         (Catch.Resolve): Likewise.
14673         (Using.ResolveLocalVariableDecls): Likewise.
14674         (Foreach.Resolve): Likewise.
14675
14676 2004-10-05  John Luke <john.luke@gmail.com>
14677
14678         * cs-parser.jay: add location to error CS0175
14679
14680 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * ecore.cs (Expression.Constantity): Add support for turning null
14683         into a constant.
14684
14685         * const.cs (Const.Define): Allow constants to be reference types
14686         as long as the value is Null.
14687
14688 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14689
14690         * namespace.cs (NamespaceEntry.Using): No matter which warning
14691         level is set, check if this namespace name has already been added.
14692
14693 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14694
14695         * expression.cs: reftype [!=]= null should always use br[true,false].
14696         # 67410
14697
14698 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14699
14700         Fix #67108
14701         * attribute.cs: Enum conversion moved to 
14702         GetAttributeArgumentExpression to be applied to the all
14703         expressions.
14704
14705 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14706
14707         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14708         * class.c (TypeContainer.DefineType): Flag error if
14709         base types aren't accessible due to access permissions.
14710         * decl.cs (DeclSpace.ResolveType): Move logic to
14711         Expression.ResolveAsTypeTerminal.
14712         (DeclSpace.ResolveTypeExpr): Thin layer over
14713         Expression.ResolveAsTypeTerminal.
14714         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14715         Refactor code into NestedAccess.  Use it.
14716         (DeclSpace.NestedAccess): New.
14717         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14718         argument to silence errors.  Check access permissions.
14719         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14720         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14721         (Cast.DoResolve): Likewise.
14722         (New.DoResolve): Likewise.
14723         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14724         (TypeOf.DoResolve): Likewise.
14725
14726         * expression.cs (Invocation.BetterConversion): Return the Type of
14727         the better conversion.  Implement section 14.4.2.3 more faithfully.
14728         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14729         section 14.4.2.2 explicit.
14730         (Invocation.OverloadResolve): Update.
14731         (Invocation): Remove is_base field.
14732         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14733         (Invocation.Emit): Likewise.
14734
14735 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14736
14737         * README: Update to changes.
14738
14739 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14740
14741         * cs-parser.jay: Reverted 642 warning fix.
14742
14743 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14744
14745         Fix bug #66615
14746         * decl.cs (FindMemberWithSameName): Indexer can have more than
14747         1 argument.
14748
14749 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14750
14751         * expression.cs (LocalVariableReference.DoResolveLValue):
14752         Do not report warning 219 for out values.
14753         (EmptyExpression.Null): New member to avoid extra allocations.
14754
14755 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14756
14757         * cs-parser.jay: Fix wrong warning 642 report.
14758
14759         * cs-tokenizer.cs (CheckNextToken): New helper;
14760         Inspect next character if is same as expected.
14761
14762 2004-09-23  Martin Baulig  <martin@ximian.com>
14763
14764         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14765         (Convert.ImplicitReferenceConversionExists): Likewise.
14766
14767 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14768
14769         * class.cs (Operator.Define): Add error 448 and 559 report.
14770
14771 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14772
14773         * class.cs (MemberBase.IsTypePermitted): New protected
14774         method for checking error CS0610.
14775
14776 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14777
14778         * class.cs (TypeContainer.HasExplicitLayout): New property
14779         Returns whether container has StructLayout attribute set Explicit.
14780         (FieldMember): New abstract class for consts and fields.
14781         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14782         (Field): Reuse FieldMember.
14783
14784         * const.cs (Const): Reuse FieldMember.
14785
14786         * rootcontext.cs: EmitConstants call moved to class.
14787
14788 2004-09-22  Martin Baulig  <martin@ximian.com>
14789
14790         Thanks to Peter Sestoft for this bug report.
14791
14792         * expression.cs (Conditional): If both the `trueExpr' and the
14793         `falseExpr' is a NullLiteral, return a NullLiteral.
14794
14795 2004-09-22  Martin Baulig  <martin@ximian.com>
14796
14797         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14798         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14799         for the "get_Current" call.
14800
14801 2004-09-22  Martin Baulig  <martin@ximian.com>
14802
14803         Marek and me just fixed one of our oldest bugs: #28562 :-)
14804
14805         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14806
14807         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14808         we're an EnumConstant, just return that.
14809         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14810         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14811         to get the value which'll actually be written into the attribute.
14812         However, we have to use GetValue() to access the attribute's value
14813         in the compiler.        
14814
14815 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14816
14817         * constant.cs (Constant.IsNegative): New abstract property
14818         IsNegative.
14819
14820         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14821         (StackAlloc.DoResolve): Reused IsNegative.
14822
14823 2004-09-21  Martin Baulig  <martin@ximian.com>
14824
14825         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14826         if we're used in an iterator, we may be called from different
14827         methods.
14828
14829         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14830         we actually have an exception block.
14831
14832 2004-09-20  John Luke <jluke@cfl.rr.com>
14833
14834         * class.cs, cs-parser.jay: Improve the error report for 1520:
14835         report the actual line where the error happens, not where the
14836         class was declared.
14837
14838         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14839         Pass location information that was available elsewhere.
14840
14841 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14842
14843         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14844         runtime to delay sign assemblies.
14845
14846 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14847
14848         * cs-parser.jay: Do not report the stack trace, this is barely
14849         used nowadays.
14850
14851 2004-08-22  John Luke  <john.luke@gmail.com>
14852  
14853         * driver.cs : check that a resource id is not already used
14854         before adding it, report CS1508 if it is, bug #63637
14855
14856 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * ecore.cs: Removed dead code.
14859
14860 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14861
14862         * class.cs: Do not report warning CS0067 on the interfaces.
14863
14864 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14865
14866         * cs-parser.jay: Add error 504 report.
14867
14868 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14869
14870         * rootcontext.cs: WarningLevel is 4 by default now.
14871
14872         * statement.cs (Fixed.Resolve): Do not null
14873         VariableInfo.
14874
14875 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14876
14877         Fixed bug #55780
14878         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14879         deep search when property is not virtual.
14880         (PropertyExpr.ResolveAccessors): Make one call for both
14881         accessors.
14882
14883 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14884
14885         Fixed bug #65766
14886         * statement.cs: Error 152 report constains also location.
14887
14888 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14889
14890         Fixed bug #65766
14891         * const.cs: Explicitly set constant as static.
14892
14893 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14894
14895         Fixed bug #64226
14896         * cs-parser.jay: Add error 1017 report.
14897
14898 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14899
14900         Fixed bug #59980, #64224
14901         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14902
14903         * typemanager.cs (IsSpecialMethod): Simplified
14904
14905 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14906
14907         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14908         condition with better params.
14909
14910 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14911
14912         Fixed bug #65238
14913         * attribute.cs (Resolve): Property has to have both
14914         accessors.
14915
14916 2004-09-14  Martin Baulig  <martin@ximian.com>
14917
14918         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14919
14920 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14921
14922         Fixed bug #61902
14923         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14924         called and is obsolete then this member suppress message
14925         when call is inside next [Obsolete] method or type.
14926
14927         * expression.cs: Use TestObsoleteMethodUsage member.
14928
14929 2004-09-14  Martin Baulig  <martin@ximian.com>
14930
14931         * cs-parser.jay: Sync a bit with the GMCS version.
14932
14933 2004-09-14  Martin Baulig  <martin@ximian.com>
14934
14935         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14936         (CSharpParser.yacc_verbose_flag): New public field.
14937
14938         * genericparser.cs: Removed.
14939
14940 2004-09-14  Raja R Harinath  <rharinath@novell.com>
14941
14942         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14943
14944 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
14945
14946         * class.cs (MethodCore.CheckBase): Fix bug #65757.
14947
14948 2004-09-10  Martin Baulig  <martin@ximian.com>
14949
14950         Backported my MemberName changes from GMCS into MCS.
14951
14952         - we are now using a special `MemberName' class instead of using
14953         strings; in GMCS, the `MemberName' also contains the type
14954         arguments.
14955
14956         - changed the grammar rules a bit:
14957           * the old `member_name' is now a `namespace_or_type_name':
14958             The rule is that we use `namespace_or_type_name' everywhere
14959             where we expect either a "member name" (GetEnumerator) or a
14960             "member name" with an explicit interface name
14961             (IEnumerable.GetEnumerator).
14962             In GMCS, the explicit interface name may include type arguments
14963             (IEnumerable<T>.GetEnumerator).
14964           * we use `member_name' instead of just `IDENTIFIER' for
14965             "member names":
14966             The rule is that we use `member_name' wherever a member may
14967             have type parameters in GMCS.       
14968
14969         * decl.cs (MemberName): New public class.
14970         (MemberCore.MemberName): New public readonly field.
14971         (MemberCore.ctor): Take a `MemberName' argument, not a string.
14972         (DeclSpace): Likewise.
14973
14974         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14975         * enum.cs (Enum.ctor): Likewise.
14976
14977         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14978         MemberName.     
14979         (AliasEntry.ctor): Take a MemberName, not an Expression.
14980         (AliasEntry.UsingAlias): Likewise.
14981
14982         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14983         (IMethodData.MemberName): Changed type from string to MemberName.
14984         (MemberBase.ExplicitInterfaceName): Likewise.
14985         (AbstractPropertyEventMethod.SetupName): Make this private.
14986         (AbstractPropertyEventMethod.ctor): Added `string prefix'
14987         argument; compute the member name here.
14988         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14989         on the `member.MemberName' and the `prefix'.
14990
14991         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14992         not `type_name'.
14993         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14994         thus, we get a `MemberName' instead of a `string'.  These
14995         declarations may have type parameters in GMCS.
14996         (interface_method_declaration, delegate_declaration): Likewise.
14997         (class_declaration, interface_declaration): Likewise.
14998         (method_header): Use `namespace_or_type_name' instead of
14999         `member_name'.  We may be an explicit interface implementation.
15000         (property_declaration, event_declaration): Likewise.
15001         (member_name): This is now just an `IDENTIFIER', not a
15002         `namespace_or_type_name'.
15003         (type_name, interface_type): Removed.
15004         (namespace_or_type_name): Return a MemberName, not an Expression.
15005         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15006         call GetTypeExpression() on the MemberName to get an expression.
15007         (IndexerDeclaration.interface_type): Changed type from string to
15008         MemberName.
15009         (MakeName): Operate on MemberName's instead of string's.
15010
15011 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15012
15013         Fix bug #55770.
15014         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15015         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15016         lookup to avoid symbols introduced by 'using'.
15017         * rootcontext.cs (NamespaceLookup): Update.
15018
15019 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15020
15021         * class.cs (TypeContainer.DoDefineMembers): Do not call
15022         DefineDefaultConstructor for static classes.
15023
15024 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15025
15026         * attribute.cs (Attribute.Resolve): Add error 653 report.
15027
15028         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15029         report.
15030         (Method.ApplyAttributeBuilder): Add error 685 report.
15031         (Operator.Define): Add error 564 report.
15032
15033         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15034
15035         * expression.cs (Invocation.DoResolve): Add error
15036         245 and 250 report.
15037
15038         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15039         error 674 report.
15040
15041 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15042
15043         * class.cs (ConstructorInitializer.Resolve):
15044         Wrong error number (515->516).
15045
15046 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15047
15048         * class.cs (Indexer.Define): Add error 631 report.
15049
15050 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15051
15052         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15053
15054 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15055
15056         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15057
15058 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15059
15060         * cs-parser.jay: Added error CS0241 report.
15061
15062 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15063
15064         * cs-parser.jay (fixed_statement): Introduce a scope for the
15065         declaration in the 'fixed' statement.
15066
15067 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15068
15069         * cs-parser.jay: Added CS0230 error report.
15070
15071 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15072
15073         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15074
15075 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15076
15077         * expression.cs (Argument.Resolve): Added error CS0192 and
15078         CS0199 report.
15079
15080 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15081
15082         C# 2.0 #pragma warning feature
15083
15084         * cs-tokenizer.cs (PreProcessPragma): New method; 
15085         Handles #pragma directive.
15086
15087         * report.cs (WarningRegions): New class; Support
15088         class for #pragma warning directive. It tests whether
15089         warning is enabled for a given line.
15090
15091 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15092
15093         * const.cs: Add more descriptive error report, tahnks to
15094         Sebastien. 
15095
15096 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15097
15098         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15099
15100 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15101
15102         * expression.cs: Apply patch from Ben: Remove dead code from
15103         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15104         as that code just threw an exception anwyays.
15105
15106         * const.cs: Remove the call to the turnintoconstant, for details
15107         see bug: #63144
15108         
15109         * literal.cs: The type of the null-literal is the null type;  So
15110         we use a placeholder type (literal.cs:System.Null, defined here)
15111         for it.
15112
15113         * expression.cs (Conditional.DoResolve): Remove some old code that
15114         is no longer needed, conversions have been fixed.
15115
15116         (ArrayCreationExpression.DoResolve): Return false if we fail to
15117         resolve the inner expression.
15118
15119 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15120
15121         Fix test-290.cs.
15122         * cs-parser.jay (delegate_declaration): Record a delegate
15123         declaration as a type declaration.
15124         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15125
15126 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15127
15128         * parameter.cs: Do not crash if the type can not be resolved. 
15129
15130         * expression.cs: Report errors with unsafe pointers, fixes #64896
15131
15132 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15133
15134         * expression.cs: Pointer arith always needs to do a conv.i
15135         if the operand is a long. fix 65320
15136
15137 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15138
15139         Fixed cs0619-37.cs, cs0619-38.cs
15140
15141         * enum.cs (GetObsoleteAttribute): Removed.
15142
15143         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15144         on Enum member is double staged. The first is tested member
15145         and then enum.
15146
15147 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15148
15149         Fixed #56986, #63631, #65231
15150
15151         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15152         adds member to name container.
15153         (TypeContainer.AddToTypeContainer): New method, adds type to
15154         name container.
15155         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15156         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15157         AddOperator): Simplified by reusing AddToMemberContainer.
15158         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15159         instead of field.
15160         (Method.CheckForDuplications): Fixed implementation to test all
15161         possibilities.
15162         (MemberBase): Detection whether member is explicit interface
15163         implementation is now in constructor.
15164         (MemberBase.UpdateMemberName): Handles IndexerName.
15165         (Accessor): Changed to keep also location information.
15166         (AbstractPropertyEventMethod): Is derived from MemberCore.
15167         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15168         will be emited or not.
15169         (PropertyBase.AreAccessorsDuplicateImplementation):
15170         Tests whether accessors are not in collision with some method.
15171         (Operator): Is derived from MethodCore to simplify common
15172         operations.
15173
15174         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15175         must be performed.
15176         (DeclSpace.AddToContainer): Adds the member to defined_names
15177         table. It tests for duplications and enclosing name conflicts.
15178
15179         * enum.cs (EnumMember): Clean up to reuse the base structures
15180
15181 2004-09-03  Martin Baulig  <martin@ximian.com>
15182
15183         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15184         into TypeContainer, to make partial classes work again.
15185
15186 2004-09-03  Martin Baulig  <martin@ximian.com>
15187
15188         * rootcontext.cs (RootContext.V2): Removed.
15189
15190 2004-03-23  Martin Baulig  <martin@ximian.com>
15191
15192         * expression.cs (Invocation.OverloadResolve): Added `bool
15193         may_fail' argument and use it instead of the Location.IsNull() hack.
15194
15195 2004-09-03  Martin Baulig  <martin@ximian.com>
15196
15197         Merged latest changes into gmcs.  Please keep this comment in
15198         here, it makes it easier for me to see what changed in MCS since
15199         the last time I merged.
15200
15201 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15202
15203         Fix #61128.
15204         * expression.cs (BetterConversion): Don't allow either conversion 
15205         to be null.  Remove redundant implicit conversion test when 'q ==
15206         null' -- when this function is invoked, we already know that the
15207         implicit conversion exists.
15208         (BetterFunction): Assume that 'best' is non-null.  Remove
15209         redundant reimplementation of IsApplicable when 'best' is null.
15210         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15211         number of arguments.
15212         (IsAncestralType): Extract from OverloadResolve.
15213         (OverloadResolve): Make robust to the MethodGroupExpr being
15214         unsorted.  Implement all the logic of Section 14.5.5.1, and
15215         support overloading of methods from multiple applicable types.
15216         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15217
15218         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15219         (RealError, Warning): Append type of report to related symbol.
15220
15221 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15222
15223         * enum.cs: Fixed CLS-Compliance checks for enum members.
15224         Error tests cs3008-8.cs, cs3014-8.cs
15225
15226 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15227
15228         Fixed bug #62342, #63102
15229         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15230         like ImplementMethod.
15231
15232 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15233
15234         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15235         Fixed bug #65170.
15236
15237 2004-09-02  Martin Baulig  <martin@ximian.com>
15238
15239         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15240         TypeManager.GetArgumentTypes() rather than calling GetParameters()
15241         on the MethodBase.
15242
15243 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
15244
15245         C# 2.0 Static classes implemented
15246
15247         * class.cs (TypeContainer): instance_constructors,
15248         initialized_fields, initialized_static_fields,
15249         default_constructor, base_inteface_types are protected to be
15250         accessible from StaticClass.
15251         (TypeContainer.DefineDefaultConstructor): New virtual method
15252         for custom default constructor generating
15253         (StaticClass): New class to handle "Static classes" feature.
15254
15255         * cs-parser.jay: Handle static keyword on class like instance
15256         of StaticClass.
15257
15258         * driver.cs: Added "/langversion" command line switch with two
15259         options (iso-1, default).
15260
15261 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
15262
15263         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15264
15265 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
15266
15267         * delegate.cs: Style.
15268
15269 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15270
15271         * delegate.cs: Add seperate instance expr field for miguel.
15272
15273 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15274
15275         * PointerArithmetic (Resolve): make sure we are not doing
15276         pointer arith on void*. Also, make sure we are resolved
15277         by not setting eclass until resolve.
15278
15279         All callers: Make sure that PointerArithmetic gets resolved.
15280
15281 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15282
15283         * ArrayCreation (LookupType): If the type does not resolve 
15284         to an array, give an error.
15285
15286 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15287
15288         * statement.cs (Try.Resolve): Fixed bug #64222
15289
15290 2004-08-27  Martin Baulig  <martin@ximian.com>
15291
15292         * class.cs
15293         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15294         crash here.     
15295
15296 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15297
15298         * ecore.cs (Constantify): Get underlying type via
15299         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15300         Windows in special cases.
15301
15302 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15303
15304         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15305         for obtaining also private methods.
15306         (GetRemoveMethod): Used GetRemoveMethod (true)
15307         for obtaining also private methods.
15308
15309 2004-08-24  Martin Baulig  <martin@ximian.com>
15310
15311         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15312         MethodAttributes.HideBySig for operators.
15313
15314 2004-08-23  Martin Baulig  <martin@ximian.com>
15315
15316         Back to the old error reporting system :-)
15317
15318         * report.cs (Message): Removed.
15319         (Report.MessageData, ErrorData, WarningData): Removed.
15320         (Report.Error, Warning): Back to the old system.
15321
15322 2004-08-23  Martin Baulig  <martin@ximian.com>
15323
15324         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15325
15326         * class.cs (TypeContainer.ParentContainer): New public virtual
15327         method; replaces the explicit interface implementation.
15328         (ClassPart.ParentContainer): Override.
15329
15330 2004-08-23  Martin Baulig  <martin@ximian.com>
15331
15332         * statement.cs (Switch): Added support for constant switches; see
15333         #59428 or test-285.cs.
15334
15335 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15336
15337         Fixed bug #62740.
15338         * statement.cs (GetEnumeratorFilter): Removed useless
15339         logic because C# specs is strict. GetEnumerator must be
15340         public.
15341
15342 2004-08-22  Martin Baulig  <martin@ximian.com>
15343
15344         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15345         a switch and may break, reset the barrier.  Fixes #59867.
15346
15347 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15348
15349         CLS-Compliance speed up (~5% for corlib)
15350
15351         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15352         New method. Tests container for CLS-Compliant names
15353
15354         * class.cs (TypeContainer.VerifyClsName): New method.
15355         Checks whether container name is CLS Compliant.
15356         (Constructor): Implements IMethodData.
15357
15358         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15359         low-case table for CLS Compliance test.
15360         (MemberCache.VerifyClsParameterConflict): New method.
15361         Checks method parameters for CS3006 error.
15362
15363         * enum.cs (EnumMember): Is derived from MemberCore.
15364         (Enum.VerifyClsName): Optimized for better performance.
15365
15366 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15367
15368         * report.cs: Renamed Error_T to Error and changed all
15369         references.
15370
15371 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15372
15373         * class.cs (TypeContainer.IndexerArrayList): New inner class
15374         container for indexers.
15375         (TypeContainer.DefaultIndexerName): New constant for default
15376         indexer name. Replaced all "Item" with this constant.
15377         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15378
15379         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15380         DefaultMemberAttribute constructor.
15381
15382 2004-08-05  Martin Baulig  <martin@ximian.com>
15383
15384         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15385         Fix bug #59429.
15386
15387 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
15388
15389         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15390         multi platforms problem.
15391
15392         * compiler.csproj: Included shared files.
15393
15394 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15395
15396         Fix bug 60333, 55971 in the more general way
15397         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15398         Added arg_type argument for constant conversion.
15399         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15400
15401 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15402
15403         Fix bug #59760
15404         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
15405         OperatorArrayList, MethodCoreArrayList for typecontainer
15406         containers. Changed class member types to these new types.
15407         (MethodArrayList.DefineMembers): Added test for CS0659.
15408
15409 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
15410
15411         * cfold.cs: Synchronize the folding with the code in expression.cs
15412         Binary.DoNumericPromotions for uint operands.
15413
15414         * attribute.cs: Revert patch from Raja, it introduced a regression
15415         while building Blam-1.2.1 (hard to isolate a test case).
15416
15417 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15418
15419         Fix for #55382
15420         * class.cs:
15421         (TypeContainer.Define): Renamed to DefineContainerMembers because of
15422         name collision.
15423         (MethodCore.parent_method): New member. The method we're overriding
15424         if this is an override method.
15425         (MethodCore.CheckBase): Moved from Method class and made common.
15426         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15427         private.
15428         (MethodCore.CheckForDuplications): New abstract method. For custom
15429         member duplication search in a container
15430         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15431         method and its return type.
15432         (Event.conflict_symbol): New member. Symbol with same name in the
15433         parent class.
15434
15435         * decl.cs:
15436         (MemberCache.FindMemberWithSameName): New method. The method
15437         is looking for conflict with inherited symbols.
15438
15439 2004-08-04  Martin Baulig  <martin@ximian.com>
15440
15441         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15442
15443         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15444
15445 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15446
15447         * report.cs (Message): New enum for better error, warning reference in
15448         the code.
15449         (MessageData): New inner abstract class. It generally handles printing of
15450         error and warning messages.
15451         Removed unused Error, Warning, Message methods.
15452
15453 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15454
15455         Fix for cs0592-8.cs test
15456         * attribute.cs
15457         (Attributable.ValidAttributeTargets): Made public.
15458         (Attribute.ExplicitTarget): New member for explicit target value.
15459         (Attribute.CheckTargets): Now we translate explicit attribute
15460         target to Target here.
15461
15462 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
15463
15464         * ecore.cs (MethodGroupExpr): new IsBase property.
15465
15466         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15467
15468         * delegate.cs (DelegateCreation): store a MethodGroupExpr
15469         rather than an instance expr.
15470
15471         (DelegateCreation.Emit): Use the method group rather than
15472         the instance expression. Also, if you have base.Foo as the
15473         method for a delegate, make sure to emit ldftn, not ldftnvirt.
15474
15475         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
15476
15477         (NewDelegate.DoResolve): Only check for the existance of Invoke
15478         if the method is going to be needed. Use MethodGroupExpr.
15479
15480         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
15481
15482         * expression.cs: For pointer arith., make sure to use
15483         the size of the type, not the size of the pointer to
15484         the type.
15485
15486 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15487
15488         Fix for #60722
15489         * class.cs (Class): Added error CS0502 test.
15490
15491 2004-08-03  John Luke  <jluke@cfl.rr.com>
15492             Raja R Harinath  <rharinath@novell.com>
15493
15494         Fix for #60997.
15495         * attribute.cs (Attribute.complained_before): New flag.
15496         (Attribute.ResolveType, Attribute.Resolve),
15497         (Attribute.DefinePInvokeMethod): Set it.
15498         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15499         
15500 2004-08-03  Martin Baulig  <martin@ximian.com>
15501
15502         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15503         use a user-defined operator; we still need to do numeric
15504         promotions in case one argument is a builtin type and the other
15505         one has an implicit conversion to that type.  Fixes #62322.
15506
15507 2004-08-02  Martin Baulig  <martin@ximian.com>
15508
15509         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15510         (LocalInfo.IsThis): New public property.
15511         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15512
15513 2004-08-01  Martin Baulig  <martin@ximian.com>
15514
15515         * class.cs (TypeContainer.GetClassBases): Don't set the default
15516         here since we may get called from GetPartialBases().
15517         (TypeContainer.DefineType): If GetClassBases() didn't return a
15518         parent, use the default one.
15519
15520 2004-07-30  Duncan Mak  <duncan@ximian.com>
15521
15522         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15523
15524 2004-07-30  Martin Baulig  <martin@ximian.com>
15525
15526         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15527
15528         * class.cs (SourceMethod): New public class, derive from the
15529         symbol writer's ISourceMethod.
15530         (Method): Use the new symbol writer API.
15531
15532         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15533         as argument and use the new symbol writer.
15534
15535         * location.cs
15536         (SourceFile): Implement the symbol writer's ISourceFile.
15537         (Location.SymbolDocument): Removed.
15538         (Location.SourceFile): New public property.
15539
15540         * symbolwriter.cs: Use the new symbol writer API.
15541
15542 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15543
15544         * Makefile (install-local): Remove.  Functionality moved to
15545         executable.make.
15546
15547 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15548
15549         * Makefile: Install mcs.exe.config file together with mcs.exe.
15550         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15551         correct runtime version.
15552         
15553 2004-07-25  Martin Baulig  <martin@ximian.com>
15554
15555         * class.cs
15556         (TypeContainer.RegisterOrder): Removed, this was unused.
15557         (TypeContainer, interface_order): Removed.
15558         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15559         TypeContainer as argument since we can also be called with a
15560         `PartialContainer' for a partial class/struct/interface.
15561         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15562         of checking whether we're an `Interface' - we could be a
15563         `PartialContainer'.
15564         (PartialContainer.Register): Override; call
15565         AddClass()/AddStruct()/AddInterface() on our parent.
15566
15567         * cs-parser.jay (interface_member_declaration): Add things to the
15568         `current_container', not the `current_class'.
15569
15570         * rootcontext.cs (RegisterOrder): The overloaded version which
15571         takes an `Interface' was unused, removed.
15572
15573         * typemanager.cs (TypeManager.LookupInterface): Return a
15574         `TypeContainer', not an `Interface'.
15575         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15576         contain a `PartialContainer' for an interface, so check it's
15577         `Kind' to figure out what it is.
15578
15579 2004-07-25  Martin Baulig  <martin@ximian.com>
15580
15581         * class.cs (Class.DefaultTypeAttributes): New public constant.
15582         (Struct.DefaultTypeAttributes): Likewise.
15583         (Interface.DefaultTypeAttributes): Likewise.
15584         (PartialContainer.TypeAttr): Override this and add the
15585         DefaultTypeAttributes.
15586
15587 2004-07-25  Martin Baulig  <martin@ximian.com>
15588
15589         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15590         we can just use the `Parent' field instead.
15591
15592 2004-07-25  Martin Baulig  <martin@ximian.com>
15593
15594         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15595
15596 2004-07-25  Martin Baulig  <martin@ximian.com>
15597
15598         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15599         our parts before defining any methods.
15600         (TypeContainer.VerifyImplements): Make this virtual.
15601         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15602         on our PartialContainer.
15603
15604 2004-07-25  Martin Baulig  <martin@ximian.com>
15605
15606         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15607
15608         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15609         argument, we can just use the `Parent' field instead.
15610
15611         * class.cs
15612         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15613         (MemberBase.DoDefine): Likewise.
15614
15615 2004-07-24  Martin Baulig  <martin@ximian.com>
15616
15617         * decl.cs (MemberCore.Parent): New public field.
15618         (DeclSpace.Parent): Moved to MemberCore.
15619
15620         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15621         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15622         parent's .ctor.
15623         (FieldBase, Field, Operator): Likewise.
15624         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15625         (EventField, Event): Likewise.
15626
15627 2004-07-23  Martin Baulig  <martin@ximian.com>
15628
15629         * class.cs (PartialContainer): New public class.
15630         (ClassPart): New public class.
15631         (TypeContainer): Added support for partial classes.
15632         (TypeContainer.GetClassBases): Splitted some of the functionality
15633         out into GetNormalBases() and GetPartialBases().
15634
15635         * cs-tokenizer.cs (Token.PARTIAL): New token.
15636         (Tokenizer.consume_identifier): Added some hacks to recognize
15637         `partial', but only if it's immediately followed by `class',
15638         `struct' or `interface'.
15639
15640         * cs-parser.jay: Added support for partial clases.
15641
15642 2004-07-23  Martin Baulig  <martin@ximian.com>
15643
15644         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15645         a `DeclSpace' and also made it readonly.
15646         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15647         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15648         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15649
15650         * cs-parser.jay: Pass the `current_class', not the
15651         `current_container' (at the moment, this is still the same thing)
15652         to a new Method, Property, Event, Indexer or Constructor.
15653
15654 2004-07-23  Martin Baulig  <martin@ximian.com>
15655
15656         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15657         and removed the `current_interface' one.
15658         (struct_declaration, class_declaration, interface_declaration):
15659         Set `current_class' to the newly created class/struct/interface;
15660         set their `Bases' and call Register() before parsing their body.
15661
15662 2004-07-23  Martin Baulig  <martin@ximian.com>
15663
15664         * class.cs (Kind): New public enum.
15665         (TypeContainer): Made this class abstract.
15666         (TypeContainer.Kind): New public readonly field.
15667         (TypeContainer.CheckDef): New public method; moved here from
15668         cs-parser.jay.
15669         (TypeContainer.Register): New public abstract method.
15670         (TypeContainer.GetPendingImplementations): New public abstract
15671         method.
15672         (TypeContainer.GetClassBases): Removed the `is_class' and
15673         `is_iface' parameters.
15674         (TypeContainer.DefineNestedTypes): Formerly known as
15675         DoDefineType().
15676         (ClassOrStruct): Made this class abstract.
15677
15678         * tree.cs (RootTypes): New public type. 
15679
15680 2004-07-20  Martin Baulig  <martin@ximian.com>
15681
15682         * tree.cs (Tree.RecordNamespace): Removed.
15683         (Tree.Namespaces): Removed.
15684
15685         * rootcontext.cs (RootContext.IsNamespace): Removed.
15686
15687         * cs-parser.jay (namespace_declaration): Just create a new
15688         NamespaceEntry here.
15689
15690 2004-07-20  Martin Baulig  <martin@ximian.com>
15691
15692         * statement.cs (ExceptionStatement): New abstract class.  This is
15693         now used as a base class for everyone who's using `finally'.
15694         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15695         our local variables before using them.
15696
15697         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15698         virtual method.  This is used by Yield.Resolve() to "steal" an
15699         outer block's `finally' clauses.
15700         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15701         argument.
15702
15703         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15704         version which takes an ExceptionStatement.  This version must be
15705         used to create exception branchings.
15706
15707         * iterator.cs
15708         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15709         (Iterator.EmitMoveNext): Added exception support; protect the
15710         block with a `fault' clause, properly handle 'finally' clauses.
15711         (Iterator.EmitDispose): Run all the `finally' clauses here.
15712
15713 2004-07-20  Martin Baulig  <martin@ximian.com>
15714
15715         * iterator.cs: This is the first of a set of changes in the
15716         iterator code.  Match the spec more closely: if we're an
15717         IEnumerable, then GetEnumerator() must be called.  The first time
15718         GetEnumerator() is called, it returns the current instance; all
15719         subsequent invocations (if any) must create a copy.
15720
15721 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15722
15723         * expression.cs: Resolve the constant expression before returning
15724         it. 
15725
15726 2004-07-19  Martin Baulig  <martin@ximian.com>
15727
15728         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15729         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15730         the return type of the new EmitContext.
15731
15732 2004-07-18  Martin Baulig  <martin@ximian.com>
15733
15734         * class.cs (Property.Define): Fix iterators.
15735
15736         * iterators.cs (Iterator.Define): Moved the
15737         `container.AddInterator (this)' call here from the .ctor; only do
15738         it if we resolved successfully.
15739
15740 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15743         `true' for preprocessing directives that we parse.  The return
15744         value indicates whether we should return to regular tokenizing or
15745         not, not whether it was parsed successfully.
15746
15747         In the past if we were in: #if false ... #line #endif, we would
15748         resume parsing after `#line'.  See bug 61604.
15749
15750         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15751         building: IsEnumType should return true only for enums, not for
15752         enums or System.Enum itself.  This fixes #61593.
15753
15754         Likely what happened is that corlib was wrong: mcs depended on
15755         this bug in some places.  The bug got fixed, we had to add the
15756         hack, which caused bug 61593.
15757
15758         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15759         that was a workaround for the older conditions.
15760
15761 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15762
15763         * assign.cs: IAssignMethod has a new interface, as documented
15764         inline. All assignment code now uses this new api.
15765
15766         * ecore.cs, expression.cs: All classes which implement
15767         IAssignMethod now use the new interface.
15768
15769         * expression.cs (Invocation): add a hack to EmitCall so that
15770         IndexerAccess can be the target of a compound assignment without
15771         evaluating its arguments twice.
15772
15773         * statement.cs: Handle changes in Invocation api.
15774
15775 2004-07-16  Martin Baulig  <martin@ximian.com>
15776
15777         * iterators.cs: Rewrote this.  We're now using one single Proxy
15778         class for both the IEnumerable and the IEnumerator interface and
15779         `Iterator' derives from Class so we can use the high-level API.
15780
15781         * class.cs (TypeContainer.AddIterator): New method.
15782         (TypeContainer.DoDefineType): New protected virtual method, which
15783         is called from DefineType().
15784         (TypeContainer.DoDefineMembers): Call DefineType() and
15785         DefineMembers() on all our iterators.
15786         (TypeContainer.Emit): Call Emit() on all our iterators.
15787         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15788
15789         * codegen.cs (EmitContext.CurrentIterator): New public field.
15790
15791 2004-07-15  Martin Baulig  <martin@ximian.com>
15792
15793         * typemanager.cs
15794         (TypeManager.not_supported_exception_type): New type.   
15795
15796 2004-07-14  Martin Baulig  <martin@ximian.com>
15797
15798         * iterators.cs: Use real error numbers.
15799
15800 2004-07-14  Martin Baulig  <martin@ximian.com>
15801
15802         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15803         requires this to be a System.Collection.IEnumerable and not a
15804         class implementing that interface.
15805         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15806
15807 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15808
15809         * class.cs: Fixed previous fix, it broke some error tests.
15810
15811 2004-07-12  Martin Baulig  <martin@ximian.com>
15812
15813         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15814         Fixes #61293.
15815
15816 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15817
15818         * assign.cs (LocalTemporary): Add new argument: is_address,If
15819         `is_address' is true, then the value that we store is the address
15820         to the real value, and not the value itself.
15821         
15822         * ecore.cs (PropertyExpr): use the new local temporary
15823         stuff to allow us to handle X.Y += z (where X is a struct)
15824
15825 2004-07-08  Martin Baulig  <martin@ximian.com>
15826
15827         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15828         not always return, just like we're doing in Using.Resolve().
15829
15830 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * cs-parser.jay (fixed_statement): flag this as Pinned.
15833
15834 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * typemanager.cs (TypeManager): Removed MakePinned method, this
15837         mechanism is replaced with the .NET 2.x compatible mechanism of
15838         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15839
15840         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15841         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15842         `IsFixed' property which has a different meaning.
15843
15844 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15845
15846         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15847         visible from inside a nested class, not just the names of the
15848         immediately enclosing class.
15849         Fix for bug #60730.
15850
15851 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15852
15853         * expression.cs (BetterConversion): Remove buggy special-case
15854         handling of "implicit constant expression conversions".  At this
15855         point, we already know that the conversion is possible -- we're
15856         only checking to see which is better.
15857
15858 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15859
15860         * cs-parser.jay: Added error CS0210 test.
15861
15862 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15863
15864         * cs-parser.jay: Added error CS0134 test.
15865
15866 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15867
15868         Fix bug #52507
15869         * cs-parser.jay: Added error CS0145 test.
15870
15871 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15872
15873         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15874
15875 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15876         
15877         * expression.cs (StackAlloc.Resolve): The argument may not
15878         be a constant; deal with this case.
15879         
15880 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15881
15882         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15883         GetIndexerAttributeValue.
15884         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15885
15886         * class.cs (Indexer.Define): Added error tests for CS0415,
15887         CS0609.
15888
15889 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15892         property code.
15893
15894 2004-06-23  Martin Baulig  <martin@ximian.com>
15895
15896         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15897         neither return nor throw, reset the barrier as well.  Fixes #60457.
15898
15899 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15900
15901         * class.cs : EventAttributes is now set to None by default.
15902           This fixes bug #60459.
15903
15904 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15905
15906         Fix bug #60219
15907         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15908         Don't throw exception but return null (it's sufficient now).
15909
15910 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15911
15912         * typemanager.cs (GetArgumentTypes): Faster implementation.
15913
15914 2004-06-18  Martin Baulig  <martin@ximian.com>
15915
15916         * attribute.cs (Attribute.Resolve): Check whether we're an
15917         EmptyCast which a Constant child.  Fixes #60333.
15918
15919 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
15920
15921         * statement.cs (EmitCollectionForeach): Account for the fact that
15922         not all valuetypes are in areas which we can take the address of.
15923         For these variables, we store to a temporary variable. Also, make
15924         sure that we dont emit a `callvirt' on a valuetype method.
15925
15926 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15927
15928         * expression.cs (StackAlloc.DoReSolve): Added test for
15929         negative parameter (CS0247).
15930
15931 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15932
15933         Fix bug #59792
15934         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15935
15936 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15937
15938         Fix bug #59781
15939         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15940         ulong.
15941
15942 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15943
15944         Fix bug #58254 & cs1555.cs, cs1556.cs
15945         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15946
15947 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15948
15949         * cs-parser.jay: Added error CS1669 test for indexers.
15950
15951 2004-06-11  Martin Baulig  <martin@ximian.com>
15952
15953         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15954         call this twice: for params and varargs methods.
15955
15956 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15957
15958         * class.cs:
15959         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15960
15961 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15962
15963         * attribute.cs (Attribute.GetValidTargets): Made public.
15964
15965         * class.cs: 
15966         (AbstractPropertyEventMethod): New class for better code sharing.
15967         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15968         CS1667 report.
15969         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15970
15971 2004-06-11  Raja R Harinath  <rharinath@novell.com>
15972
15973         Fix bug #59477.
15974         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15975         that the call to Resolve is part of a MemberAccess.
15976         (Expression.Resolve): Use it for SimpleName resolution.
15977         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15978         Add 'intermediate' boolean argument.
15979         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
15980         error message when the SimpleName can be resolved ambiguously
15981         between an expression and a type.
15982         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15983         public.
15984         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15985         call on the left-side.
15986
15987 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15988
15989         * class.cs:
15990         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15991
15992 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15993
15994         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15995
15996 2004-06-11  Martin Baulig  <martin@ximian.com>
15997
15998         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15999         varargs methods if applicable.
16000
16001 2004-06-11  Martin Baulig  <martin@ximian.com>
16002
16003         * expression.cs (Invocation.EmitCall): Don't use
16004         `method.CallingConvention == CallingConventions.VarArgs' since the
16005         method could also have `CallingConventions.HasThis'.
16006
16007 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16008
16009         * class.cs (Event.GetSignatureForError): Implemented.
16010         Fixed crash in error test cs3010.cs
16011
16012 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * cs-tokenizer.cs: Change the way we track __arglist to be
16015         consistent with the other keywords.
16016
16017 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16018
16019         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16020         tomorrow.
16021
16022 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16023
16024         * codegen.cs: Check that all referenced assemblies have a strongname
16025         before strongnaming the compiled assembly. If not report error CS1577.
16026         Fix bug #56563. Patch by Jackson Harper.
16027         * typemanager.cs: Added a method to return all referenced assemblies.
16028         Fix bug #56563. Patch by Jackson Harper.
16029
16030 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16031
16032         * class.cs:
16033         (Method.ApplyAttributeBuilder): Moved and added conditional
16034         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16035
16036         * delegate.cs:
16037         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16038
16039 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16040
16041         Fixed #59640
16042         * class.cs: (EventField.attribute_targets): Changed default target.
16043
16044 2004-06-08  Martin Baulig  <martin@ximian.com>
16045
16046         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16047
16048 2004-06-08  Martin Baulig  <martin@ximian.com>
16049
16050         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16051
16052 2004-06-07  Martin Baulig  <martin@ximian.com>
16053
16054         Added support for varargs methods.
16055
16056         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16057         keyword.
16058
16059         * cs-parser.jay: Added support for `__arglist'.
16060
16061         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16062
16063         * expression.cs (Argument.AType): Added `ArgList'.
16064         (Invocation): Added support for varargs methods.
16065         (ArglistAccess): New public class.
16066         (Arglist): New public class.
16067
16068         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16069
16070         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16071         a method's top-level block if the method has varargs.
16072
16073         * support.cs (ReflectionParameters, InternalParameters): Added
16074         support for varargs methods.    
16075
16076 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16077
16078         * class.cs: Provide location in indexer error report.
16079
16080         * driver.cs: Use standard names.
16081
16082         * namespace.cs: Catch the use of using after a namespace has been
16083         declared also on using aliases.
16084
16085 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16086
16087         Bug #50820.
16088         * typemanager.cs (closure_private_ok, closure_invocation_type)
16089         (closure_qualifier_type, closure_invocation_assembly)
16090         (FilterWithClosure): Move to ...
16091         (Closure): New internal nested class.
16092         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16093         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16094         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16095         (MemberLookup, MemberLookupFailed): Use it.
16096         * expression.cs (New.DoResolve): Treat the lookup for the
16097         constructor as being qualified by the 'new'ed type.
16098         (Indexers.GetIndexersForTypeOrInterface): Update.
16099
16100 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16101
16102         * attribute.cs
16103         (GetConditionalAttributeValue): New method. Returns
16104         condition of ConditionalAttribute.
16105         (SearchMulti): New method.  Returns all attributes of type 't'.
16106         Use it when attribute is AllowMultiple = true.
16107         (IsConditionalMethodExcluded): New method.
16108
16109         * class.cs
16110         (Method.IsExcluded): Implemented. Returns true if method has conditional
16111         attribute and the conditions is not defined (method is excluded).
16112         (IMethodData): Extended interface for ConditionalAttribute support.
16113         (PropertyMethod.IsExcluded): Implemented.
16114
16115         * decl.cs
16116         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16117
16118         * expression.cs
16119         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16120         on the method.
16121
16122 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16123
16124         * expression.cs (ArrayCreationExpression): Make this just an
16125         `expression'. It can't be a statement, so the code here was
16126         dead.
16127
16128 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16129
16130         Fixed #59072
16131         * typemanager.cs (GetFullNameSignature): New method for
16132         MethodBase types.
16133
16134 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16135
16136         Fixed #56452
16137         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16138         Use this method when MethodBuilder is null.
16139         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16140         Added test for error CS0626 (MONO reports error for this situation).
16141         (IMethodData.GetSignatureForError): Extended interface.
16142
16143 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16144
16145         * attribute.cs
16146         (AttributeTester.GetObsoleteAttribute): Returns instance of
16147         ObsoleteAttribute when type is obsolete.
16148
16149         * class.cs
16150         (TypeContainer.VerifyObsoleteAttribute): Override.
16151         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16152         (MethodCode.VerifyObsoleteAttribute): Override.
16153         (MemberBase.VerifyObsoleteAttribute): Override.
16154
16155         * decl.cs
16156         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16157         and report proper error.
16158
16159         *delegate.cs
16160         Delegate.VerifyObsoleteAttribute): Override.
16161
16162         * ecore.cs
16163         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16164         and report proper error.
16165         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16166
16167         * enum.cs
16168         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16169         and enum member.
16170
16171         * expression.cs
16172         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16173         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16174         Added test for ObsoleteAttribute.
16175
16176         * statement.cs
16177         (Catch): Derived from Statement.
16178
16179 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16180  
16181         Fixed bug #59071 & cs0160.cs
16182  
16183         * statement.cs (Try.Resolve): Check here whether order of catch
16184         clauses matches their dependencies.
16185
16186 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16187
16188         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16189         caused a regression: #59343.  Referencing nested classes from an
16190         assembly stopped working.
16191
16192 2004-05-31  Martin Baulig  <martin@ximian.com>
16193
16194         MCS is now frozen for beta 2.
16195
16196 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16197
16198         * convert.cs: add a trivial cache for overload operator resolution.
16199
16200 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16201
16202         * decl.cs: If possible, use lookuptypedirect here. We can only do
16203         this if there is no `.' after the namespace. Avoids using
16204         LookupType, which does lots of slow processing.
16205         (FindNestedType) New method, does what it says :-).
16206         * namespace.cs: use LookupTypeDirect.
16207         * rootcontext.cs: use membercache, if possible.
16208         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16209
16210 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16211
16212         * expression.cs:
16213         According to the spec, 
16214
16215         In a member access of the form E.I, if E is a single identifier,
16216         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16217         field, property, localvariable, or parameter with the same type as
16218         the meaning of E as a type-name (§3.8), then both possible
16219         meanings of E are permitted.
16220
16221         We did not check that E as a simple-name had the same type as E as
16222         a type name.
16223
16224         This trivial check gives us 5-7% on bootstrap time.
16225
16226 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16227
16228         * expression.cs (Invocation.OverloadResolve): Avoid the
16229         use of hashtables and boxing here by allocating on demand.
16230
16231 2004-05-30  Martin Baulig  <martin@ximian.com>
16232
16233         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16234         we're doing a silent lookup.  Don't try to lookup nested types in
16235         TypeManager.object_type (thanks to Ben Maurer).
16236
16237 2004-05-30  Martin Baulig  <martin@ximian.com>
16238
16239         Committing a patch from Ben Maurer.
16240
16241         * rootcontext.cs (RootContext.LookupType): Cache negative results.
16242
16243 2004-05-29  Martin Baulig  <martin@ximian.com>
16244
16245         * class.cs (IMethodData.ShouldIgnore): New method.
16246
16247         * typemanager.cs (TypeManager.MethodFlags): Don't take a
16248         `Location' argument, we don't need it anywhere.  Use
16249         `IMethodData.ShouldIgnore ()' instead of
16250         `MethodData.GetMethodFlags ()'.
16251         (TypeManager.AddMethod): Removed.
16252         (TypeManager.AddMethod2): Renamed to AddMethod.
16253
16254 2004-05-29  Martin Baulig  <martin@ximian.com>
16255
16256         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16257
16258         * convert.cs (Convert.ImplicitReferenceConversion): If we're
16259         converting from a class type S to an interface type and we already
16260         have an object on the stack, don't box it again.  Fixes #52578.
16261
16262 2004-05-29  Martin Baulig  <martin@ximian.com>
16263
16264         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16265         Added support for `params' parameters.  Fixes #59267.
16266
16267 2004-05-29  Martin Baulig  <martin@ximian.com>
16268
16269         * literal.cs (NullPointer): Provide a private .ctor which sets
16270         `type' to TypeManager.object_type.  Fixes #59048.
16271
16272 2004-05-29  Martin Baulig  <martin@ximian.com>
16273
16274         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16275         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16276
16277         * ecore.cs (EventExpr.instance_expr): Make the field private.
16278
16279 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16280
16281         Fixed bug #50080 & cs0214-2.cs
16282         * expression.cs (Cast.DoResolve): Check unsafe context here.
16283         
16284         * statement.cs (Resolve.DoResolve): Likewise.
16285
16286 2004-05-26  Martin Baulig  <martin@ximian.com>
16287
16288         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16289
16290         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16291         (RootContext.LookupType): Pass down the `silent' flag.
16292
16293 2004-05-25  Martin Baulig  <martin@ximian.com>
16294
16295         * expression.cs
16296         (MethodGroupExpr.IdenticalTypeName): New public property.
16297         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16298         expression actually refers to a type.
16299
16300 2004-05-25  Martin Baulig  <martin@ximian.com>
16301
16302         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16303         for #56176 and made it actually work.
16304
16305 2004-05-25  Martin Baulig  <martin@ximian.com>
16306
16307         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16308         (FieldExpr, PropertyExpr): Override and implement
16309         CacheTemporaries.  Fixes #52279.
16310
16311 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * location.cs: In the new compiler listing a file twice is a
16314         warning, not an error.
16315
16316 2004-05-24  Martin Baulig  <martin@ximian.com>
16317
16318         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16319         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16320
16321 2004-05-24  Martin Baulig  <martin@ximian.com>
16322
16323         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16324         walking the `using' list.  Fixes #53921.
16325
16326 2004-05-24  Martin Baulig  <martin@ximian.com>
16327
16328         * const.cs (Const.LookupConstantValue): Added support for
16329         EmptyCast's; fixes #55251.
16330
16331 2004-05-24  Martin Baulig  <martin@ximian.com>
16332
16333         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16334         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16335         which does the CS0135 check.  The reason is that we first need to
16336         check whether the variable actually exists.
16337
16338 2004-05-24  Martin Baulig  <martin@ximian.com>
16339
16340         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16341         than RootContext.LookupType() to find the explicit interface
16342         type.  Fixes #58584.
16343
16344 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16345
16346         * Makefile: Simplify.  Use executable.make.
16347         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16348
16349 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16350
16351         * decl.cs:
16352         * enum.cs:
16353         Use the invariant culture when doing String.Compare for CLS case
16354         sensitivity.
16355         
16356 2004-05-23  Martin Baulig  <martin@ximian.com>
16357
16358         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16359         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16360
16361         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16362         
16363 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16364
16365         * class.cs (MemberBase.Define): Reuse MemberType member for 
16366         resolved type. Other methods can use it too.
16367
16368 2004-05-23  Martin Baulig  <martin@ximian.com>
16369
16370         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16371         the variable also exists in the current block (otherwise, we need
16372         to report a CS0103).  Fixes #58670.
16373
16374 2004-05-23  Martin Baulig  <martin@ximian.com>
16375
16376         * flowanalysis.cs (Reachability.Reachable): Compute this
16377         on-the-fly rather than storing it as a field.
16378
16379 2004-05-23  Martin Baulig  <martin@ximian.com>
16380
16381         * flowanalysis.cs (Reachability.And): Manually compute the
16382         resulting `barrier' from the reachability.      
16383        
16384 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16385
16386         Fix bug #57835
16387         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16388         instance of ObsoleteAttribute when symbol is obsolete.
16389
16390         * class.cs
16391         (IMethodData): Extended interface for ObsoleteAttribute support.
16392
16393 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16394
16395         * attribute.cs: Fix bug #55970
16396
16397 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16398
16399         Fix bug #52705
16400         * attribute.cs
16401         (GetObsoleteAttribute): New method. Creates the instance of
16402         ObsoleteAttribute.
16403         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16404         ObsoleteAttribute when member is obsolete.
16405         (AttributeTester.Report_ObsoleteMessage): Common method for
16406         Obsolete error/warning reporting.
16407
16408         * class.cs
16409         (TypeContainer.base_classs_type): New member for storing parent type.
16410
16411         * decl.cs
16412         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16413         for this MemberCore.
16414
16415 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16416
16417         * attribute.cs, const.cs: Fix bug #58590
16418
16419 2004-05-21  Martin Baulig  <martin@ximian.com>
16420
16421         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16422         out parameters if the end of the method is unreachable.  Fixes
16423         #58098. 
16424
16425 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16426
16427         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16428         Hari was right, why extra method.
16429
16430 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16431
16432         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16433
16434 2004-05-20  Martin Baulig  <martin@ximian.com>
16435
16436         Merged this back from gmcs to keep the differences to a minumum.
16437
16438         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16439         instead of a Declspace.
16440         (Attribute.ResolveType): Likewise.
16441         (Attributes.Search): Likewise.
16442         (Attributes.Contains): Likewise.
16443         (Attributes.GetClsCompliantAttribute): Likewise.
16444
16445         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16446         argument.
16447         (MethodData.ApplyAttributes): Take an EmitContext instead of a
16448         DeclSpace.
16449
16450 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
16451
16452         Fix bug #58688 (MCS does not report error when the same attribute
16453         is assigned twice)
16454
16455         * attribute.cs (Attribute.Emit): Distinction between null and default.
16456
16457 2004-05-19  Raja R Harinath  <rharinath@novell.com>
16458
16459         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16460         of a top-level attribute without an attribute target.
16461         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
16462         Make non-static.
16463         (Attribute.Conditional_GetConditionName), 
16464         (Attribute.Obsolete_GetObsoleteMessage): Update.
16465         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
16466         part of ScanForIndexerName.
16467         (Attribute.CanIgnoreInvalidAttribute): New function.
16468         (Attribute.ScanForIndexerName): Move to ...
16469         (Attributes.ScanForIndexerName): ... here.
16470         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16471         (Attributes.Search): New internal variant that can choose not to
16472         complain if types aren't resolved.  The original signature now
16473         complains.
16474         (Attributes.GetClsCompliantAttribute): Use internal variant, with
16475         complaints suppressed.
16476         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16477         only if it not useful.
16478         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16479         top-level for attributes that are shared between the assembly
16480         and a top-level class.
16481         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16482         * class.cs: Update to reflect changes.
16483         (DefineIndexers): Fuse loops.
16484         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
16485         a couple more variants of attribute names.
16486
16487 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
16488
16489         Fix bug #52585 (Implemented explicit attribute declaration)
16490
16491         * attribute.cs:
16492         (Attributable.ValidAttributeTargets): New abstract method. It gets
16493         list of valid attribute targets for explicit target declaration.
16494         (Attribute.Target): It holds target itself.
16495         (AttributeSection): Removed.
16496         (Attribute.CheckTargets): New method. It checks whether attribute
16497         target is valid for the current element.
16498
16499         * class.cs:
16500         (EventProperty): New class. For events that are declared like
16501         property (with add and remove accessors).
16502         (EventField): New class. For events that are declared like field.
16503         class.cs
16504
16505         * cs-parser.jay: Implemented explicit attribute target declaration.
16506
16507         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16508         Override ValidAttributeTargets.
16509
16510         * parameter.cs:
16511         (ReturnParameter): Class for applying custom attributes on 
16512         the return type.
16513         (ParameterAtribute): New class. Class for applying custom
16514         attributes on the parameter type.
16515
16516 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16517
16518         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16519         definitions. 
16520
16521         (Method): Allow UNSAFE here.
16522
16523         * modifiers.cs: Support unsafe reporting.
16524
16525 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16526
16527         * decl.cs: Fix bug #58478.
16528
16529 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16530
16531         * statement.cs: When checking for unreachable code on an EmptyStatement,
16532         set the location. Fixes bug #58488.
16533
16534 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16535
16536         * driver.cs: Add -pkg handling.
16537
16538         From Gonzalo: UseShelLExecute=false
16539
16540 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16541
16542         * attribute.cs:
16543         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16544         for attribute.
16545         (Attribute.IsClsCompliaceRequired): Moved to base for better
16546         accesibility.
16547         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16548         when attribute is AttributeUsageAttribute.
16549         (Attribute.GetValidTargets): Simplified.
16550         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16551         attribute for this type.
16552         (Attribute.ApplyAttributes): Method renamed to Emit and make
16553         non-static.
16554         (GlobalAttributeSection): New class for special handling of global
16555         attributes (assembly, module).
16556         (AttributeSection.Emit): New method.
16557
16558         * class.cs: Implemented Attributable abstract methods.
16559         (MethodCore.LabelParameters): Moved to Parameter class.
16560         (Accessor): Is back simple class.
16561         (PropertyMethod): Implemented Attributable abstract class.
16562         (DelegateMethod): Implemented Attributable abstract class.
16563         (Event): New constructor for disctintion between normal Event
16564         and Event with accessors.
16565
16566         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16567
16568         * codegen.cs, const.cs, decl.cs, delegate.cs:
16569         (CommonAssemblyModulClass): Implemented Attributable abstract class
16570         and simplified.
16571
16572         * enum.cs: Implement IAttributeSupport interface.
16573         (EnumMember): New class for emum members. Implemented Attributable
16574         abstract class
16575
16576         * parameter.cs:
16577         (ParameterBase): Is abstract.
16578         (ReturnParameter): New class for easier [return:] attribute handling.
16579
16580         * typemanager.cs: Removed builder_to_attr.
16581
16582 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16583
16584         Fix bug #57151.
16585         * attribute.cs (Attribute.GetPositionalValue): New function.
16586         * class.cs (TypeContainer.VerifyMembers): New function.
16587         (TypeContainer.Emit): Use it.
16588         (ClassOrStruct): New base class for Class and Struct.
16589         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16590         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16591         class.
16592         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16593         then each non-static field should have a FieldOffset attribute.
16594         Otherwise, none of the fields should have a FieldOffset attribute.
16595         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16596         and FieldOffset attributes.
16597         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16598         (TypeManager.field_offset_attribute_type): New core types.
16599         (TypeManager.InitCoreTypes): Initialize them.
16600
16601 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16602
16603         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16604         Return correct type.
16605         From bug #58270.
16606
16607 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16608
16609         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16610         be implicitly converted to ulong.
16611         
16612         * expression.cs: The logic for allowing operator &, | and ^ worked
16613         was wrong, it worked before because we did not report an error in
16614         an else branch.  Fixes 57895.
16615
16616         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16617         allow volatile fields to be reference types.
16618
16619 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16620
16621         * driver.cs: Add support for /debug-
16622
16623 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16624
16625         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16626         Add a 'complain' parameter to silence errors.
16627         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16628         silently overlooked type-resolutions.
16629         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16630         to reflect changes.
16631         (Attributes.Search): New function.
16632         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16633         (Attributes.GetAttributeFullName): Remove hack.
16634         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16635         Update to reflect changes.
16636         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16637         Use Attributes.Search instead of nested loops.
16638
16639 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16640
16641         * decl.cs:
16642         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16643         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16644         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16645
16646         * report.cs: (Report.Warning): Renamed to Warning_T because of
16647         parameter collision.
16648
16649 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16650
16651         * expression.cs (MemberAccess.ResolveMemberAccess):
16652         Exit with non-zero status after Report.Error.
16653         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16654         Likewise.
16655         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16656
16657 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16658
16659         * support.cs: Don't hang when the file is empty.
16660
16661 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16662
16663         * support.cs: In SeekableStreamReader, compute the preamble size of the
16664           underlying stream. Position changes should take into account that initial
16665           count of bytes.
16666
16667 2004-05-03  Todd Berman  <tberman@sevenl.net>
16668
16669         * driver.cs: remove unused GetSysVersion function.
16670
16671 2004-05-03  Todd Berman  <tberman@sevenl.net>
16672
16673         * driver.cs: Remove the hack from saturday, as well as the hack
16674         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16675         link_paths to get that bit proper.
16676
16677 2004-05-01  Todd Berman  <tberman@sevenl.net>
16678
16679         * driver.cs: Try a LoadFrom before a Load, this checks the current
16680         path. This is currently a bug in mono that is be fixed, however, this
16681         provides a workaround for now. This will be removed when the bug
16682         is fixed.
16683
16684 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16685
16686         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16687         incomplete key pairs (#57941).
16688
16689 2004-05-01  Todd Berman  <tberman@sevenl.net>
16690
16691         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16692         from the GAC
16693
16694 2004-04-30  Jackson Harper  <jackson@ximian.com>
16695
16696         * codegen.cs: Open keys readonly.
16697         
16698 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16699
16700         * typemanager.cs: don't report cyclic struct layout when a struct
16701         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16702         which has 2 Pango.Rectangle fields.
16703
16704 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16705
16706         * expression.cs: Handle IntPtr comparisons with IL code
16707         rather than a method call.
16708
16709 2004-04-29  Martin Baulig  <martin@ximian.com>
16710
16711         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16712         the list of PropertyInfo's in class hierarchy and find the
16713         accessor.  Fixes #56013.
16714
16715 2004-04-29  Martin Baulig  <martin@ximian.com>
16716
16717         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16718
16719 2004-04-29  Martin Baulig  <martin@ximian.com>
16720
16721         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16722
16723         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16724
16725 2004-04-29  Martin Baulig  <martin@ximian.com>
16726
16727         * class.cs (ConstructorInitializer.Resolve): Check whether the
16728         parent .ctor is accessible.  Fixes #52146.
16729
16730 2004-04-29  Martin Baulig  <martin@ximian.com>
16731
16732         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16733
16734         * statement.cs (Using.EmitLocalVariableDecls): Use
16735         TypeManager.idisposable_type, not typeof (IDisposable).
16736         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16737
16738 2004-04-29  Martin Baulig  <martin@ximian.com>
16739
16740         * class.cs (Event.Define): Don't emit the field and don't set
16741         RTSpecialName and SpecialName for events on interfaces.  Fixes
16742         #57703. 
16743
16744 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16745
16746         Refactor Attribute.ApplyAttributes.
16747         * attribute.cs (Attributable): New base class for objects that can
16748         have Attributes applied on them.
16749         (Attribute): Make AttributeUsage fields public.
16750         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16751         (Attribute.IsInternalCall): New property.
16752         (Attribute.UsageAttr): Convert to a public read-only property.
16753         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16754         (Attribute.ResolveType, Attribute.Resolve)
16755         (Attribute.ScanForIndexerName): Update to reflect changes.
16756         (Attribute.CheckAttributeTarget): Re-format.
16757         (Attribute.ApplyAttributes): Refactor, to various
16758         Attributable.ApplyAttributeBuilder methods.
16759         * decl.cs (MemberCore): Make Attributable.
16760         * class.cs (Accessor): Make Attributable.
16761         (MethodData.ApplyAttributes): Use proper attribute types, not
16762         attribute names.
16763         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16764         (TypeContainer.ApplyAttributeBuilder)
16765         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16766         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16767         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16768         (Operator.ApplyAttributeBuilder): New factored-out methods.
16769         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16770         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16771         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16772         * parameter.cs (ParameterBase): New Attributable base class
16773         that can also represent Return types.
16774         (Parameter): Update to the changes.
16775
16776 2004-04-29  Jackson Harper  <jackson@ximian.com>
16777
16778         * driver.cs: Prefer the corlib system version when looking for
16779         assemblies in the GAC. This is still a hack, but its a better hack
16780         now.
16781         
16782 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16783
16784         * decl.cs, enum.cs: Improved error 3005 reporting.
16785   
16786         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16787         (related_symbols): New private member for list of symbols
16788         related to reported error/warning.
16789         
16790         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16791
16792 2004-04-29  Martin Baulig  <martin@ximian.com>
16793
16794         * ecore.cs (Expression.Constantify): If we're an enum and
16795         TypeManager.TypeToCoreType() doesn't give us another type, use
16796         t.UnderlyingSystemType.  Fixes #56178.  
16797
16798 2004-04-29  Martin Baulig  <martin@ximian.com>
16799
16800         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16801         interfaces and for each interface, only add members directly
16802         declared in that interface.  Fixes #53255.
16803
16804 2004-04-28  Martin Baulig  <martin@ximian.com>
16805
16806         * expression.cs (ConditionalLogicalOperator): Use a temporary
16807         variable for `left' to avoid that we evaluate it more than once;
16808         bug #52588.
16809
16810 2004-04-28  Martin Baulig  <martin@ximian.com>
16811
16812         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16813         `void[]' (CS1547).
16814
16815 2004-04-28  Martin Baulig  <martin@ximian.com>
16816
16817         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16818         void (CS1547).
16819
16820         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16821         whether the type is not void (CS1547).
16822
16823 2004-04-28  Martin Baulig  <martin@ximian.com>
16824
16825         * expression.cs (Unary.DoResolveLValue): Override this and report
16826         CS0131 for anything but Operator.Indirection.
16827
16828 2004-04-28  Martin Baulig  <martin@ximian.com>
16829
16830         Committing a patch from Ben Maurer; see bug #50820.
16831
16832         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16833         check for classes.
16834
16835         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16836         classes.        
16837
16838 2004-04-28  Martin Baulig  <martin@ximian.com>
16839
16840         Committing a patch from Ben Maurer; see bug #50820.
16841
16842         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16843         check for classes.
16844
16845         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16846         classes.        
16847
16848 2004-04-28  Martin Baulig  <martin@ximian.com>
16849
16850         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16851         (Block.AddLabel): Call DoLookupLabel() to only search in the
16852         current block.
16853
16854 2004-04-28  Martin Baulig  <martin@ximian.com>
16855
16856         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16857         comparing StringConstants and NullLiterals in Equality and Inequality.
16858
16859 2004-04-28  Jackson Harper  <jackson@ximian.com>
16860
16861         * driver.cs: Attempt to load referenced assemblies from the
16862         GAC. This is the quick and dirty version of this method that
16863         doesnt take into account versions and just takes the first
16864         canidate found. Will be good enough for now as we will not have more
16865         then one version installed into the GAC until I update this method.
16866
16867 2004-04-28  Martin Baulig  <martin@ximian.com>
16868
16869         * typemanager.cs (TypeManager.CheckStructCycles): New public
16870         static method to check for cycles in the struct layout.
16871
16872         * rootcontext.cs (RootContext.PopulateTypes): Call
16873         TypeManager.CheckStructCycles() for each TypeContainer.
16874         [Note: We only need to visit each type once.]
16875
16876 2004-04-28  Martin Baulig  <martin@ximian.com>
16877
16878         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16879
16880         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16881         success and added `out object value'.  Use a `bool resolved' field
16882         to check whether we've already been called rather than
16883         `ConstantValue != null' since this breaks for NullLiterals.
16884
16885 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16886
16887         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16888         setting of this flag, since the 'set' method may be non-public.
16889
16890 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16891
16892         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16893         check on current_vector.Block.
16894
16895 2004-04-27  Martin Baulig  <martin@ximian.com>
16896
16897         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16898         a field initializer.  Fixes #56459.
16899
16900 2004-04-27  Martin Baulig  <martin@ximian.com>
16901
16902         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16903         we're not attempting to use an indexer.  Fixes #52154.
16904
16905 2004-04-27  Martin Baulig  <martin@ximian.com>
16906
16907         * statement.cs (Return): Don't create a return label if we don't
16908         need it; reverts my change from January 20th.  Thanks to Ben
16909         Maurer for this.
16910
16911 2004-04-27  Martin Baulig  <martin@ximian.com>
16912
16913         According to the spec, `goto' can only leave a nested scope, but
16914         never enter it.
16915
16916         * statement.cs (Block.LookupLabel): Only lookup in the current
16917         block, don't recurse into parent or child blocks.
16918         (Block.AddLabel): Check in parent and child blocks, report
16919         CS0140/CS0158 if we find a duplicate.
16920         (Block): Removed this indexer for label lookups.
16921         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16922         this already does the error reporting for us.
16923
16924         * flowanalysis.cs
16925         (FlowBranching.UsageVector.Block): New public variable; may be null.
16926         (FlowBranching.CreateSibling): Added `Block' argument.
16927         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
16928         label for the target of a `goto' and check whether we're not
16929         leaving a `finally'.
16930
16931 2004-04-27  Martin Baulig  <martin@ximian.com>
16932
16933         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16934         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16935         just for returns).
16936
16937 2004-04-27  Martin Baulig  <martin@ximian.com>
16938
16939         * statement.cs (Block.AddLabel): Also check for implicit blocks
16940         and added a CS0158 check.
16941
16942 2004-04-27  Martin Baulig  <martin@ximian.com>
16943
16944         * flowanalysis.cs (FlowBranchingLoop): New class.
16945         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16946         UsageVector's instead of an ArrayList.
16947         (FlowBranching.Label): Likewise.
16948         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16949         (FlowBranching.AddBreakVector): New method.
16950
16951 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
16952
16953         * attribute.cs: Small regression fix: only convert the type if we
16954         the type is different, fixes System.Drawing build.
16955
16956 2004-04-27  Martin Baulig  <martin@ximian.com>
16957
16958         * attribute.cs (Attribute.Resolve): If we have a constant value
16959         for a named field or property, implicity convert it to the correct
16960         type.
16961
16962 2004-04-27  Raja R Harinath  <rharinath@novell.com>
16963
16964         * statement.cs (Block.Block): Implicit blocks share
16965         'child_variable_names' fields with parent blocks.
16966         (Block.AddChildVariableNames): Remove.
16967         (Block.AddVariable): Mark variable as "used by a child block" in
16968         every surrounding block.
16969         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16970         been used in a child block, complain about violation of "Invariant
16971         meaning in blocks" rule.
16972         * cs-parser.jay (declare_local_variables): Don't use
16973         AddChildVariableNames.
16974         (foreach_statement): Don't create an implicit block: 'foreach'
16975         introduces a scope.
16976
16977 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
16978
16979         * convert.cs (ImplicitNumericConversion): 0 is also positive when
16980         converting from 0L to ulong.  Fixes 57522.
16981
16982 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16983
16984         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16985         derived class hides via 'new' keyword field from base class (test-242.cs).
16986         TODO: Handle this in the more general way.
16987         
16988         * class.cs (CheckBase): Ditto.
16989
16990 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16991
16992         * decl.cs (caching_flags): New member for storing cached values
16993         as bit flags.
16994         (MemberCore.Flags): New enum where bit flags for caching_flags
16995         are defined.
16996         (MemberCore.cls_compliance): Moved to caching_flags.
16997         (DeclSpace.Created): Moved to caching_flags.
16998
16999         * class.cs: Use caching_flags instead of DeclSpace.Created
17000         
17001 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17002
17003         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17004         if we are only a derived class, not a nested class.
17005
17006         * typemanager.cs: Same as above, but do this at the MemberLookup
17007         level (used by field and methods, properties are handled in
17008         PropertyExpr).   Allow for the qualified access if we are a nested
17009         method. 
17010
17011 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17012
17013         * class.cs: Refactoring.
17014         (IMethodData): New inteface; Holds links to parent members
17015         to avoid member duplication (reduced memory allocation).
17016         (Method): Implemented IMethodData interface.
17017         (PropertyBase): New inner classes for get/set methods.
17018         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17019         (Event): New inner classes for add/remove methods.
17020         (Event.DelegateMethod): Implemented IMethodData interface.
17021
17022         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17023         EmitContext (related to class.cs refactoring).
17024
17025 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17026
17027         * delegate.cs (Delegate.VerifyApplicability): If the number of
17028         arguments are the same as the number of parameters, first try to
17029         verify applicability ignoring  any 'params' modifier on the last
17030         parameter.
17031         Fixes #56442.
17032
17033 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17034
17035         * class.cs (TypeContainer.AddIndexer): Use
17036         'ExplicitInterfaceName' to determine if interface name was
17037         explicitly specified.  'InterfaceType' is not initialized at this time.
17038         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17039         Indexers array is already in the required order.  Initialize
17040         'IndexerName' only if there are normal indexers.
17041         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17042         (TypeContainer.Emit): Emit DefaultMember attribute only if
17043         IndexerName is initialized.
17044         Fixes #56300.
17045
17046 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17047
17048         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17049         Fixes #57007
17050
17051 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17052
17053         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17054         attributes.
17055         Fix for #56456.
17056
17057         * attribute.cs (Attribute.Resolve): Check for duplicate named
17058         attributes.
17059         Fix for #56463.
17060
17061 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17062
17063         * iterators.cs (MarkYield): track whether we are in an exception,
17064         and generate code accordingly.  Use a temporary value to store the
17065         result for our state.
17066
17067         I had ignored a bit the interaction of try/catch with iterators
17068         since their behavior was not entirely obvious, but now it is
17069         possible to verify that our behavior is the same as MS .NET 2.0
17070
17071         Fixes 54814
17072
17073 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17074
17075         * iterators.cs: Avoid creating temporaries if there is no work to
17076         do. 
17077
17078         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17079         Enumerations, use TypeManager.EnumToUnderlying and call
17080         recursively. 
17081
17082         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17083         bug #57013
17084
17085         (This.Emit): Use EmitContext.EmitThis to emit our
17086         instance variable.
17087
17088         (This.EmitAssign): Ditto.
17089
17090         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17091         codepaths, we will move all the functionality into
17092         Mono.CSharp.This 
17093
17094         (FieldExpr.EmitAssign): Ditto.
17095
17096         This fixes several hidden bugs that I uncovered while doing a code
17097         review of this today.
17098
17099         * codegen.cs (EmitThis): reworked so the semantics are more clear
17100         and also support value types "this" instances.
17101
17102         * iterators.cs: Changed so that for iterators in value types, we
17103         do not pass the value type as a parameter.  
17104
17105         Initialization of the enumerator helpers is now done in the caller
17106         instead of passing the parameters to the constructors and having
17107         the constructor set the fields.
17108
17109         The fields have now `assembly' visibility instead of private.
17110
17111 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17112
17113         * expression.cs (Argument.Resolve): Check if fields passed as ref
17114         or out are contained in a MarshalByRefObject.
17115
17116         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17117         another compiler type.
17118
17119 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17120
17121         * class.cs (Indexer.Define): use the new name checking method.
17122         Also, return false on an error.
17123         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17124         (is_identifier_[start/part]_character): make static.
17125
17126 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17127
17128         * expression.cs (Binary.ResolveOperator): Do no append strings
17129         twice: since we can be invoked more than once (array evaluation)
17130         on the same concatenation, take care of this here.  Based on a fix
17131         from Ben (bug #56454)
17132
17133 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17134
17135         * codegen.cs: Fix another case where CS1548 must be reported (when 
17136         delay-sign isn't specified and no private is available #56564). Fix
17137         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17138         error when MCS is used on the MS runtime and we need to delay-sign 
17139         (which seems unsupported by AssemblyBuilder - see #56621).
17140
17141 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17142
17143         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17144         (TypeManager.ComputeNamespaces): Faster implementation for
17145         Microsoft runtime.
17146
17147         * compiler.csproj: Updated AssemblyName to mcs.
17148
17149 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17150
17151         * rootcontext.cs: Add new types to the boot resolution.
17152
17153         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17154         MulticastDelegate is not allowed.
17155
17156         * typemanager.cs: Add new types to lookup: System.TypedReference
17157         and ArgIterator.
17158
17159         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17160         check for TypedReference or ArgIterator, they are not allowed. 
17161
17162         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17163         makes us properly catch 1510 in some conditions (see bug 56016 for
17164         details). 
17165
17166 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17167
17168         * CryptoConvert.cs: update from corlib version
17169         with endian fixes.
17170
17171 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17172
17173         * class.cs (Indexer.Define): Check indexername declaration
17174
17175 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17176
17177         * attribute.cs (IsClsCompliant): Fixed problem with handling
17178         all three states (compliant, not-compliant, undetected).
17179
17180 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17181
17182         * attribute.cs (Attribute): Location is now public.
17183         (Resolve): Store resolved arguments (pos_values) in attribute class.
17184         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17185         (GetClsCompliantAttributeValue): New method that gets
17186         CLSCompliantAttribute value.
17187         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17188         if exists else null.
17189         (AttributeTester): New class for CLS-Compliant verification routines.
17190
17191         * class.cs (Emit): Add CLS-Compliant verification.
17192         (Method.GetSignatureForError): Implemented.
17193         (Constructor.GetSignatureForError): Implemented
17194         (Constructor.HasCompliantArgs): Returns if constructor has
17195         CLS-Compliant arguments.
17196         (Constructor.Emit): Override.
17197         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17198         is needed to test only parameters.
17199         (FieldBase.GetSignatureForError): Implemented.
17200         (TypeContainer): New member for storing base interfaces.
17201         (TypeContainer.FindMembers): Search in base interfaces too.
17202
17203         * codegen.cs (GetClsComplianceAttribute): New method that gets
17204         assembly or module CLSCompliantAttribute value.
17205         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17206         for assembly.
17207         (ModuleClass.Emit): Add error 3012 test.
17208
17209         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17210
17211         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17212         state for all decl types.
17213         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17214         if CLS-Compliant tests are required.
17215         (IsClsCompliaceRequired): New method. Analyze whether code
17216         must be CLS-Compliant.
17217         (IsExposedFromAssembly): New method. Returns true when MemberCore
17218         is exposed from assembly.
17219         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17220         value or gets cached value.
17221         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17222         is explicitly marked with CLSCompliantAttribute.
17223         (IsIdentifierClsCompliant): New abstract method. This method is
17224         used to testing error 3005.
17225         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17226         for identifier and parameters CLS-Compliant testing.
17227         (VerifyClsCompliance): New method. The main virtual method for
17228         CLS-Compliant verifications.
17229         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17230         null. I don't know why is null (too many public members !).
17231         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17232         and get value of first CLSCompliantAttribute that found.
17233
17234         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17235         (VerifyClsCompliance): Override and add extra tests.
17236
17237         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17238         clscheck- disable CLS-Compliant verification event if assembly is has
17239         CLSCompliantAttribute(true).
17240
17241         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17242         ApllyAttribute is now called in emit section as in the other cases.
17243         Possible future Emit integration.
17244         (IsIdentifierClsCompliant): New override.
17245         (VerifyClsCompliance): New override.
17246         (GetEnumeratorName): Returns full enum name.
17247
17248         * parameter.cs (GetSignatureForError): Implemented.
17249
17250         * report.cs (WarningData): New struct for Warning message information.
17251         (LocationOfPreviousError): New method.
17252         (Warning): New method. Reports warning based on the warning table.
17253         (Error_T): New method. Reports error based on the error table.
17254
17255         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17256         verifications are done here.
17257
17258         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17259
17260         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17261         CLSCompliantAttribute.
17262         (all_imported_types): New member holds all imported types from other
17263         assemblies.
17264         (LoadAllImportedTypes): New method fills static table with exported types
17265         from all referenced assemblies.
17266         (Modules): New property returns all assembly modules.
17267
17268 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17271         throwing a parser error.
17272
17273         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17274         which removes the hardcoded get_/set_ prefixes for properties, as
17275         IL allows for the properties to be named something else.  
17276
17277         Bug #56013
17278
17279         * expression.cs: Do not override operand before we know if it is
17280         non-null.  Fix 56207
17281
17282 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17283
17284         * typemanager.cs: support for pinned variables.
17285
17286 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17287
17288         * decl.cs, typemanager.cs: Avoid using an arraylist
17289         as a buffer if there is only one result set.
17290
17291 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17292
17293         * expression.cs: Make sure you cant call a static method
17294         with an instance expression, bug #56174.
17295
17296 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17297
17298         * class.cs (IsDuplicateImplementation): Improve error reporting to
17299         flag 663 (method only differs in parameter modifier).
17300
17301         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17302         in preprocessor directives.
17303
17304         * location.cs (LookupFile): Allow for the empty path.
17305
17306         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17307         better approach for some of that patch, but its failing with the
17308         CharSet enumeration.  For now try/catch will do.
17309
17310         * typemanager.cs: Do not crash if a struct does not have fields.
17311         Fixes 56150.
17312
17313 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17314
17315         * expression.cs: cs0213, cant fix a fixed expression.
17316         fixes 50231.
17317
17318 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17319
17320         * cs-parser.jay: detect invalid embeded statements gracefully.
17321         bug #51113.
17322
17323 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17324
17325         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17326         As a regex:
17327         s/
17328         the invocation type may not be a subclass of the tye of the item/
17329         The type of the item must be a subclass of the invocation item.
17330         /g
17331
17332         Fixes bug #50820.
17333
17334 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17335
17336         * attribute.cs: Added methods to get a string and a bool from an
17337         attribute. Required to information from AssemblyKeyFileAttribute,
17338         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17339         * codegen.cs: Modified AssemblyName creation to include support for
17340         strongnames. Catch additional exceptions to report them as CS1548.
17341         * compiler.csproj: Updated include CryptoConvert.cs.
17342         * compiler.csproj.user: Removed file - user specific configuration.
17343         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17344         Mono.Security assembly. The original class is maintained and tested in
17345         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17346         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17347         like CSC 8.0 (C# v2) supports.
17348         * Makefile: Added CryptoConvert.cs to mcs sources.
17349         * rootcontext.cs: Added new options for strongnames.
17350
17351 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17352
17353         * driver.cs: For --expect-error, report error code `2'
17354         if the program compiled with no errors, error code `1' if
17355         it compiled with an error other than the one expected.
17356
17357 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17358
17359         * compiler.csproj: Updated for Visual Studio .NET 2003.
17360         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17361         * compiler.sln: Updated for Visual Studio .NET 2003.
17362
17363 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17364
17365         * expression.cs: Fix bug #47234. We basically need to apply the
17366         rule that we prefer the conversion of null to a reference type
17367         when faced with a conversion to 'object' (csc behaviour).
17368
17369 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17370
17371         * statement.cs: Shorter form for foreach, eliminates
17372         a local variable. r=Martin.
17373
17374 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17375
17376         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17377         checks if we can use brtrue/brfalse to test for 0.
17378         * expression.cs: use the above in the test for using brtrue/brfalse.
17379         cleanup code a bit.
17380
17381 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17382
17383         * expression.cs: Rewrite string concat stuff. Benefits:
17384
17385         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17386         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17387         rather than a concat chain.
17388
17389         * typemanager.cs: Add lookups for more concat overloads.
17390
17391 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17392
17393         * expression.cs: Emit shorter il code for array init.
17394
17395         newarr
17396         dup
17397         // set 1
17398
17399         // set 2
17400
17401         newarr
17402         stloc.x
17403
17404         ldloc.x
17405         // set 1
17406
17407         ldloc.x
17408         // set 2
17409
17410 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17411
17412         * statement.cs: Before, two switch blocks would be merged if the
17413         total size of the blocks (end_item - begin_item + 1) was less than
17414         two times the combined sizes of the blocks.
17415
17416         Now, it will only merge if after the merge at least half of the
17417         slots are filled.
17418
17419         fixes 55885.
17420
17421 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
17422
17423         * class.cs : csc build fix for GetMethods(). See bug #52503.
17424
17425 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
17426
17427         * expression.cs: Make sure fp comparisons work with NaN.
17428         This fixes bug #54303. Mig approved this patch a long
17429         time ago, but we were not able to test b/c the runtime
17430         had a related bug.
17431
17432 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
17435
17436 2004-03-19  Martin Baulig  <martin@ximian.com>
17437
17438         * class.cs (MemberCore.IsDuplicateImplementation): Report the
17439         error here and not in our caller.
17440
17441 2004-03-19  Martin Baulig  <martin@ximian.com>
17442
17443         * interface.cs: Completely killed this file.
17444         (Interface): We're now a TypeContainer and live in class.cs.
17445
17446         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17447         argument; we're now also called for interfaces.
17448         (TypeContainer.DefineMembers): Allow this method being called
17449         multiple times.
17450         (TypeContainer.GetMethods): New public method; formerly known as
17451         Interface.GetMethod().  This is used by PendingImplementation.
17452         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17453         it's now private and non-static.
17454         (Interface): Moved this here; it's now implemented similar to
17455         Class and Struct.
17456         (Method, Property, Event, Indexer): Added `bool is_interface'
17457         argument to their .ctor's.
17458         (MemberBase.IsInterface): New public field.
17459
17460         * cs-parser.jay: Create normal Method, Property, Event, Indexer
17461         instances instead of InterfaceMethod, InterfaceProperty, etc.
17462         (opt_interface_base): Removed; we now use `opt_class_base' instead.
17463         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17464
17465 2004-03-19  Martin Baulig  <martin@ximian.com>
17466
17467         * class.cs (MethodCore.IsDuplicateImplementation): New private
17468         method which does the CS0111 checking.
17469         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17470         Use IsDuplicateImplementation().
17471
17472 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17473
17474         * decl.cs (FindMemberToOverride): New method to find the correct
17475         method or property to override in the base class.
17476         * class.cs
17477             - Make Method/Property use the above method to find the
17478               version in the base class.
17479             - Remove the InheritableMemberSignatureCompare as it is now
17480               dead code.
17481
17482         This patch makes large code bases much faster to compile, as it is
17483         O(n) rather than O(n^2) to do this validation.
17484
17485         Also, it fixes bug 52458 which is that nested classes are not
17486         taken into account when finding the base class member.
17487
17488         Reviewed/Approved by Martin.
17489
17490 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
17491
17492         * interface.cs: In all interface classes removed redundant
17493         member initialization.
17494
17495 2004-03-16  Martin Baulig  <martin@ximian.com>
17496
17497         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17498
17499 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
17500
17501         * decl.cs (DefineTypeAndParents): New helper method to define a
17502         type's containers before the type itself is defined;  This is a
17503         bug exposed by the recent changes to Windows.Forms when an
17504         implemented interface was defined inside a class that had not been
17505         built yet.   
17506
17507         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17508
17509         (Check): Loop correctly to report errors modifiers
17510         (UNSAFE was not in the loop, since it was the same as TOP).
17511
17512         * interface.cs: Every interface member now takes a ModFlags,
17513         instead of a "is_new" bool, which we set on the base MemberCore. 
17514
17515         Every place where we called "UnsafeOk" in the interface, now we
17516         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17517         the unsafe settings from the member declaration instead of the
17518         container interface. 
17519
17520         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17521
17522         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17523         `set_indexer_name' to the pending bits (one per type).
17524
17525         We fixed a bug today that was picking the wrong method to
17526         override, since for properties the existing InterfaceMethod code
17527         basically ignored the method name.  Now we make sure that the
17528         method name is one of the valid indexer names.
17529
17530 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17531  
17532         * support.cs (SeekableStreamReader): Keep track of stream byte
17533         positions and don't mix them with character offsets to the buffer.
17534
17535         Patch from Gustavo Giráldez
17536
17537 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17538
17539         * interface.cs (InterfaceSetGetBase): Removed double member
17540         initialization, base class does it as well.
17541
17542 2004-03-13  Martin Baulig  <martin@ximian.com>
17543
17544         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17545         when compiling corlib.
17546
17547 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17548
17549         * convert.cs (ExplicitConversion): We were reporting an error on
17550         certain conversions (object_type source to a value type, when the
17551         expression was `null') before we had a chance to pass it through
17552         the user defined conversions.
17553
17554         * driver.cs: Replace / and \ in resource specifications to dots.
17555         Fixes 50752
17556
17557         * class.cs: Add check for duplicate operators.  Fixes 52477
17558
17559 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17560
17561         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17562         that are in the middle of the statements, not only at the end.
17563         Fixes #54987
17564
17565         * class.cs (TypeContainer.AddField): No longer set the
17566         `HaveStaticConstructor' flag, now we call it
17567         `UserDefineStaticConstructor' to diferentiate the slightly
17568         semantic difference.
17569
17570         The situation is that we were not adding BeforeFieldInit (from
17571         Modifiers.TypeAttr) to classes that could have it.
17572         BeforeFieldInit should be set to classes that have no static
17573         constructor. 
17574
17575         See:
17576
17577         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17578
17579         And most importantly Zoltan's comment:
17580
17581         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17582
17583         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17584          before its static fields are used', i.e. initialization does not need
17585          to be triggered by the first access to the type. Setting this flag
17586          helps the JIT to compile better code, since it can run the static
17587          constructor at JIT time, and does not need to generate code to call it
17588          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17589          this flag for lots of classes like String. 
17590          
17591          csc sets this flag if the type does not have an explicit static 
17592          constructor. The reasoning seems to be that if there are only static
17593          initalizers for a type, and no static constructor, then the programmer
17594          does not care when this initialization happens, so beforefieldinit
17595          can be used.
17596          
17597          This bug prevents the AOT compiler from being usable, since it 
17598          generates so many calls to mono_runtime_class_init that the AOT code
17599          is much slower than the JITted code. The JITted code is faster, 
17600          because it does not generate these calls if the vtable is type is
17601          already initialized, which is true in the majority of cases. But the
17602          AOT compiler can't do this."
17603
17604 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17605
17606         * class.cs (MethodData.Emit): Refactor the code so symbolic
17607         information is generated for destructors;  For some reasons we
17608         were taking a code path that did not generate symbolic information
17609         before. 
17610
17611 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17612
17613         * class.cs: Create a Constructor.CheckBase method that
17614         takes care of all validation type code. The method
17615         contains some code that was moved from Define.
17616
17617         It also includes new code that checks for duplicate ctors.
17618         This fixes bug #55148.
17619
17620 2004-03-09  Joshua Tauberer <tauberer@for.net>
17621
17622         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17623         a { ... }-style array creation invokes EmitStaticInitializers
17624         which is not good for reference-type arrays.  String, decimal
17625         and now null constants (NullCast) are not counted toward
17626         static initializers.
17627
17628 2004-03-05  Martin Baulig  <martin@ximian.com>
17629
17630         * location.cs (SourceFile.HasLineDirective): New public field;
17631         specifies whether the file contains or is referenced by a "#line"
17632         directive.
17633         (Location.DefineSymbolDocuments): Ignore source files which
17634         either contain or are referenced by a "#line" directive.        
17635
17636 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17637
17638         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17639         direct access to our parent, so check the method inline there.
17640
17641 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17642
17643         * expression.cs (Invocation.EmitCall): Miguel's last commit
17644         caused a regression. If you had:
17645
17646             T t = null;
17647             t.Foo ();
17648
17649         In Foo the implict this would be null.
17650
17651 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17652
17653         * expression.cs (Invocation.EmitCall): If the method is not
17654         virtual, do not emit a CallVirt to it, use Call.
17655
17656         * typemanager.cs (GetFullNameSignature): Improve the method to
17657         cope with ".ctor" and replace it with the type name.
17658
17659         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17660         as an argument the ConstructorBuilder where it is being defined,
17661         to catch the recursive constructor invocations.
17662
17663 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17664
17665         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17666         routines to check if a type is an enumerable/enumerator allow
17667         classes that implement the IEnumerable or IEnumerator interfaces.
17668
17669         * class.cs (Property, Operator): Implement IIteratorContainer, and
17670         implement SetYields.
17671
17672         (Property.Define): Do the block swapping for get_methods in the
17673         context of iterators.   We need to check if Properties also
17674         include indexers or not.
17675
17676         (Operator): Assign the Block before invoking the
17677         OperatorMethod.Define, so we can trigger the Iterator code
17678         replacement. 
17679
17680         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17681         Property and Operator classes are not created when we parse the
17682         declarator but until we have the block completed, so we use a
17683         singleton SimpleIteratorContainer.Simple to flag whether the
17684         SetYields has been invoked.
17685
17686         We propagate this setting then to the Property or the Operator to
17687         allow the `yield' to function.
17688
17689 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17690
17691         * codegen.cs: Implemented attribute support for modules.
17692         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17693         Assembly/Module functionality.
17694
17695         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17696         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17697         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17698
17699 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17700
17701         * interface.cs (FindMembers): The operation is performed on all base
17702         interfaces and not only on the first. It is required for future CLS Compliance patch.
17703
17704 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17705
17706         * statement.cs, codegen.cs:
17707         This patch deals with patterns such as:
17708
17709         public class List : IEnumerable {
17710
17711                 public MyEnumerator GetEnumerator () {
17712                         return new MyEnumerator(this);
17713                 }
17714
17715                 IEnumerator IEnumerable.GetEnumerator () {
17716                         ...
17717                 }
17718                 
17719                 public struct MyEnumerator : IEnumerator {
17720                         ...
17721                 }
17722         }
17723
17724         Before, there were a few things we did wrong:
17725         1) we would emit callvirt on a struct, which is illegal
17726         2) we emited ldarg when we needed to emit ldarga
17727         3) we would mistakenly call the interface methods on an enumerator
17728         type that derived from IEnumerator and was in another assembly. For example:
17729
17730         public class MyEnumerator : IEnumerator
17731
17732         Would have the interface methods called, even if there were public impls of the
17733         method. In a struct, this lead to invalid IL code.
17734
17735 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17736
17737         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17738           renamed to Emit.
17739
17740         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17741
17742 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17743
17744         * cs-parser.jay: Fix small regression: we were not testing V2
17745         compiler features correctly.
17746
17747         * interface.cs: If the emit context is null, then create one
17748
17749 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17750
17751         * decl.cs (GetSignatureForError): New virtual method to get full name
17752           for error messages.
17753
17754         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17755           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17756
17757         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17758           Duplicated members and code in these classes has been removed.
17759           Better encapsulation in these classes.
17760
17761 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * assign.cs (Assign.DoResolve): When dealing with compound
17764         assignments, there is a new rule in ECMA C# 2.4 (might have been
17765         there before, but it is documented here) that states that in:
17766
17767         a op= b;
17768
17769         If b is of type int, and the `op' is a shift-operator, then the
17770         above is evaluated as:
17771
17772         a = (int) a op b 
17773
17774         * expression.cs (Binary.ResolveOperator): Instead of testing for
17775         int/uint/long/ulong, try to implicitly convert to any of those
17776         types and use that in pointer arithmetic.
17777
17778         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17779         method to print information for from the type, not from the
17780         null-method we were given.
17781
17782 2004-02-01  Duncan Mak  <duncan@ximian.com>
17783
17784         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17785         parsing for cmd, fixes bug #53694.
17786
17787 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17788
17789         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17790         in the member name duplication tests. Property and operator name duplication
17791         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17792
17793 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17794
17795         * interface.cs (PopulateMethod): Fixed crash when interface method
17796         returns not existing type (error test cs0246-3.cs).
17797
17798 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17799
17800         * cs-parser.jay (interface_accessors): Re-write actions to also
17801         store attributes attached to get and set methods. Fix spelling
17802         while at it.
17803
17804         (inteface_property_declaration): Modify accordingly.
17805
17806         (InterfaceAccessorInfo): New helper class to store information to pass
17807         around between rules that use interface_accessors.
17808
17809         * interface.cs (Emit): Apply attributes on the get and set
17810         accessors of properties and indexers too.
17811
17812         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17813         right MethodBuilder when applying attributes to the get and set accessors.
17814
17815 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17816
17817         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17818
17819 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17822
17823 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17824
17825         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17826         changes that treat `yield' specially when present before `break'
17827         or `return' tokens.
17828
17829         * cs-tokenizer.cs: yield is no longer a keyword.
17830
17831 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17832
17833         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17834         setting for default constructors.
17835         For default constructors are almost every time set wrong Modifier. The
17836         generated IL code has been alright. But inside mcs this values was
17837         wrong and this was reason why several of my CLS Compliance tests
17838         failed.
17839
17840 2004-01-22  Martin Baulig  <martin@ximian.com>
17841
17842         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17843         not a QualifiedIdentifier.  This is what `type_name_expression'
17844         was previously doing.
17845         (type_name_expression): Removed; the code is now in
17846         `namespace_or_type_name'.
17847         (qualified_identifier): Removed, use `namespace_or_type_name'
17848         instead.
17849         (QualifiedIdentifier): Removed this class.      
17850
17851 2004-01-22  Martin Baulig  <martin@ximian.com>
17852
17853         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17854         not a string as alias name.
17855
17856 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17857
17858         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17859         #52730 bug, and instead compute correctly the need to use a
17860         temporary variable when requesting an address based on the
17861         static/instace modified of the field and the constructor.
17862  
17863 2004-01-21  Martin Baulig  <martin@ximian.com>
17864
17865         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17866         class and namespace before looking up aliases.  Fixes #52517.
17867
17868 2004-01-21  Martin Baulig  <martin@ximian.com>
17869
17870         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17871         assinged in a 'try'; fixes exception4.cs.
17872
17873 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17874         * class.cs : Implemented parameter-less constructor for TypeContainer
17875
17876         * decl.cs: Attributes are now stored here. New property OptAttributes
17877
17878         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17879
17880         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17881
17882 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17883
17884         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17885           (CSharpSignature): New method for indexer and property signature.
17886
17887 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17888
17889         * pending.cs (IsVirtualFilter): Faster implementation.
17890
17891 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17892
17893         * typemanager.cs: Avoid inclusion of same assembly more than once.
17894
17895 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17896
17897         * cs-parser.jay: Fixed problem where the last assembly attribute
17898           has been applied also to following declaration (class, struct, etc.)
17899           
17900 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17901
17902         * class.cs: Added error CS0538, CS0539 reporting.
17903         Fixed crash on Microsoft runtime when field type is void.
17904
17905         * cs-parser.jay: Added error CS0537 reporting.
17906
17907         * pending.cs: Added error CS0535 reporting.
17908         Improved error report for errors CS0536, CS0534.
17909
17910 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
17911
17912         Merge a few bits from the Anonymous Method MCS tree.
17913
17914         * statement.cs (ToplevelBlock): New class for toplevel methods,
17915         will hold anonymous methods, lifted variables.
17916
17917         * cs-parser.jay: Create toplevel blocks for delegates and for
17918         regular blocks of code. 
17919
17920 2004-01-20  Martin Baulig  <martin@ximian.com>
17921
17922         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17923         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17924         and `NeedExplicitReturn'; added `IsLastStatement'.
17925         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17926         have a `ReturnLabel' or we're not unreachable.
17927
17928         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17929         child's reachability; don't just override ours with it.  Fixes
17930         #58058 (lluis's example).
17931         (FlowBranching): Added public InTryOrCatch(), InCatch(),
17932         InFinally(), InLoop(), InSwitch() and
17933         BreakCrossesTryCatchBoundary() methods.
17934
17935         * statement.cs (Return): Do all error checking in Resolve().
17936         Unless we are the last statement in a top-level block, always
17937         create a return label and jump to it.
17938         (Break, Continue): Do all error checking in Resolve(); also make
17939         sure we aren't leaving a `finally'.
17940         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17941         statement in a top-level block.
17942         (Block.Flags): Added `IsDestructor'.
17943         (Block.IsDestructor): New public property.
17944
17945 2004-01-20  Martin Baulig  <martin@ximian.com>
17946
17947         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17948
17949 2004-01-20  Martin Baulig  <martin@ximian.com>
17950
17951         * statement.cs (Statement.ResolveUnreachable): New public method.
17952         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17953         (Block.Resolve): Resolve unreachable statements.
17954
17955 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17956
17957         * expression.cs: We need to fix the case where we do
17958         not have a temp variable here.
17959
17960         * assign.cs: Only expression compound assignments need
17961         temporary variables.
17962
17963 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17964
17965         * flowanalysis.cs: Reduce memory allocation in a few ways:
17966           - A block with no variables should not allocate a bit
17967             vector for itself.
17968           - A method with no out parameters does not need any tracking
17969             for assignment of the parameters, so we need not allocate
17970             any data for it.
17971           - The arrays:
17972                 public readonly Type[] VariableTypes;
17973                 public readonly string[] VariableNames;
17974             Are redundant. The data is already stored in the variable
17975             map, so we need not allocate another array for it.
17976           - We need to add alot of checks for if (params | locals) == null
17977             due to the first two changes.
17978
17979 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17982         implement IMemoryLocation, we store a copy on a local variable and
17983         take the address of it.  Patch from Benjamin Jemlich
17984
17985         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17986         to use a special "type_name_expression" rule which reduces the
17987         number of "QualifiedIdentifier" classes created, and instead
17988         directly creates MemberAccess expressions.
17989
17990 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
17991
17992         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17993         that fixes #52853.  Null literal assignment to ValueType
17994
17995         * class.cs (MethodData.Emit): Instead of checking the name of the
17996         method to determine if its a destructor, create a new derived
17997         class from Method called Destructor, and test for that.  
17998
17999         * cs-parser.jay: Create a Destructor object instead of a Method.  
18000
18001         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18002
18003         Fixes: 52933
18004
18005 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * expression.cs (Binary.ResolveOperator): Perform an implicit
18008         conversion from MethodGroups to their delegate types on the
18009         Addition operation.
18010
18011         * delegate.cs: Introduce a new class DelegateCreation that is the
18012         base class for `NewDelegate' and `ImplicitDelegateCreation',
18013         factor some code in here.
18014
18015         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18016         conversion from MethodGroups to compatible delegate types. 
18017
18018         * ecore.cs (Expression.Resolve): Do not flag error 654
18019         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18020         we allow conversions from MethodGroups to delegate types now.
18021
18022         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18023         assignments in v2 either.
18024
18025 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18026
18027         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18028         static read-only fields in ctors.
18029
18030         Applied patch from Benjamin Jemlich 
18031
18032         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18033
18034 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18037         here to return true, as they can be used like this:
18038
18039                 (XXX) int.MEMBER ()
18040
18041         Fixed 49836 and all the other dups
18042
18043 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18044
18045         * driver.cs: Implement /win32res and /win32icon.
18046
18047 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18048
18049         * cs-parser.jay: Add a rule to improve error handling for the
18050         common mistake of placing modifiers after the type.
18051
18052 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18053
18054         * cs-parser.jay (interface_event_declaration): Catch
18055         initialization of events on interfaces, and report cs0068
18056
18057         * cs-parser.jay (interface_event_declaration): Catch
18058         initialization of events. 
18059
18060         * ecore.cs: Better report missing constructors.
18061
18062         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18063         the error reporting done in the wrong place.  Fix.
18064
18065         * expression.cs (Binary.ResolveOperator): Catch the 
18066         operator + (E x, E y) error earlier, and later allow for implicit
18067         conversions in operator +/- (E e, U x) from U to the underlying
18068         type of E.
18069
18070         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18071         52596, if the container class is abstract, the default constructor
18072         is protected otherwise its public (before, we were always public).
18073
18074         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18075         fixed statement.
18076
18077         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18078         Jemlich that fixes bug #52597, MCS was generating invalid code for
18079         idisposable structs.   Thanks to Ben for following up with this
18080         bug as well.
18081
18082 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18083
18084         * driver.cs: Allow assemblies without code to be generated, fixes
18085         52230.
18086
18087 2004-01-07  Nick Drochak <ndrochak@gol.com>
18088
18089         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18090
18091 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18092
18093         * cs-parser.jay: Add rules to improve error reporting if fields or
18094         methods are declared at the namespace level (error 116)
18095
18096         * Add rules to catch event add/remove
18097
18098 2004-01-04  David Sheldon <dave-mono@earth.li>
18099
18100   * expression.cs: Added matching ")" to error message for 
18101   CS0077
18102
18103 2004-01-03 Todd Berman <tberman@gentoo.org>
18104
18105         * ecore.cs, attribute.cs:
18106         Applying fix from #52429.
18107
18108 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18109
18110         * ecore.cs, expression.cs, statement.cs:
18111         Total rewrite of how we handle branching. We
18112         now handle complex boolean expressions with fewer
18113         jumps. As well if (x == 0) no longer emits a ceq.
18114
18115         if (x is Foo) is much faster now, because we generate
18116         better code.
18117
18118         Overall, we get a pretty big improvement on our benchmark
18119         tests. The code we generate is smaller and more readable.
18120
18121         I did a full two-stage bootstrap. The patch was reviewed
18122         by Martin and Miguel.
18123
18124 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18125
18126         * cs-parser.jay: Make primary_expression not take a QI.
18127         we dont need this because the member_access rule covers
18128         us here. So we replace the rule with just IDENTIFIER.
18129
18130         This has two good effects. First, we remove a s/r conflict.
18131         Second, we allocate many fewer QualifiedIdentifier objects.
18132
18133 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18134
18135         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18136         set the correct information via SRE. This prevents
18137         hanging on the MS runtime. Fixes #29374.
18138
18139 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18140
18141         * convert.cs: correctly handle conversions to value types
18142         from Enum and ValueType as unboxing conversions.
18143
18144         Fixes bug #52569. Patch by Benjamin Jemlich.
18145
18146 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18147
18148         * expression.cs (BetterConversion): Prefer int -> uint
18149         over int -> ulong (csc's behaviour). This fixed bug #52046.
18150
18151 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18152
18153         * decl.cs (MemberCache.FindMembers): now returns a
18154         MemberInfo [].
18155
18156         * typemanager.cs: In general, go with with ^^.
18157         (CopyNewMethods): take an IList.
18158         (RealMemberLookup): Only allocate an arraylist
18159         if we copy from two sets of methods.
18160
18161         This change basically does two things:
18162         1) Fewer array lists allocated due to CopyNewMethods.
18163         2) the explicit cast in MemberList costed ALOT.
18164
18165 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18166
18167         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18168         a hashtable to avoid needless string allocations when an identifier is
18169         used more than once (the common case).
18170
18171 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18172
18173         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18174         is broken, it will not return anything. So, we
18175         have to use the information we have in mcs to
18176         do the task.
18177
18178         * typemanager.cs: Add a cache for GetInterfaces,
18179         since this will now be used more often (due to ^^)
18180
18181         (GetExplicitInterfaces) New method that gets the
18182         declared, not effective, interfaces on a type
18183         builder (eg, if you have interface IFoo, interface
18184         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18185         { IBar }.
18186
18187         This patch makes MCS able to bootstrap itself on
18188         Windows again.
18189
18190 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18191
18192         * expression.cs: Remove the Nop's that Miguel put
18193         in by mistake.
18194
18195 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18196
18197         * report.cs, codegen.cs: Give the real stack trace to
18198         the error when an exception is thrown.
18199
18200 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18201
18202         * decl.cs: only allocate hashtables for ifaces if 
18203         it is an iface!
18204
18205 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18206
18207         * expression.cs: fix the error from cs0121-2.cs
18208         (a parent interface has two child interfaces that
18209         have a function with the same name and 0 params
18210         and the function is called through the parent).
18211
18212 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18213
18214         * class.cs, rootcontext.cs, typmanager.cs: do not
18215         leak pointers.
18216
18217 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18218
18219         * codegen.cs: remove stack for the ec flow branching.
18220         It is already a linked list, so no need.
18221
18222 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18223
18224         * Makefile: Allow custom profiler here.
18225
18226 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18227
18228         * typemanager.cs (LookupType):
18229           - Use a static char [], because split takes
18230             a param array for args, so it was allocating
18231             every time.
18232           - Do not store true in a hashtable, it boxes.
18233
18234 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18235
18236         * flowanalysis.cs: bytify common enums.
18237
18238 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18239
18240         * modifiers.cs: Add a new set of flags for the
18241         flags allowed on explicit interface impls.
18242         * cs-parser.jay: catch the use of modifiers in
18243         interfaces correctly.
18244         * class.cs: catch private void IFoo.Blah ().
18245
18246         All related to bug #50572.
18247
18248 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18249
18250         * decl.cs: Rewrite the consistant accessability checking.
18251         Accessability is not linear, it must be implemented in
18252         a tableish way. Fixes #49704.
18253
18254 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18255
18256         * expression.cs: Handle negation in a checked context.
18257         We must use subtraction from zero. Fixes #38674.
18258
18259 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18260
18261         * class.cs: Ignore static void main in DLLs.
18262         * rootcontext.cs: Handle the target type here,
18263         since we are have to access it from class.cs
18264         * driver.cs: account for the above.
18265
18266 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18267
18268         * report.cs: Give line numbers and files if available.
18269
18270 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18271
18272         * driver.cs: Implement /addmodule.
18273
18274         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18275         ModuleBuilders.
18276
18277 2003-12-20  Martin Baulig  <martin@ximian.com>
18278
18279         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18280         (FieldBase.IsAssigned): Removed this field.
18281         (FieldBase.SetAssigned): New public method.
18282         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18283
18284 2003-12-20  Martin Baulig  <martin@ximian.com>
18285
18286         * expression.cs (LocalVariableReference.DoResolve): Don't set
18287         `vi.Used' if we're called from DoResolveLValue().
18288
18289         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18290         returns the usage vector it just merged into the current one -
18291         pass this one to UsageWarning().
18292         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18293         of the `EmitContext', don't call this recursively on our children.
18294
18295 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18296
18297         * driver.cs: Implement /target:module.
18298
18299 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18300
18301         * support.cs (CharArrayHashtable): New helper class.
18302
18303         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18304         char arrays, not strings, so we can avoid creating a string in
18305         consume_identifier if the identifier is a keyword.
18306
18307 2003-12-16  Martin Baulig  <martin@ximian.com>
18308
18309         * statement.cs (LocalInfo.Assigned): Removed this property.
18310         (LocalInfo.Flags): Removed `Assigned'.
18311         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18312         and uses flow analysis.
18313         (Block.UsageWarning): Made this method private.
18314         (Block.Resolve): Call UsageWarning() if appropriate.
18315
18316         * expression.cs (LocalVariableReference.DoResolve): Always set
18317         LocalInfo.Used here.
18318
18319 2003-12-13  Martin Baulig  <martin@ximian.com>
18320
18321         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18322         any value here; we're now using flow analysis to figure out
18323         whether a statement/block returns a value.
18324
18325 2003-12-13  Martin Baulig  <martin@ximian.com>
18326
18327         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18328         working again.
18329         (FlowBranching.MergeFinally): Don't call
18330         `branching.CheckOutParameters()' here, this is called in
18331         MergeTopBlock().
18332         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18333         when adding the `finally' vector.       
18334
18335 2003-12-13  Martin Baulig  <martin@ximian.com>
18336
18337         * flowanalysis.cs
18338         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18339         actually work and also fix #48962.
18340
18341 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18342
18343         * decl.cs: Do not check System.Object for nested types,
18344         since we know it does not have any. Big bang for buck:
18345
18346         BEFORE:
18347            Run 1:   8.35 seconds
18348            Run 2:   8.32 seconds
18349            corlib:  17.99 seconds
18350         AFTER:
18351            Run 1:   8.17 seconds
18352            Run 2:   8.17 seconds
18353            corlib:  17.39 seconds
18354
18355 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18356
18357         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18358         time we are returning 0 members, so we save alot here.
18359
18360 2003-12-11  Martin Baulig  <martin@ximian.com>
18361
18362         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18363         `MergeChild()', also just take the `FlowBranching' as argument;
18364         call Merge() on it and return the result.
18365         (FlowBranching.Merge): We don't need to do anything if we just
18366         have one sibling.
18367
18368 2003-12-11  Martin Baulig  <martin@ximian.com>
18369
18370         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18371         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18372         Maurer for this idea.
18373
18374 2003-12-11  Martin Baulig  <martin@ximian.com>
18375
18376         * flowanalysis.cs (MergeResult): This class is now gone; we now
18377         use the `UsageVector' for this.  The reason for this is that if a
18378         branching just has one sibling, we don't need to "merge" them at
18379         all - that's the next step to do.
18380         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18381         `MergeResult'.
18382
18383 2003-12-11  Martin Baulig  <martin@ximian.com>
18384
18385         Reworked flow analyis and made it more precise and bug-free.  The
18386         most important change is that we're now using a special `Reachability'
18387         class instead of having "magic" meanings of `FlowReturns'.  I'll
18388         do some more cleanups and optimizations and also add some more
18389         documentation this week.
18390
18391         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18392         largely reworked this class.
18393         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18394         the new `Reachability' class instead of having "magic" values here.
18395         (FlowBranching): We're now using an instance of `Reachability'
18396         instead of having separate `Returns', `Breaks' etc. fields.
18397
18398         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18399         based on flow analysis; ignore the return value of block.Emit ().
18400
18401 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18402
18403         * driver.cs typemanager.cs: Find the mono extensions to corlib even
18404         if they are private.
18405
18406 2003-12-09  Martin Baulig  <martin@ximian.com>
18407
18408         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18409         call them directly on the UsageVector.
18410
18411 2003-12-09  Martin Baulig  <martin@ximian.com>
18412
18413         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18414         Changed return type from `FlowReturns' to `Reachability'.
18415
18416 2003-12-09  Martin Baulig  <martin@ximian.com>
18417
18418         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18419         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18420         `Reachable' fields with a single `Reachability' one.
18421
18422 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18423
18424         * class.cs (FindMembers): Remove foreach's.
18425
18426         Bootstrap times:
18427
18428         BEFORE
18429                 Run 1:   8.74 seconds
18430                 Run 2:   8.71 seconds
18431
18432         AFTER
18433                 Run 1:   8.64 seconds
18434                 Run 2:   8.58 seconds
18435
18436
18437 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18438
18439         * cs-parser.jay:
18440         * gen-treedump.cs:
18441         * statement.cs:
18442         This patch does a few things:
18443                 1. EmptyStatement is now a singleton, so it is never reallocated.
18444                 2. All blah is EmptyStatement constructs have been changed to
18445                    blah == EmptyStatement.Value, which is much faster and valid
18446                    now that EmptyStatement is a singleton.
18447                 3. When resolving a block, rather than allocating a new array for
18448                    the non-empty statements, empty statements are replaced with
18449                    EmptyStatement.Value
18450                 4. Some recursive functions have been made non-recursive.
18451         Mainly the performance impact is from (3), however (1) and (2) are needed for
18452         this to work. (4) does not make a big difference in normal situations, however
18453         it makes the profile look saner.
18454
18455         Bootstrap times:
18456
18457         BEFORE
18458         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18459         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18460         Total memory allocated: 56397 KB
18461
18462         AFTER
18463         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18464         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18465         Total memory allocated: 55666 KB
18466
18467 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18468
18469         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18470         than the hashtable in a hashtable version
18471
18472         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18473         we always end up concating a string. This results in a huge perf
18474         loss, because many strings have to be tracked by the GC. In this
18475         patch, we first use a hashtable that works with two keys, so that
18476         the strings do not need to be concat'ed.
18477
18478         Bootstrap times:
18479         BEFORE
18480                 Run 1:   8.74 seconds
18481                 Run 2:   8.71 seconds
18482
18483         AFTER
18484                 Run 1:   8.65 seconds
18485                 Run 2:   8.56 seconds
18486
18487 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18488
18489         * Makefile: Add a new target `do-time' that does a quick and simple
18490         profile, leaving easy to parse output.
18491
18492 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18493
18494         * codegen.cs (Init): Create the dynamic assembly with 
18495         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18496
18497 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18498
18499         * support.cs: Make the PtrHashtable use only one
18500         instance of its comparer.
18501
18502 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18503
18504         * typemanager.cs: Fix lookup of GetNamespaces.
18505
18506 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18507
18508         * expression.cs: Removed redundant line.
18509
18510         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18511         ArrayLists, use for loops with bounds.  
18512
18513         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18514         arraylist.
18515
18516         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18517         arraylists, use for loop with bounds.
18518
18519         The above three changes give us a 0.071 second performance
18520         improvement out of 3.294 seconds down to 3.223.  On my machine
18521         the above changes reduced the memory usage by 1,387 KB during
18522         compiler bootstrap.
18523
18524         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18525         QualifiedIdentifiers.  Before we created a new string through
18526         concatenation, and mostly later on, the result would be
18527         manipulated by DecomposeQI through string manipulation.
18528
18529         This reduced the compiler memory usage for bootstrapping from
18530         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18531         compile times in 0.05 seconds.
18532
18533 2003-11-28  Dick Porter  <dick@ximian.com>
18534
18535         * support.cs: Do string compares with the Invariant culture.
18536
18537         * rootcontext.cs: 
18538         * gen-treedump.cs: 
18539         * expression.cs: 
18540         * driver.cs: 
18541         * decl.cs: 
18542         * codegen.cs: 
18543         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18544         the comparison is done with the Invariant culture.
18545
18546 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18547
18548         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18549         GetEnumerator method.
18550
18551         (ProbeCollectionType): Iterate starting at the most specific type
18552         upwards looking for a GetEnumerator
18553
18554         * expression.cs: Shift count can be up to 31 for int/uint and 63
18555         for long/ulong.
18556
18557 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18558
18559         * statement.cs (Block.LookupLabel): Also look for the label on the
18560         children blocks.  Use a hash table to keep track of visited
18561         nodes. 
18562
18563         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18564         we actually did transform the other operand, otherwise fall back
18565         to the common codepath that casts to long.
18566
18567         * cs-tokenizer.cs: Use the same code pattern as the int case.
18568         Maybe I should do the parsing myself, and avoid depending on the
18569         Parse routines to get this done.
18570
18571 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18572
18573         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18574         which fixes bug 51347.  This time test it.
18575
18576         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18577         attributes for example can not tell the difference between these.
18578         The difference was only a syntax feature of the language. 
18579
18580         * attribute.cs: Apply attributes to delegates.
18581
18582         * delegate.cs: Call the apply attributes method.
18583
18584 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18585
18586         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18587         comparing 0 vs Byte.MinValue, not the value
18588
18589         (ImplicitConversionRequired): When reporting a conversion error,
18590         use error 31 to print out the constant error instead of the
18591         simpler 29.
18592
18593         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18594         which fixes bug 51347.
18595
18596 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18599         which fixes the -warnaserror command line option.
18600
18601 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18602
18603         * cfold.cs (DoNumericPromotions): During constant folding of
18604         additions on UIntConstant, special case intconstants with
18605         IntConstants like we do on the expression binary operator. 
18606
18607 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18608
18609         * convert.cs (ImplicitReferenceConversion): We were missing a case
18610         (System.Enum are not value types or class types, so we need to
18611         classify them separatedly).
18612
18613         * driver.cs: We do not support error 2007.
18614
18615 2003-11-12 Jackson Harper <jackson@ximian.com>
18616
18617         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18618         system directory. Also use the full file name so users can
18619         libraries names mscorlib-o-tron.dll in a non system dir.
18620
18621 2003-11-10  Martin Baulig  <martin@ximian.com>
18622
18623         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18624         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18625         calling `ResolveType()' on them, directly assign their `Type'.
18626
18627 2003-11-08  Martin Baulig  <martin@ximian.com>
18628
18629         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18630         return value and the `out parent' parameter.
18631         (TypeContainer.DefineType): Moved the CS0644 check into
18632         GetClassBases().  Don't pass the interface types to the
18633         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18634         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18635
18636         * ecore.cs (TypeExpr.IsAttribute): New property.
18637         (TypeExpr.GetInterfaces): New method.
18638
18639         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18640         TypeExpr instead of a Type.
18641         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18642         (Interface.DefineType): Don't pass the interface types to the
18643         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18644         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18645
18646         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18647         instead of a `Type[]'.
18648         (TypeManager.RegisterBuilder): Likewise.
18649         (TypeManager.AddUserInterface): Likewise.
18650         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18651         `Type[]' and also return a `TypeExpr[]'.
18652         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18653
18654 2003-11-08  Martin Baulig  <martin@ximian.com>
18655
18656         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18657         Expression.     
18658
18659 2003-11-08  Martin Baulig  <martin@ximian.com>
18660
18661         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18662         TypeManager.ResolveExpressionTypes().
18663
18664         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18665         instead of an Expression.
18666         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18667         (TypeExpression): New public class; formerly known as `TypeExpr'.
18668
18669         * expression.cs (ComposedCast): Derive from TypeExpr.
18670
18671         * typemanager.cs (TypeManager.system_*_expr): These are now
18672         TypExpr's instead of Expression's.
18673         (TypeManager.ResolveExpressionTypes): New public static function;
18674         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18675         of them.        
18676
18677 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * expression.cs (New.DoResolve): Do not dereference value that
18680         might be a null return.
18681
18682         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18683         sure that the constant value has the right type.  Fixes an
18684         unreported bug, similar to 50425.
18685
18686         * const.cs (Const.LookupConstantValue): Call
18687         ImplicitStandardConversionExists before doing a conversion to
18688         avoid havng the TypeManager.ChangeType do conversions.
18689
18690         Reduced the number of casts used
18691
18692         (Const.ChangeType): New routine to enable reuse of the constant
18693         type changing code from statement.
18694
18695         * typemanager.cs (ChangeType): Move common initialization to
18696         static global variables.
18697
18698         Fixes #50425.
18699
18700         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18701         every value type to go through, even if it was void.  Fix that. 
18702
18703         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18704         character of the define, and the is_identifier_part_character for
18705         the rest of the string.
18706
18707 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * expression.cs (UnaryMutator.EmitCode): When I updated
18710         LocalVariableReference.DoResolve, I overdid it, and dropped an
18711         optimization done on local variable references.
18712
18713 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18714
18715         * ecore.cs: Convert the return from Ldlen into an int.
18716
18717 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18720         the accessibility, this is a special case for toplevel non-public
18721         classes (internal for instance).
18722
18723 2003-10-20  Nick Drochak <ndrochak@gol.com>
18724
18725         * ecore.cs: Fix typo and build.  Needed another right paren.
18726
18727 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18728
18729         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18730         `internal' case regular and protected, but not allowing protected
18731         to be evaluated later.  Bug 49840
18732
18733 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18734
18735         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18736         to kb.Nlast, and not the kb.nFirst to isolate the switch
18737         statement.
18738
18739         Extract the underlying type, so enumerations of long/ulong are
18740         treated like long/ulong.
18741
18742 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * expression.cs (New): Overload the meaning of RequestedType to
18745         track the possible creation of the NewDelegate type, since
18746         DoResolve is invoked more than once for new constructors on field
18747         initialization.
18748
18749         See bugs: #48800 and #37014
18750
18751         * cs-parser.jay (declare_local_constants): Take an arraylist
18752         instead of a single constant.
18753
18754         (local_constant_declaration): It should take a
18755         constant_declarators, not a constant_declarator.  Fixes 49487
18756
18757         * convert.cs: Fix error report.
18758
18759 2003-10-13 Jackson Harper <jackson@ximian.com>
18760
18761         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18762         bug #49611
18763
18764 2003-10-09  Martin Baulig  <martin@ximian.com>
18765
18766         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18767         to the .ctor.
18768         (MethodCore.DoDefineParameters): Removed the TypeContainer
18769         argument; use the DeclSpace which was passed to the .ctor instead.
18770         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18771         TypeContainer; we only need a DeclSpace here.
18772
18773 2003-10-09  Martin Baulig  <martin@ximian.com>
18774
18775         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18776         to the .ctor.
18777         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18778         EmitContext's .ctor.    
18779
18780 2003-10-09  Martin Baulig  <martin@ximian.com>
18781
18782         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18783         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18784         AsAccessible(), moved them as well.
18785
18786         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18787
18788 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18789
18790         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18791
18792 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18795         generation for >=, as spotted by Paolo, bug 48679.  
18796         Patch from David Waite.
18797
18798         * cs-tokenizer.cs: Add handling for #pragma.
18799
18800         * cs-parser.jay: Allow for both yield and yield return in the
18801         syntax.  The anti-cobolization of C# fight will go on!
18802
18803         * class.cs (TypeBuilder.DefineType): Catch error condition here
18804         (Parent.DefineType erroring out and returning null).
18805
18806         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18807         coping with enumerations variables, we were mistakenly processing
18808         them as a regular value type instead of built-in types.  Fixes the
18809         bug #48063
18810
18811         * typemanager.cs (IsBuiltinOrEnum): New method.
18812
18813 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18814
18815         * cs-parser.jay: Upgrade: yield now needs the return clause.
18816
18817 2003-09-19  Martin Baulig  <martin@ximian.com>
18818
18819         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18820         `MemberCache parent' argument.  Normally, an interface doesn't
18821         have a parent type except System.Object, but we use this in gmcs
18822         for generic type parameters.
18823
18824 2003-09-18  Martin Baulig  <martin@ximian.com>
18825
18826         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18827         on `type.IsInterface'; don't check whether the type has a parent
18828         to determine whether it's an interface.
18829
18830 2003-09-15  Martin Baulig  <martin@ximian.com>
18831
18832         * class.cs (TypeContainer.DefineType): Added an error flag to
18833         avoid reporting duplicate CS0146's ("class definition is
18834         circular.").
18835
18836         * driver.cs (Driver.MainDriver): Abort if
18837         RootContext.ResolveTree() reported any errors.
18838
18839 2003-09-07  Martin Baulig  <martin@ximian.com>
18840
18841         * report.cs (Error, Warning): Added overloaded versions which take
18842         a `params object[] args' and call String.Format().
18843
18844 2003-09-07  Martin Baulig  <martin@ximian.com>
18845
18846         * decl.cs (DeclSpace..ctor): Don't call
18847         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18848         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18849         (DeclSpace.RecordDecl): New method.
18850
18851         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18852
18853 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18854
18855         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18856         value attributes to be applied to ParameterBuilders.
18857
18858         * class.cs (MethodCore.LabelParameters): Make static and more
18859         generic so that it can be used from other places - like interface
18860         methods, for instance.
18861
18862         * interface.cs (Interface.Emit): Call LabelParameters before
18863         emitting attributes on the InterfaceMethod.
18864
18865 2003-08-26  Martin Baulig  <martin@ximian.com>
18866
18867         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18868         resolving aliases; fixes #47927.
18869
18870 2003-08-26  Martin Baulig  <martin@ximian.com>
18871
18872         * statement.cs (Using.DoResolve): This is internally emitting a
18873         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18874         do not always return.  Fixes #47681.
18875
18876 2003-08-26  Martin Baulig  <martin@ximian.com>
18877
18878         * decl.cs (MemberCore): Moved WarningNotHiding(),
18879         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18880         into MemberBase.
18881         (AdditionResult): Make this nested in DeclSpace.
18882         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18883         argument; call NamespaceEntry.Define() unless we're nested in a
18884         class or struct.
18885
18886         * namespace.cs (Namespace.DefineName): New public function.  This
18887         is called from DeclSpace's .ctor to add 
18888         (Namespace.Lookup): Include DeclSpaces in the lookup.
18889
18890         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18891
18892         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18893
18894 2003-08-25  Martin Baulig  <martin@ximian.com>
18895
18896         * convert.cs (Convert.ExplicitReferenceConversion): When
18897         converting from an interface type to a class, unbox if the target
18898         type is a struct type.  Fixes #47822.
18899
18900 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18901
18902         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18903         #47854.
18904
18905 2003-08-22  Martin Baulig  <martin@ximian.com>
18906
18907         * class.cs (TypeManager.DefineType): When defining a nested type,
18908         call DefineType() on our parent; fixes #47801.
18909
18910 2003-08-22  Martin Baulig  <martin@ximian.com>
18911
18912         * class.cs (MethodData.Define): While checking if a method is an
18913         interface implementation, improve the test a bit more to fix #47654.
18914
18915 2003-08-22  Martin Baulig  <martin@ximian.com>
18916
18917         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18918         correctly; fixes #47722.
18919
18920 2003-08-22  Martin Baulig  <martin@ximian.com>
18921
18922         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18923         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
18924
18925         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
18926
18927 2003-08-22  Martin Baulig  <martin@ximian.com>
18928
18929         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18930         can only be assigned in static constructors.  Fixes #47161.
18931
18932 2003-08-22  Martin Baulig  <martin@ximian.com>
18933
18934         Rewrote and improved the flow analysis code.
18935
18936         * flowbranching.cs (FlowBranching): Make this class abstract.
18937         (FlowBranching.CreateBranching): New static function to create a
18938         new flow branching.
18939         (FlowBranchingBlock, FlowBranchingException): New classes.
18940         (FlowBranching.UsageVector.Type): New public readonly field.
18941         (FlowBranching.UsageVector.Breaks): Removed the setter.
18942         (FlowBranching.UsageVector.Returns): Removed the setter.
18943         (FlowBranching.UsageVector): Added Break(), Return(),
18944         NeverReachable() and Throw() methods to modify the reachability.
18945         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18946         done by FlowBranching.Merge().
18947         (FlowBranching.UsageVector.MergeChild): New method; merges the
18948         merge result into the current vector.
18949         (FlowBranching.Merge): New abstract method to merge a branching.
18950
18951 2003-08-12  Martin Baulig  <martin@ximian.com>
18952
18953         * expression.cs (Indirection.CacheTemporaries): Create the
18954         LocalTemporary with the pointer type, not its element type.
18955
18956 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
18957
18958         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18959         token was a keyword or not.
18960
18961         Add `error' options where an IDENTIFIER was expected;  Provide
18962         CheckToken and CheckIdentifierToken convenience error reporting
18963         functions. 
18964
18965         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18966
18967         * decl.cs: Rename `NamespaceEntry Namespace' public field into
18968         NameSpaceEntry NameSpaceEntry.
18969
18970         (LookupInterfaceOrClass): Avoid creating a full qualified name
18971         from namespace and name: avoid doing lookups when we know the
18972         namespace is non-existant.   Use new Tree.LookupByNamespace which
18973         looks up DeclSpaces based on their namespace, name pair.
18974
18975         * driver.cs: Provide a new `parser verbose' to display the
18976         exception thrown during parsing.  This is turned off by default
18977         now, so the output of a failure from mcs is more graceful.
18978
18979         * namespace.cs: Track all the namespaces defined in a hashtable
18980         for quick lookup.
18981
18982         (IsNamespace): New method
18983
18984 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
18985
18986         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
18987         we know that we need to concatenate (full typename can never be
18988         null). 
18989
18990         * class.cs: ditto.
18991
18992         * statement.cs: Use a bitfield;  Do not initialize to null things
18993         which are done by the constructor by default.
18994
18995         * cs-parser.jay: bug fix, parameter was 4, not 3.
18996
18997         * expression.cs: Just use the property;
18998
18999         * statement.cs: No need for GetVariableInfo method.
19000
19001 2003-08-08  Martin Baulig  <martin@ximian.com>
19002
19003         * flowanalysis.cs (FlowReturns): This is now nested in the
19004         `FlowBranching' class.
19005         (MyBitVector): Moved this here from statement.cs.
19006         (FlowBranching.SiblingType): New enum type.
19007         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19008
19009 2003-08-07  Martin Baulig  <martin@ximian.com>
19010
19011         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19012         `FlowBranching' class and called `BranchingType'.
19013
19014 2003-08-07  Martin Baulig  <martin@ximian.com>
19015
19016         * flowanalysis.cs: Moved all the control flow analysis code into
19017         its own file.
19018
19019 2003-08-07  Martin Baulig  <martin@ximian.com>
19020
19021         * assign.cs (Assign.DoResolve): `target' must either be an
19022         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19023         #37319.
19024
19025 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19026
19027         * expression.cs (BinaryMethod): This kind of expression is created by the
19028         Binary class if it determines that the operator has to be handled
19029         by a method.
19030
19031         (BinaryDelegate): This kind of expression is created if we are
19032         dealing with a + or - operator on delegates.
19033
19034         (Binary): remove method, argumetns, and DelegateOperator: when
19035         dealing with methods, 
19036
19037         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19038
19039         * statement.cs (Block): use bitfields for the three extra booleans
19040         we had in use.   Remove unused topblock parameter.
19041
19042         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19043
19044         * assign.cs: Drop extra unneeded tests.
19045
19046 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19047
19048         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19049
19050         * statement.cs (Foreach): Use VariableStorage instead of
19051         LocalBuilders.   
19052
19053         * codegen.cs (VariableStorage): New class used by clients that
19054         require a variable stored: locals or fields for variables that
19055         need to live across yield.
19056
19057         Maybe provide a convenience api for EmitThis+EmitLoad?
19058
19059         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19060         these bad boys.
19061
19062 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19063
19064         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19065         RemapParameterLValue): New methods that are used to turn a
19066         precomputed FieldInfo into an expression like this:
19067
19068                 instance.FieldInfo
19069
19070         The idea is to use this instead of making LocalVariableReference
19071         have more than one meaning.
19072
19073         * cs-parser.jay: Add error production to BASE.
19074
19075         * ecore.cs: Deal with TypeManager.GetField returning null, which
19076         is now a valid return value.
19077
19078         (FieldExprNoAddress): New expression for Fields whose address can
19079         not be taken.
19080
19081         * expression.cs (LocalVariableReference): During the resolve
19082         phases, create new expressions if we are in a remapping context.
19083         Remove code that dealt with remapping here.
19084
19085         (ParameterReference): same.
19086
19087         (ProxyInstance): New expression, like the `This' expression, but
19088         it is born fully resolved.  We know what we are doing, so remove
19089         the errors that are targeted to user-provided uses of `this'.
19090
19091         * statement.cs (Foreach): our variable is now stored as an
19092         Expression;  During resolution, follow the protocol, dont just
19093         assume it will return this.
19094
19095 2003-08-06  Martin Baulig  <martin@ximian.com>
19096
19097         * support.cs (SeekableStreamReader.cs): New public class.
19098
19099         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19100         SeekableStreamReader instead of the normal StreamReader.
19101
19102 2003-08-04  Martin Baulig  <martin@ximian.com>
19103
19104         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19105         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19106         deambiguate casts and delegate invocations.
19107         (parenthesized_expression): Use the new tokens to ensure this is
19108         not a cast of method invocation.
19109
19110         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19111         when reading a `)' and Deambiguate_CloseParens () was previously
19112         called.
19113
19114         * expression.cs (ParenthesizedExpression): New class.  This is
19115         just used for the CS0075 test.
19116         (Binary.DoResolve): Check for CS0075.   
19117
19118 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19119
19120         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19121         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19122         reference comparison.
19123
19124         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19125         examine the ReturnType for equality - this is necessary in the
19126         cases of implicit and explicit operators whose signature also
19127         includes the return type.
19128
19129 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19130
19131         * namespace.cs: Cache the result of the namespace computation,
19132         instead of computing it every time.
19133
19134 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19135
19136         * decl.cs: Use a global arraylist that we reuse over invocations
19137         to avoid excesive memory consumption.  Reduces memory usage on an
19138         mcs compile by one meg (45 average).
19139
19140         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19141         private, work around that.
19142
19143 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * literal.cs (IntLiteral): Define Zero and One static literals. 
19146
19147         * cs-parser.jay (integer_literal): use static literals to reduce
19148         memory usage for the most used literals (0, 1 and -1).  211kb
19149         reduced in memory usage.
19150
19151         Replace all calls to `new ArrayList' with `new
19152         ArrayList(4)' which is a good average number for most allocations,
19153         and also requires only 16 bytes of memory for its buffer by
19154         default. 
19155
19156         This reduced MCS memory usage in seven megabytes for the RSS after
19157         bootstrapping.
19158
19159 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19160
19161         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19162         handle params methods the correct way by forming only one
19163         applicable set with params and normal methods in them. Earlier we
19164         were looking at params methods only if we found no normal methods
19165         which was not the correct thing to do.
19166
19167         (Invocation.BetterFunction): Take separate arguments indicating
19168         when candidate and the best method are params methods in their
19169         expanded form.
19170
19171         This fixes bugs #43367 and #46199.
19172
19173         * attribute.cs: Documentation updates.
19174
19175         (CheckAttribute): Rename to CheckAttributeTarget.
19176         (GetValidPlaces): Rename to GetValidTargets.
19177
19178         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19179         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19180
19181         Fixes bug #44468.
19182
19183 2003-07-28  Martin Baulig  <martin@ximian.com>
19184
19185         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19186         name when looking up the base class of a nested class.  Fixes #46977.
19187
19188 2003-07-26  Martin Baulig  <martin@ximian.com>
19189
19190         * expression.cs (Indexers.Indexer): New nested struct; contains
19191         getter, setter and the indexer's type.
19192         (Indexers.Properties): This is now an ArrayList of
19193         Indexers.Indexer's.
19194         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19195         indexer doesn't have any getters.
19196
19197         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19198         for embedded property and indexer assignments.
19199
19200 2003-07-26  Martin Baulig  <martin@ximian.com>
19201
19202         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19203         preprocessor directive is not the first non-whitespace character
19204         on a line.
19205
19206 2003-07-26  Martin Baulig  <martin@ximian.com>
19207
19208         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19209         namespace parsing, follow the spec more closely.
19210
19211         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19212         NamespaceEntry.Lookup().
19213
19214 2003-07-25  Martin Baulig  <martin@ximian.com>
19215
19216         * MethodCore.cs (OverridesSomething): New public field; it's set
19217         from TypeContainer.DefineMembers if this method overrides
19218         something (which doesn't need to be a method).  Fix #39462.
19219
19220 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19221
19222         * typemanager.cs (GetMembers): Ensure that the list of members is
19223         reversed. This keeps things in sync.
19224
19225         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19226         find an AttributeUsage attribute.
19227
19228         * expression.cs (Invocation.OverloadResolve): Perform the check
19229         which disallows Invoke to be directly called on a Delegate.
19230
19231         (Error_InvokeOnDelegate): Report error cs1533.
19232
19233 2003-07-25  Martin Baulig  <martin@ximian.com>
19234
19235         * expression.cs (Indexers.GetIndexersForType): Only look in the
19236         interface hierarchy if the requested type is already an
19237         interface.  Fixes #46788 while keeping #46502 fixed.
19238
19239 2003-07-25  Martin Baulig  <martin@ximian.com>
19240
19241         * class.cs (TypeContainer.DefineMembers): Check whether all
19242         readonly fields have been assigned and report warning CS0649 if
19243         not.
19244
19245         * statement.cs (LocalInfo.IsFixed): Always return true if this is
19246         a valuetype.
19247
19248 2003-07-24  Ravi Pratap  <ravi@ximian.com>
19249
19250         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19251         returned from GetMethods to make things consistent with the
19252         assumptions MCS makes about ordering of methods.
19253
19254         This should comprehensively fix bug #45127 and it does :-)
19255
19256         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19257         ordering is actually reverse.
19258
19259         * Clean up some debug messages I left lying around.
19260
19261         * interface.cs (Populate*): Get rid of code which emits attributes
19262         since the stage in which we emit attributes is the 'Emit' stage,
19263         not the define stage.
19264
19265         (Emit): Move attribute emission for interface members here.
19266
19267 2003-07-22  Ravi Pratap  <ravi@ximian.com>
19268
19269         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19270         closely: we eliminate methods in base types when we have an
19271         applicable method in a top-level type.
19272
19273         Please see section 14.5.5.1 for an exact description of what goes
19274         on. 
19275
19276         This fixes bug #45127 and a host of other related to corlib compilation.
19277
19278         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19279         array is the method corresponding to the top-level type (this is
19280         because of the changes made to icall.c) so we change this
19281         accordingly.
19282
19283         (MethodGroupExpr.Name): This too.
19284
19285         * typemanager.cs (GetElementType): New method which does the right
19286         thing when compiling corlib. 
19287
19288         * everywhere: Make use of the above in the relevant places.
19289
19290 2003-07-22  Martin Baulig  <martin@ximian.com>
19291
19292         * cs-parser.jay (invocation_expression): Moved
19293         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19294         `cast_expression', but create a InvocationOrCast which later
19295         resolves to either an Invocation or a Cast.
19296
19297         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19298         method; call this before EmitStatement() to make sure that this
19299         expression can be used as a statement.
19300
19301         * expression.cs (InvocationOrCast): New class; resolves to either
19302         an Invocation or a Cast.
19303
19304         * statement.cs (StatementExpression): Call ResolveStatement() on
19305         the ExpressionStatement before emitting it.
19306
19307 2003-07-21  Martin Baulig  <martin@ximian.com>
19308
19309         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19310         `ref' and `out' attributes match; fixes #46220.
19311         (MemberAccess.ResolveMemberAccess): You can't reference a type
19312         through an expression; fixes #33180.
19313         (Indexers.GetIndexersForType): Don't return the indexers from
19314         interfaces the class implements; fixes #46502.
19315
19316 2003-07-21  Martin Baulig  <martin@ximian.com>
19317
19318         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19319         CS0661 checks; fixes bug #30442.
19320
19321 2003-07-21  Martin Baulig  <martin@ximian.com>
19322
19323         * decl.cs (AdditionResult): Added `Error'.
19324
19325         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19326
19327         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19328         makes cs0031.cs actually work.
19329
19330 2003-07-20  Martin Baulig  <martin@ximian.com>
19331
19332         * namespace.cs: Fixed that bug which caused a crash when compiling
19333         the debugger's GUI.
19334
19335 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * typemanager.cs (LookupTypeReflection): Never expose types which
19338         are NotPublic, NestedPrivate, NestedAssembly, or
19339         NestedFamANDAssem.  We used to return these, and later do a check
19340         that would report a meaningful error, but the problem is that we
19341         would not get the real match, if there was a name override.
19342
19343 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19344
19345         * namespace.cs (Namespace, Name): Do not compute the namespace
19346         name dynamically, compute it in the constructor.  This reduced
19347         memory usage by 1697 KB.
19348
19349         * driver.cs: Use --pause to pause at the end.
19350
19351 2003-07-17  Peter Williams  <peter@newton.cx>
19352
19353         * Makefile: Change the name of the test target so that it doesn't
19354         conflict with the recursive test target.
19355
19356 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19359         AddressOf): Do not use EmitThis, that was wrong, use the actual
19360         this pointer.
19361
19362 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * class.cs (MethodData.Define): While checking if a method is an
19365         interface implementation, improve the test: If we are not public
19366         (use new test here: use the computed MethodAttributes directly,
19367         instead of the parsed modifier flags) check if the `implementing'
19368         method comes from an interface or not.
19369
19370         * pending.cs (VerifyPendingMethods): Slightly better error
19371         message.
19372
19373         * makefile: add test target that does the mcs bootstrap.
19374
19375 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19376
19377         * interface.cs (Define): Do nothing here since there are no
19378         members to populate etc. Move the attribute emission out of here
19379         since this was just totally the wrong place to put it. Attribute
19380         application happens during the 'Emit' phase, not in the 'Define'
19381         phase.
19382
19383         (Emit): Add this method and move the attribute emission here
19384
19385         * rootcontext.cs (EmitCode): Call the Emit method on interface
19386         types too.
19387
19388 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19389
19390         * expression.cs (OverloadResolve): Report error only if Location
19391         is not 'Null' which means that there was a probe going on.
19392
19393 2003-07-14  Martin Baulig  <martin@ximian.com>
19394
19395         * expression.cs (ConditionalLogicalOperator): New public class to
19396         implement user defined conditional logical operators.
19397         This is section 14.11.2 in the spec and bug #40505.
19398
19399 2003-07-14  Martin Baulig  <martin@ximian.com>
19400
19401         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19402
19403 2003-07-14  Martin Baulig  <martin@ximian.com>
19404
19405         * codegen.cs (EmitContext.InFixedInitializer): New public field.
19406
19407         * ecore.cs (IVariable.VerifyFixed): New interface method.
19408
19409         * expression.cs (Unary.ResolveOperator): When resolving the `&'
19410         operator, check whether the variable is actually fixed.  Fixes bug
19411         #36055.  Set a variable definitely assigned when taking its
19412         address as required by the spec.
19413
19414         * statement.cs (LocalInfo.IsFixed): New field.
19415         (LocalInfo.MakePinned): Set `IsFixed' to true.
19416
19417 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19418
19419         * attribute.cs (Attribute.Resolve): While doing a Member lookup
19420         for .ctors, ensure that we only ask for members declared in the
19421         attribute type (BindingFlags.DeclaredOnly).
19422
19423         Fixes bug #43632.
19424
19425         * expression.cs (Error_WrongNumArguments): Report error 1501
19426         correctly the way CSC does.
19427
19428 2003-07-13  Martin Baulig  <martin@ximian.com>
19429
19430         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19431         lookup on the fully qualified name, to make things like "X.X" work
19432         where "X.X" is a fully qualified type name, but we also have a
19433         namespace "X" in the using list.  Fixes #41975.
19434
19435 2003-07-13  Martin Baulig  <martin@ximian.com>
19436
19437         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19438         function. If we're a CompoundAssign, we need to create an embedded
19439         CompoundAssign, not an embedded Assign.
19440         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19441         Fixes #45854.
19442
19443 2003-07-13  Martin Baulig  <martin@ximian.com>
19444
19445         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19446         work to fix bug #46088.
19447
19448 2003-07-13  Ravi Pratap <ravi@ximian.com>
19449
19450         * class.cs (Operator.Emit): Do not emit attributes here - it is
19451         taken care of by the Method class that we delegate too. This takes
19452         care of bug #45876.
19453
19454 2003-07-10  Martin Baulig  <martin@ximian.com>
19455
19456         * expression.cs (TypeOfVoid): New class.
19457         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
19458
19459 2003-07-10  Martin Baulig  <martin@ximian.com>
19460
19461         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19462         bug #35957.
19463
19464 2003-07-10  Martin Baulig  <martin@ximian.com>
19465
19466         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19467         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19468
19469         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19470
19471         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19472
19473 2003-07-10  Martin Baulig  <martin@ximian.com>
19474
19475         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19476         of decimal.  Fixes #42850.
19477
19478         NOTE: I also fixed the created byte blob, but this doesn't work on
19479         the MS runtime and csc never produces any byte blobs for decimal
19480         arrays.
19481
19482 2003-07-10  Martin Baulig  <martin@ximian.com>
19483
19484         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19485         structs; fixes #32068.
19486         (Block.AddChildVariableNames): Fixed #44302.
19487
19488 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19489
19490         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19491
19492 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * attribute.cs: And this test is onger needed.
19495
19496 2003-07-08  Martin Baulig  <martin@ximian.com>
19497
19498         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19499         inaccessible types.  Fixes #36313.
19500
19501         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19502
19503         * namespace.cs (NamespaceEntry): Create implicit entries for all
19504         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19505         implicit entries for N1.N2 and N1.
19506
19507 2003-07-08  Martin Baulig  <martin@ximian.com>
19508
19509         Rewrote the handling of namespaces to fix a lot of the issues
19510         wrt. `using' aliases etc.
19511
19512         * namespace.cs (Namespace): Splitted this class into a
19513         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19514
19515         * typemanager.cs (TypeManager.IsNamespace): Removed.
19516         (TypeManager.ComputeNamespaces): Only compute namespaces from
19517         loaded assemblies here, not the namespaces from the assembly we're
19518         currently compiling.
19519
19520 2003-07-08  Martin Baulig  <martin@ximian.com>
19521
19522         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19523
19524 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19525
19526         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19527         already fixed it.  
19528
19529         I thought about the memory savings here, but LookupTypeReflection
19530         is used under already very constrained scenarios.  Compiling
19531         corlib or mcs only exposes one hit, so it would not really reduce
19532         any memory consumption.
19533
19534 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19535
19536         * typemanager.cs: fixes bug #45889 by only adding public types from
19537         other assemblies to the list of known types.
19538
19539 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19540
19541         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19542         on the type we resolved.
19543
19544 2003-07-05  Martin Baulig  <martin@ximian.com>
19545
19546         * pending.cs (PendingImplementation.ParentImplements): Don't
19547         create the proxy if the parent is abstract.
19548
19549         * class.cs (TypeContainer.DefineIndexers): Process explicit
19550         interface implementations first.  Fixes #37714.
19551
19552 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19555         defined recursively;  but since we modify the input parameters
19556         (left is set to `this' temporarily), we reset this value if the
19557         left_is_explicit is false, which gives the original semantics to
19558         the code.  
19559
19560         * literal.cs (NullPointer): new class used to represent a null
19561         literal in a pointer context.
19562
19563         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19564         type is a pointer, use a NullPointer object instead of a
19565         NullLiteral.   Closes 43687
19566
19567         (ExplicitConversion): Convert pointer values using
19568         the conv opcode to the proper type.
19569
19570         * ecore.cs (New): change ValueTypeVariable property into a method,
19571         that returns whether the valuetype is suitable for being used.
19572
19573         * expression.cs (Binary.DoNumericPromotions): Only return if we
19574         the int constant was a valid uint, and we can return both left and
19575         right as uints.  If not, we continue processing, to trigger the
19576         type conversion.  This fixes 39018.
19577
19578         * statement.cs (Block.EmitMeta): During constant resolution, set
19579         the CurrentBlock property on the emitcontext, so that we resolve
19580         constants propertly.
19581
19582 2003-07-02  Martin Baulig  <martin@ximian.com>
19583
19584         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19585         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19586
19587         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19588         than emitting it here.
19589
19590         * statement.cs: Fixed some more flow analysis bugs.
19591
19592 2003-07-02  Martin Baulig  <martin@ximian.com>
19593
19594         * class.cs (MethodData.Define): When implementing interface
19595         methods, set Final unless we're Virtual.
19596
19597         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19598         check work for interface methods.
19599
19600 2003-07-01  Martin Baulig  <martin@ximian.com>
19601
19602         * ecore.cs (EmitContext.This): Replaced this property with a
19603         GetThis() method which takes a Location argument.  This ensures
19604         that we get the correct error location for a CS0188.
19605
19606 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19607
19608         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19609         ImplicitStandardConversion.
19610
19611         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19612
19613 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19614
19615         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19616         optimization.
19617
19618 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19619
19620         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19621         constructors.
19622
19623         (MethodData.Define): Turn off initlocals for unsafe methods.
19624
19625 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19626
19627         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19628         complete;  Fixes #37521.
19629
19630         * delegate.cs: Use Modifiers.TypeAttr to compute the
19631         TypeAttributes, instead of rolling our own.  This makes the flags
19632         correct for the delegates.
19633
19634 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * class.cs (Constructor.Define): Set the private flag for static
19637         constructors as well.
19638
19639         * cs-parser.jay (statement_expression): Set the return value to
19640         null, to avoid a crash when we catch an error.
19641
19642 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19643
19644         * cs-parser.jay: Applied patch from Jackson that adds support for
19645         extern and unsafe modifiers to destructor declarations.
19646
19647         * expression.cs: Report error 21 if the user is trying to index a
19648         System.Array.
19649
19650         * driver.cs: Add an error message, suggested by the bug report.
19651
19652         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19653         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19654
19655 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19656
19657         * namespace.cs: Add some information to reduce FAQs.
19658
19659 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19660
19661         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19662         underlying enumeration types.  Fixes #43915.
19663
19664         * expression.cs: Treat ushort/short as legal values to be used in
19665         bitwise operations.
19666
19667 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19668
19669         * delegate.cs: transfer custom attributes for paramenters from
19670         the delegate declaration to Invoke and BeginInvoke.
19671
19672 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19673
19674         * attribute.cs: handle custom marshalers and emit marshal info
19675         for fields, too.
19676
19677 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19678
19679         * makefile.gnu: Added anonymous.cs to the compiler sources.
19680
19681 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19682
19683         * iterators.cs: Change the name of the proxy class to include two
19684         underscores.
19685
19686         * cs-parser.jay: Update grammar to include anonymous methods.
19687
19688         * anonymous.cs: new file.
19689
19690 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19691
19692         * class.cs (Field.Define): Add missing test for pointers and
19693         safety. 
19694
19695 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19696
19697         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19698         we use the stobj opcode.
19699
19700         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19701         since it wasn't the correct fix. 
19702
19703         It still is puzzling that we are required to use stobj for IntPtr
19704         which seems to be a ValueType.
19705
19706 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19707
19708         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19709         during regular simple name resolution.   Now, the trick is that
19710         instead of returning for processing the simplename, we do a
19711         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19712         contextual lookup type).   If a match is found, return that, if
19713         not, return for further composition.
19714
19715         This fixes long-standing 30485.
19716
19717         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19718         using the address to initialize an object, do an Stobj instead of
19719         using the regular Stelem.
19720
19721         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19722         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19723         Because if we are a BaseIndexerAccess that value will be true.
19724         Fixes 43643.
19725
19726         * statement.cs (GotoCase.Resolve): Return after reporting an
19727         error, do not attempt to continue. 
19728
19729         * expression.cs (PointerArithmetic.Emit): If our operand is a
19730         long, convert our constants to match the operand before
19731         multiplying.  Convert to I type before adding.   Fixes 43670.
19732
19733 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19734
19735         * enum.cs (ImplicitConversionExists) : Rename to
19736         ImplicitEnumConversionExists to remove ambiguity. 
19737
19738         * ecore.cs (NullCast): New type of cast expression class which
19739         basically is very similar to EmptyCast with the difference being
19740         it still is a constant since it is used only to cast a null to
19741         something else
19742         (eg. (string) null)
19743
19744         * convert.cs (ImplicitReferenceConversion): When casting a null
19745         literal, we return a NullCast.
19746
19747         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19748         should be around anymore.
19749
19750         The renaming (reported was slightly wrong). Corrections:
19751
19752         ConvertImplicitStandard -> ImplicitConversionStandard
19753         ConvertExplicitStandard -> ExplicitConversionStandard
19754
19755         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19756         before passing them in !
19757
19758         * convert.cs (ImplicitConversionStandard): When comparing for
19759         equal expr and target types, ensure that expr is not a
19760         NullLiteral.
19761
19762         In general, we must not be checking (expr_type ==
19763         target_type) in the top level conversion methods
19764         (ImplicitConversion, ExplicitConversion etc). This checking is
19765         done in the methods that they delegate to.
19766
19767 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19768
19769         * convert.cs: Move Error_CannotConvertType,
19770         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19771         ImplicitNumericConversion, ImplicitConversionExists,
19772         ImplicitUserConversionExists, StandardConversionExists,
19773         FindMostEncompassedType, FindMostSpecificSource,
19774         FindMostSpecificTarget, ImplicitUserConversion,
19775         ExplicitUserConversion, GetConversionOperators,
19776         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19777         TryImplicitIntConversion, Error_CannotConvertImplicit,
19778         ConvertImplicitRequired, ConvertNumericExplicit,
19779         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19780         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19781         its own file.
19782
19783         Perform the following renames:
19784
19785         StandardConversionExists -> ImplicitStandardConversionExists
19786         ConvertImplicit -> ImplicitConversion
19787         ConvertImplicitStandard -> ImplicitStandardConversion
19788         TryImplicitIntConversion -> ImplicitIntConversion
19789         ConvertImplicitRequired -> ImplicitConversionRequired
19790         ConvertNumericExplicit -> ExplicitNumericConversion
19791         ConvertReferenceExplicit -> ExplicitReferenceConversion
19792         ConvertExplicit -> ExplicitConversion
19793         ConvertExplicitStandard -> ExplicitStandardConversion
19794
19795 2003-05-19  Martin Baulig  <martin@ximian.com>
19796
19797         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19798         (TypeInfo): Added support for structs having structs as fields.
19799
19800         * ecore.cs (FieldExpr): Implement IVariable.
19801         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19802         VariableInfo for the field.
19803
19804 2003-05-18  Martin Baulig  <martin@ximian.com>
19805
19806         * expression.cs (This.DoResolve): Report a CS0027 if we're
19807         emitting a field initializer.
19808
19809 2003-05-18  Martin Baulig  <martin@ximian.com>
19810
19811         * expression.cs (This.ResolveBase): New public function.
19812         (This.DoResolve): Check for CS0188.
19813
19814         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19815         This.Resolve().
19816
19817         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19818         `instance_expression' to null if we don't have any non-static
19819         methods.
19820
19821 2003-05-18  Martin Baulig  <martin@ximian.com>
19822
19823         Reworked the way how local variables and parameters are handled by
19824         the flow analysis code.
19825
19826         * statement.cs (TypeInfo, VariableMap): New public classes.
19827         (VariableInfo): New public class.  This is now responsible for
19828         checking whether a variable has been assigned.  It is used for
19829         parameters and local variables.
19830         (Block.EmitMeta): Take the InternalParameters as argument; compute
19831         the layout of the flow vectors here.
19832         (Block.LocalMap, Block.ParameterMap): New public properties.
19833         (FlowBranching): The .ctor doesn't get the InternalParameters
19834         anymore since Block.EmitMeta() now computes the layout of the flow
19835         vector.
19836         (MyStructInfo): This class is now known as `StructInfo' and nested
19837         in `TypeInfo'; we don't access this directly anymore.
19838
19839         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19840         property and removed IsAssigned(), IsFieldAssigned(),
19841         SetAssigned() and SetFieldAssigned(); we now call them on the
19842         VariableInfo so we don't need to duplicate this code everywhere.
19843
19844         * expression.cs (ParameterReference): Added `Block block' argument
19845         to the .ctor.
19846         (LocalVariableReference, ParameterReference, This): The new
19847         VariableInfo class is now responsible for all the definite
19848         assignment stuff.
19849
19850         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19851         IsParameterAssigned, SetParameterAssigned): Removed.
19852
19853 2003-05-18  Martin Baulig  <martin@ximian.com>
19854
19855         * typemanager.cs (InitCoreTypes): Try calling
19856         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19857         the 3-args-version.  Corlib now also needs our `void_type'.
19858         (GetMethod): Added overloaded version which takes an optional
19859         `bool report_errors' to allow lookups of optional methods.
19860
19861 2003-05-12  Martin Baulig  <martin@ximian.com>
19862
19863         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19864         only used for locals and not for parameters.
19865
19866 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * support.cs (InternalParameters.ParameterType): Return the
19869         ExternalType of the parameter.
19870
19871         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19872         they were unused.
19873
19874 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * class.cs (MethodData.Define): Do not set the `newslot' on
19877         interface members, if they are also flagged as "override".
19878
19879         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19880         better code for ++i and i++.  This only works for static fields
19881         and local variables.
19882
19883         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19884         want to pull the DeclSpace out of the builder_to_declspace instead
19885         of the TypeBuilder (like in TypeContainer.FindMembers).
19886
19887         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19888         instead of LookupTypeContainer.  Fixes the crash on .NET for
19889         looking up interface members.
19890
19891         * const.cs: Create our own emit context during the Definition
19892         stage, so that constants are evaluated in the proper context, when
19893         a recursive definition happens.
19894
19895 2003-05-11  Martin Baulig  <martin@ximian.com>
19896
19897         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19898         new block for a switch section.
19899         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19900         the adding/lookup in the switch block.  Fixes #39828.
19901
19902 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19905         functionality: I needed to convert the data after I had performed
19906         the add/sub operation into the operands type size.
19907
19908         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19909         pass the type for the box operation, otherwise the resulting
19910         object would have been of type object.
19911
19912         (BoxedCast): Add constructor to specify the type to box as.
19913
19914 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
19915
19916         * iterators.cs: I was reusing the `count' variable inadvertently,
19917         take steps to not allow this to happen.
19918
19919 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
19920
19921         * attribute.cs (Attribute.Resolve): Params attributes are encoded
19922         by creating an array at the point where the params starts and
19923         putting all those arguments there, then adjusting the size of the
19924         array.
19925
19926 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
19927
19928         * expression.cs (New.AddressOf): Implement interface
19929         IMemoryLocation.  This is used when the `new' operator is used in
19930         the context of an invocation to a method on a value type.
19931
19932         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19933         example. 
19934
19935         * namespace.cs: Also check the using aliases here.
19936
19937         * driver.cs: Move the test for using validity after the types have
19938         been entered, so we do a single pass that also includes the using
19939         aliases. 
19940
19941         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19942         in the regular case.   CreateSiblingForFinally is doing extra
19943         error checking.
19944
19945         * attribute.cs (GetAttributeArgumentExpression): Store the result
19946         on an out value, and use the return value to indicate failure
19947         instead of using null (which is a valid return for Constant.GetValue).
19948
19949         * statement.cs: Perform the analysis flow for the increment
19950         portion after the statement, because this will be the real flow of
19951         execution.  Fixes #42385
19952
19953         * codegen.cs (EmitContext.EmitArgument,
19954         EmitContext.EmitStoreArgument): New helper functions when the
19955         RemapToProxy flag is set.
19956
19957         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19958         function.
19959
19960         Add support for remapping parameters. 
19961
19962         * iterators.cs: Propagate parameter values;  Store parameter
19963         values in the proxy classes.
19964
19965 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
19966
19967         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
19968         need a proxy reference;  I do not know what I was thinking
19969
19970         * cs-parser.jay (constructor_initializer): catch another error,
19971         and display nice message.
19972
19973         (field_declaration): catch void field declaration
19974         to flag a better error. 
19975
19976         * class.cs (MemberBase.CheckBase): Report an error instead of a
19977         warning if a new protected member is declared in a struct. 
19978         (Field.Define): catch the error of readonly/volatile.
19979
19980         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19981
19982         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
19983         volatile variable is taken
19984
19985 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
19986
19987         * statement.cs (Fixed.Resolve): Report an error if we are not in
19988         an unsafe context.
19989
19990 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
19991
19992         * typemanager.cs: reuse the code that handles type clashes for
19993         delegates and enumerations.
19994
19995         * class.cs (Report28): Always report.
19996
19997         * expression.cs (EncodeAsAttribute): Allow nulls here.
19998
19999 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20002         the functionality for testing whether an expression is valid for
20003         an attribute here.  Also handle the case of arrays of elements
20004         being stored. 
20005
20006         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20007         encoding a linear array into an array of objects that are suitable
20008         to be passed to an CustomAttributeBuilder.
20009
20010         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20011
20012         * ecore.cs: (FieldExpr): Handle field remapping here.
20013
20014         * iteratators.cs: Pass the instance variable (if the method is an
20015         instance method) to the constructors, so we can access the field
20016         variables on the class.
20017
20018         TODO: Test this with structs.  I think the THIS variable on
20019         structs might have to be a pointer, and not a refenrece
20020
20021 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20022
20023         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20024         local variables to fields in a proxy class.
20025
20026         * iterators.cs (PopulateProxy): Rename our internal fields to
20027         <XXX>.  
20028         Create a <THIS> field if we are an instance method, so we can
20029         reference our parent container variables.
20030         (MapVariable): Called back from the EmitContext code to enter a
20031         new variable to field mapping into the proxy class (we just create
20032         a FieldBuilder).
20033
20034         * expression.cs
20035         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20036         for using the remapped locals to fields.
20037
20038         I placed the code here, because that gives the same semantics to
20039         local variables, and only changes the Emit code.
20040
20041         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20042         statements inside iterators.
20043         (VariableInfo): Add a FieldBuilder for the cases when we are
20044         remapping local variables to fields in a proxy class
20045
20046         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20047         current_block != null.
20048
20049         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20050         not cope with strings, as it has been moved to the
20051         TableSwitchEmit.  Fixed bug in switch generation.
20052
20053         * expression.cs (New.DoResolve): Provide more context for the user
20054         when reporting an error.
20055
20056         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20057         pointers. 
20058
20059         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20060         check the permissions for it.  Note than in a type-resolution
20061         context the check was already present in DeclSpace.ResolveType,
20062         but was missing from the MemberAccess.
20063
20064         (ArrayCreation.CheckIndices): warn if the user has
20065         more nested levels of expressions, but there are no more
20066         dimensions specified.  Avoids crash on bug 41906.
20067
20068 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20069
20070         * statement.cs (Block): replace Implicit bool, for a generic
20071         flags.   
20072         New flag: `Unchecked'.  This is used during the EmitMeta phase
20073         (which is out-of-line with the regular Resolve/Emit process for a
20074         statement, as this is done ahead of time, but still gets a chance
20075         to call constant resolve).
20076
20077         (Block.Flags): new enum for adding a new flag.
20078
20079         (Block.EmitMeta): track the state of unchecked.
20080
20081         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20082         to enable constant resolution to work there as well.
20083
20084 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20085
20086         * typemanager.cs (ienumerable_type): Also look up
20087         System.Collections.IEnumerable. 
20088
20089 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20090
20091         TODO: Test more than one conditional per method.
20092
20093         * class.cs (Indexer.Define): Report the location where the user is
20094         referencing the unsupported feature.
20095
20096         (MethodData): Overload the use of `conditionals' to
20097         minimize the creation of needless ArrayLists.   This saves roughly
20098         212kb on my machine.
20099
20100         (Method): Implement the new IIteratorContainer interface.
20101         (Method.SetYields): Implement the method by setting the ModFlags
20102         to contain METHOD_YIELDS.
20103
20104         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20105         which just got set to null.
20106
20107         * iterators.cs: New file.
20108
20109         (Yield, YieldBreak): New statements.
20110
20111         * statement.cs (Return.Resolve): Flag an error if we are used in
20112         an iterator method.
20113
20114         * codegen.cs (InIterator): New flag set if the code is being
20115         compiled in an iterator method.
20116
20117         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20118         internal modifier, and we just use it to avoid adding extra
20119         fields, as this is seldom used.  
20120
20121         * cs-parser.jay: Add yield_statement (yield and yield break).
20122
20123         * driver.cs: New flag -v2 to turn on version 2 features. 
20124
20125         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20126         hashtable when v2 is enabled.
20127
20128 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20129
20130         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20131         there is already a namespace defined with this name.
20132
20133         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20134         people upgraded their corlibs.
20135
20136         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20137         always use fully qualified types, no need to use the compiler
20138         front end.
20139
20140         (TypeManager.IsNamespace): Use binarysearch.
20141
20142         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20143         AddDelegate): I did not quite use the new IsValid API properly: I
20144         have to pass the short-name and the fullname.  I was passing only
20145         the basename instead of the fullname sometimes. 
20146
20147         (TypeContainer.DefineType): call NamespaceClash.
20148
20149         * interface.cs (Interface.DefineType): use NamespaceClash before
20150         defining the type.
20151
20152         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20153         defining the type.
20154
20155         * enum.cs: (Enum.DefineType): use NamespaceClash before
20156         defining the type.
20157
20158         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20159         speed increase.  First, use the negative_hits cache when we get a
20160         negative.  Second, add the type with its full original name
20161         instead of the new . and + encoded name (reflection uses + to
20162         separate type from a nested type).  Use LookupTypeReflection
20163         directly which bypasses the type->name hashtable (that we already
20164         know does not contain the type.
20165
20166         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20167         location/container type. 
20168
20169         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20170
20171 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20172
20173         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20174
20175         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20176         method is being referenced in the method group from a static
20177         context, and report error 120 if so.
20178
20179         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20180         Error118. 
20181
20182         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20183         is created, we create the A namespace).
20184
20185         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20186         Fixes #41591
20187
20188 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20189
20190         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20191         invocation to ModuleBuilder.GetType with the same values will
20192         return a new type instance, so we need to cache its return
20193         values. 
20194
20195         * expression.cs (Binary.ResolveOperator): Only allow the compare
20196         operators on enums if they are of the same type.
20197
20198         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20199         types of ValueType on their own case.  Before we were giving them
20200         the same treatment as objects.
20201
20202         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20203         fullname.  Short name is used to compare against container name.
20204         Fullname is used to check against defined namespace names.
20205
20206         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20207         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20208
20209         (Method.CheckBase): Call parent.
20210         (MemberBase.CheckBase): Check for protected members on sealed
20211         classes.
20212         (PropertyBase.CheckBase): Call parent.
20213         (Field.Define): Call parent.
20214
20215         * report.cs: Negative error codes are now mapped to 8000 - code,
20216         so that the display is render more nicely.
20217
20218         * typemanager.cs: Do not use try/catch, instead report a regular
20219         error. 
20220
20221         (GetPointerType, GetReferenceType): These methods provide
20222         mechanisms to obtain the T* and T& from a T.  We had the code
20223         previously scattered around the code base, and it also used
20224         TypeManager.LookupType that would go through plenty of caches.
20225         This one goes directly to the type source.
20226
20227         In some places we did the Type.GetType followed by
20228         ModuleBuilder.GetType, but not in others, so this unifies the
20229         processing as well.
20230
20231         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20232         statements now that we have namespace information.
20233
20234         * typemanager.cs (IsNamespace): New method, returns whether the
20235         string presented is a namespace or not.
20236
20237         (ComputeNamespaces): New public entry point, computes the list of
20238         available namespaces, using the GetNamespaces API call in Mono, or
20239         the slower version in MS.NET.   
20240
20241         Now before we start the semantic analysis phase, we have a
20242         complete list of namespaces including everything that the user has
20243         provided.
20244
20245         Deleted old code to cache namespaces in .nsc files.
20246
20247 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
20248
20249         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20250         class/struct location definition Location for the implicit
20251         constructor location.
20252
20253         (Operator.Define): Use the location of the operator for the
20254         implicit Method definition.
20255
20256         (Constructor.Emit): use the constructor location for the implicit
20257         base initializer constructor.
20258
20259         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
20260         and the Expression class now contains two new methods:
20261
20262         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
20263         isolate type lookup from the rest of the resolution process.
20264
20265         Since we use Expressions to hold type definitions due to the way
20266         we parse the input we have historically overloaded Resolve to
20267         perform the Type lookups if a special flag is passed.  Now this is
20268         eliminated and two methods take their place. 
20269
20270         The differences in the two methods between xStep and xTerminal is
20271         that xStep is involved in our current lookup system that uses
20272         SimpleNames to compose a name, while xTerminal is used just to
20273         catch the case where the simplename lookup failed.
20274
20275 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20276
20277         * expression.cs (ResolveMemberAccess): Remove redundant code.
20278         TypeExpr expressions are always born fully resolved.
20279
20280         * interface.cs (PopulateMethod): Do not lookup the types twice.
20281         We were doing it once during SemanticAnalysis and once during
20282         PopulateMethod.
20283
20284         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20285         in local variable type definitions, were being returned as a
20286         SimpleName (we decomposed everything into a string), that is
20287         because primary_expression was being used instead of a type in the
20288         grammar (reduce/reduce conflicts).
20289
20290         The part that was wrong is that we converted the expression into a
20291         string (an oversimplification in one hand, compounded with primary
20292         expressions doing string concatenation).
20293
20294         So things like:
20295
20296         A.B.C [] x;
20297
20298         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20299         using clauses from working on this particular context.  And a type
20300         was being matched directly against "A.B.C[]".
20301
20302         We now use the correct approach, and allow for ComposedCast to be
20303         part of the unary expression.  So the "A.B.C []" become a composed
20304         cast of "A.B.C" (as a nested group of MemberAccess with a
20305         SimpleName at the end) plus the rank composition "[]". 
20306
20307         Also fixes 35567
20308
20309 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20312         for the access level checking.
20313
20314         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20315         `TypeContainer container', because I kept getting confused when I
20316         was debugging this code.
20317
20318         * expression.cs (Indexers): Instead of tracking getters/setters,
20319         we now track them in parallel.  We create one arraylist less, but
20320         most importantly it is possible now for the LValue code to find a
20321         matching get for a set.
20322
20323         (IndexerAccess.DoResolveLValue): Update the code.
20324         GetIndexersForType has been modified already to extract all the
20325         indexers from a type.  The code assumed it did not.
20326
20327         Also make the code set the correct return type for the indexer.
20328         This was fixed a long time ago for properties, but was missing for
20329         indexers.  It used to be void_type.
20330
20331         (Binary.Emit): Test first for doubles instead of
20332         floats, as they are more common.
20333
20334         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20335         when dealing with floats and the <=, >= operators.  This fixes bug
20336         #39314 
20337
20338         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20339         to load the array value by emitting a load on the foreach variable
20340         type.  This was incorrect.  
20341
20342         We now emit the code to load an element using the the array
20343         variable type, and then we emit the conversion operator.
20344
20345         Fixed #40176
20346
20347 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20348
20349         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20350
20351 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20352
20353         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20354         test for protection before we test for signatures. 
20355
20356         (MethodSignature.ToString): implement.
20357
20358         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20359         to the case where we reduced into a LongConstant.
20360
20361         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20362         depend on whether the information is acurrate, because the
20363         Microsoft runtime will always claim that the array type is public,
20364         regardless of the real state.
20365
20366         If the type is a pointer, another problem happens: the type is
20367         reported as non-public in Microsoft.  
20368
20369         In both cases we have to call CheckAccessLevel recursively with
20370         the underlying type as the argument to be tested.
20371
20372 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20373
20374         * assign.cs (Assign.Emit): If we are dealing with a compound
20375         assignment expression, we should use the code path that stores the
20376         intermediate result in a temporary value.  This fixes #40903.
20377
20378         *expression.cs (Indirection.ToString): Provide ToString method for
20379         debugging. 
20380
20381 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
20382
20383         * class.cs: Null out fields holding references to Block objects so
20384         they can be garbage collected.
20385
20386         * expression.cs (OverloadResolve): Remove unused local.
20387
20388 2003-04-07  Martin Baulig  <martin@ximian.com>
20389
20390         * codegen.cs (EmitContext.CurrentFile): New public field.
20391         (EmitContext.Mark): Use the CurrentFile to check whether the
20392         location is in the correct file.
20393         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20394
20395 2003-04-07  Martin Baulig  <martin@ximian.com>
20396
20397         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20398
20399         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20400         location.  [FIXME: The location argument which gets passed to this
20401         method is sometimes wrong!]
20402
20403 2003-04-07  Nick Drochak <ndrochak@gol.com>
20404
20405         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20406
20407 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * expression.cs (Indirection.EmitAssign): We were using the
20410         temporary, but returning immediately instead of continuing the
20411         EmitAssing flow.
20412
20413 2003-04-06  Martin Baulig  <martin@ximian.com>
20414
20415         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20416         if it's a nested child, but also deriving from the outer class.
20417         See test 190.cs.
20418
20419         * typemanager.cs (IsNestedChildOf): Make this work if it's a
20420         nested child, but also deriving from the outer class.  See
20421         test-190.cs.
20422         (FilterWithClosure): We may access private members of the outer
20423         class if we're a nested child and deriving from the outer class.
20424         (RealMemberLookup): Only set `closure_private_ok' if the
20425         `original_bf' contained BindingFlags.NonPublic.
20426
20427 2003-04-05  Martin Baulig  <martin@ximian.com>
20428
20429         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20430
20431 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
20432
20433         * class.cs (Event.Define): Do not allow abstract events to have
20434         initializers. 
20435
20436 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
20437
20438         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20439         block in event declarations.
20440
20441         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20442         value type, get its address.
20443
20444         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20445         leaving a class on the stack instead of a boolean value (int
20446         0/1).  Change the code so we compare against null, and then the
20447         result against zero.
20448
20449         * class.cs (TypeContainer.GetClassBases): We were checking for the
20450         parent class being sealed too late.
20451
20452         * expression.cs (Binary.Emit): For <= and >= when dealing with
20453         floating point values, use cgt.un and clt.un instead of cgt and
20454         clt alone.
20455
20456 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
20457
20458         * statement.cs: Apply the same optimization as MS: skip the 
20459         GetEnumerator returning an IEnumerator, and use the one returning a 
20460         CharEnumerator instead. This allows us to avoid the try-finally block 
20461         and the boxing.
20462
20463 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
20464
20465         * cs-parser.jay: Attributes cannot be applied to
20466                          namespaces. Fixes #40473
20467
20468 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20469
20470         * class.cs:
20471         (Add*): check if the name is valid using the full name for constants,
20472         fields, properties and events.
20473
20474 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
20475
20476         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20477         char constants to be part of the enumeration.
20478
20479         * expression.cs (Conditional.DoResolve): Add support for operator
20480         true. Implements the missing functionality from 14.12
20481
20482         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20483         operator true/false as required by the spec.
20484
20485         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20486         implicit conversion to boolean.
20487
20488         * statement.cs (Statement.ResolveBoolean): A boolean expression is
20489         also one where the type implements `operator true'. 
20490
20491         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20492         get an expression that will invoke operator true based on an
20493         expression.  
20494
20495         (GetConversionOperators): Removed the hack that called op_True
20496         here.  
20497
20498         (Expression.ResolveBoolean): Move this from Statement.
20499
20500 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20501
20502         * ecore.cs (FieldExpr): do not allow initialization of initonly
20503         fields on derived classes
20504
20505 2003-03-13  Martin Baulig  <martin@ximian.com>
20506
20507         * statement.cs (Block.Emit): Call ig.BeginScope() and
20508         ig.EndScope() when compiling with debugging info; call
20509         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20510
20511 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20512
20513         * expression.cs (Indexers): Do not construct immediately, allow
20514         for new members to be appended as we go.  Fixes 38143
20515
20516 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20517
20518         * expression.cs: save/restore context when resolving an unchecked
20519         expression.
20520
20521 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20522
20523         * cfold.cs: Catch division by zero in modulus operator during
20524         constant folding.
20525
20526 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20527
20528         * interface.cs (Interface.DefineMembers): Avoid defining members
20529         twice. 
20530
20531 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * driver.cs: handle the +/- options for -noconfig
20534
20535         * statement.cs (Unckeched.Resolve): Also track the state of
20536         unchecked in the Resolve phase.
20537
20538 2003-02-27  Martin Baulig  <martin@ximian.com>
20539
20540         * ecore.cs (Expression.MemberLookup): Don't create a
20541         MethodGroupExpr for something which is not a method.  Fixes #38291.
20542
20543 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20544
20545         * class.cs (MemberBase.CheckParameters): Also check that the type
20546         is unmanaged if it is a pointer.
20547
20548         * expression.cs (SizeOf.Resolve): Add location information.
20549
20550         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20551         a managed type is declared.
20552
20553         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20554         parameter modifiers as well.  Fixes bug 38606
20555
20556         * class.cs: Very sad.  Am backing out the speed up changes
20557         introduced by the ArrayList -> Array in the TypeContainer, as they
20558         were not actually that much faster, and introduced a bug (no error
20559         reports on duplicated methods).
20560
20561         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20562         source first, this will guarantee that we have a valid expression
20563         before calling in lower levels functions that will require a
20564         resolved object.  Then use this original_source in the
20565         target.ResolveLValue instead of the original source that was
20566         passed to us.
20567
20568         Another change.  Use target.Resolve instead of LValueResolve.
20569         Although we are resolving for LValues, we will let the Assign code
20570         take care of that (it will be called again from Resolve).  This
20571         basically allows code like this:
20572
20573         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20574         class Y { void A (X x) { x [0] += o; }
20575
20576         The problem was that the indexer was trying to resolve for
20577         set_Item (idx, object o) and never finding one.  The real set_Item
20578         was set_Item (idx, X).  By delaying the process we get the right
20579         semantics. 
20580
20581         Fixes bug 36505
20582
20583 2003-02-23  Martin Baulig  <martin@ximian.com>
20584
20585         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20586         while calling DoEmit ().
20587
20588         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20589         source files; if you use the #line directive inside a method, the
20590         compiler stops emitting line numbers for the debugger until it
20591         reaches the end of the method or another #line directive which
20592         restores the original file.
20593
20594 2003-02-23  Martin Baulig  <martin@ximian.com>
20595
20596         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20597
20598 2003-02-23  Martin Baulig  <martin@ximian.com>
20599
20600         * statement.cs (Block.AddChildVariableNames): We need to call this
20601         recursively, not just for our immediate children.
20602
20603 2003-02-23  Martin Baulig  <martin@ximian.com>
20604
20605         * class.cs (Event.Define): Always make the field private, like csc does.
20606
20607         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20608         actually work, fixes bug #37521.
20609
20610 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20611
20612         * delegate.cs: When creating the various temporary "Parameters"
20613         classes, make sure that we call the ComputeAndDefineParameterTypes
20614         on those new parameters (just like we do with the formal ones), to
20615         allow them to be resolved in the context of the DeclSpace.
20616
20617         This fixes the bug that Dick observed in Bugzilla #38530.
20618
20619 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20620
20621         * expression.cs (ResolveMemberAccess): When resolving a constant,
20622         do not attempt to pull a constant if the value was not able to
20623         generate a valid constant.
20624
20625         * const.cs (LookupConstantValue): Do not report more errors than required.
20626
20627 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20628
20629         * expression.cs: fixes bug #38328.
20630
20631 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20632
20633         * class.cs: Changed all the various members that can be part of a
20634         class from being an ArrayList to be an Array of the right type.
20635         During the DefineType type_list, interface_list, delegate_list and
20636         enum_list are turned into types, interfaces, delegates and enums
20637         arrays.  
20638
20639         And during the member population, indexer_list, event_list,
20640         constant_list, field_list, instance_constructor_list, method_list,
20641         operator_list and property_list are turned into their real arrays.
20642
20643         Although we could probably perform this operation earlier, for
20644         good error reporting we need to keep the lists and remove the
20645         lists for longer than required.
20646
20647         This optimization was triggered by Paolo profiling the compiler
20648         speed on the output of `gen-sample-program.pl' perl script. 
20649
20650         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20651         not crash in methods like MemberLookupFailed that use this field.  
20652
20653         This problem arises when the compiler fails to resolve a type
20654         during interface type definition for example.
20655
20656 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20657
20658         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20659         inherit from System.Object, so we have to stop at null, not only
20660         when reaching System.Object.
20661
20662 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20663
20664         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20665         DeclaredOnly because the parent indexer might have had a different
20666         name, but did not loop until the top of the hierarchy was reached.
20667
20668         The problem this one fixes is 35492: when a class implemented an
20669         indexer from an interface, we were getting the interface method
20670         (which was abstract) and we were flagging an error (can not invoke
20671         abstract method).
20672
20673         This also keeps bug 33089 functioning, and test-148 functioning.
20674
20675         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20676         out if a method is special is to see if it is declared in a
20677         property or event, or whether it is one of the predefined operator
20678         names.   This should fix correctly #36804.
20679
20680 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20681
20682         The goal here is to remove the dependency on EmptyCast.Peel ().
20683         Killing it completely.
20684
20685         The problem is that currently in a number of places where
20686         constants are expected, we have to "probe" for an EmptyCast, and
20687         Peel, which is not the correct thing to do, as this will be
20688         repetitive and will likely lead to errors. 
20689
20690         The idea is to remove any EmptyCasts that are used in casts that
20691         can be reduced to constants, so we only have to cope with
20692         constants. 
20693
20694         This bug hunt was triggered by Bug 37363 and the desire to remove
20695         the duplicate pattern where we were "peeling" emptycasts to check
20696         whether they were constants.  Now constants will always be
20697         constants.
20698
20699         * ecore.cs: Use an enumconstant here instead of wrapping with
20700         EmptyCast.  
20701
20702         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20703         throwing me off.  By handling this we can get rid of a few hacks.
20704
20705         * statement.cs (Switch): Removed Peel() code.
20706
20707 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * class.cs: Location information for error 508
20710
20711         * expression.cs (New.DoResolve): Add a guard against double
20712         resolution of an expression.  
20713
20714         The New DoResolve might be called twice when initializing field
20715         expressions (see EmitFieldInitializers, the call to
20716         GetInitializerExpression will perform a resolve on the expression,
20717         and later the assign will trigger another resolution
20718
20719         This leads to bugs (#37014)
20720
20721         * delegate.cs: The signature for EndInvoke should contain any ref
20722         or out parameters as well.  We were not doing this in the past. 
20723
20724         * class.cs (Field.Define): Do not overwrite the type definition
20725         inside the `volatile' group.  Turns out that volatile enumerations
20726         were changing the type here to perform a validity test, which
20727         broke conversions. 
20728
20729 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20730
20731         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20732         and structs, we do not want to load the instance variable
20733
20734         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20735         enum_type has to be handled like an object reference (implicit
20736         conversions exists from this to object), but the regular IsClass
20737         and IsValueType tests will never return true for this one.
20738
20739         Also we use TypeManager.IsValueType instead of type.IsValueType,
20740         just for consistency with the rest of the code (this is only
20741         needed if we ever use the construct exposed by test-180.cs inside
20742         corlib, which we dont today).
20743
20744 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20745
20746         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20747         just InternalCall.
20748
20749 2003-02-09  Martin Baulig  <martin@ximian.com>
20750
20751         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20752         (Namespace.DefineNamespaces): New static public method; this is
20753         called when we're compiling with debugging to add all namespaces
20754         to the symbol file.
20755
20756         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20757         pass it to the Namespace's .ctor.
20758
20759         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20760         and MethodBase arguments; pass the namespace ID to the symwriter;
20761         pass the MethodBase instead of the token to the symwriter.
20762         (SymbolWriter.DefineNamespace): New method to add a namespace to
20763         the symbol file.
20764
20765 2003-02-09  Martin Baulig  <martin@ximian.com>
20766
20767         * symbolwriter.cs: New file.  This is a wrapper around
20768         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20769         methods here in near future.
20770
20771 2003-02-09  Martin Baulig  <martin@ximian.com>
20772
20773         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20774         ILGenerator.MarkSequencePoint() which are actually used by the
20775         symbol writer.
20776
20777 2003-02-09  Martin Baulig  <martin@ximian.com>
20778
20779         * location.cs (SourceFile): New public sealed class.  This
20780         contains the name and an index which is used in the location's token.
20781         (Location): Reserve an appropriate number of bits in the token for
20782         the source file instead of walking over that list, this gives us a
20783         really huge performance improvement when compiling with debugging.
20784
20785         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20786         `SourceFile' argument instead of a string.
20787         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20788         but don't parse/tokenize here, we need to generate the list of all
20789         source files before we do that.
20790         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20791         the files.
20792
20793         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20794         instead of a string.
20795
20796         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20797         of a string.
20798
20799 2003-02-09  Martin Baulig  <martin@ximian.com>
20800
20801         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20802         filename on `#line default'.
20803
20804 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20805
20806         * statement.cs: don't clear the pinned var when the fixed statement
20807         returns from the method (fixes bug#37752).
20808
20809 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20810
20811         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20812         to IsValueType.
20813
20814 2003-02-07  Martin Baulig  <martin@ximian.com>
20815
20816         * driver.cs: Removed the `--debug-args' command line argument.
20817
20818         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20819         automatically by the AsssemblyBuilder.
20820         (CodeGen.InitializeSymbolWriter): We don't need to call any
20821         initialization function on the symbol writer anymore.  This method
20822         doesn't take any arguments.
20823
20824 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20825
20826         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20827         from referenced assemblies as well.
20828
20829 2003-02-02  Martin Baulig  <martin@ximian.com>
20830
20831         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20832
20833 2003-02-02  Martin Baulig  <martin@ximian.com>
20834
20835         * class.cs (Constructor.Emit): Open the symbol writer before
20836         emitting the constructor initializer.
20837         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20838         single-stepping through constructor initializers.
20839
20840 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * class.cs: Handle error 549: do not allow virtual methods in
20843         sealed classes. 
20844
20845 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20846
20847         * decl.cs: Check access levels when resolving types
20848
20849 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20850
20851         * statement.cs: Add parameters and locals set in catch blocks that might 
20852         return to set vector
20853
20854 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * class.cs (Operator): Set the SpecialName flags for operators.
20857
20858         * expression.cs (Invocation.DoResolve): Only block calls to
20859         accessors and operators on SpecialName methods.
20860
20861         (Cast.TryReduce): Handle conversions from char constants.
20862
20863
20864 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20865
20866         * statement.cs: small memory and time optimization in FlowBranching.
20867
20868 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20869
20870         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20871         problem that the last fix but in the other sid (Set).
20872
20873         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20874         access when there is no indexer in the hierarchy.
20875
20876 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20877
20878         * class.cs: Combine some if statements.
20879
20880 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20881
20882         * driver.cs: fixed bug #37187.
20883
20884 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20885
20886         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20887         any indexer, it's needed to build a list with all the indexers in the
20888         hierarchy (AllGetters), else we have problems. Fixes #35653.
20889
20890 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20891
20892         * class.cs (MethodData.Define): It is wrong for an interface
20893         implementation to be static in both cases: explicit and implicit.
20894         We were only handling this in one case.
20895
20896         Improve the if situation there to not have negations.
20897
20898         * class.cs (Field.Define): Turns out that we do not need to check
20899         the unsafe bit on field definition, only on usage.  Remove the test.
20900
20901 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20902
20903         * driver.cs: use assembly.Location instead of Codebase (the latest
20904         patch made mcs fail when using MS assemblies).
20905
20906 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20907
20908         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20909         get the path to *corlib.dll.
20910
20911 2003-01-21  Nick Drochak <ndrochak@gol.com>
20912
20913         * cs-tokenizer.cs:
20914         * pending.cs:
20915         * typemanager.cs: Remove compiler warnings
20916
20917 2003-01-20  Duncan Mak  <duncan@ximian.com>
20918
20919         * AssemblyInfo.cs: Bump the version number to 0.19.
20920
20921 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20922
20923         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20924
20925 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
20926
20927         * class.cs (Constructor::Emit): Emit debugging info for constructors.
20928
20929 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
20930
20931         * cs-parser.jay: Small fix: we were not comparing the constructor
20932         name correctly.   Thanks to Zoltan for the initial pointer.
20933
20934 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20935
20936         * cs-tokenizer.cs: Set file name when specified with #line
20937
20938 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
20939
20940         * cs-parser.jay: Only perform the constructor checks here if we
20941         are named like the class;  This will help provider a better
20942         error.  The constructor path is taken when a type definition is
20943         not found, but most likely the user forgot to add the type, so
20944         report that rather than the constructor error.
20945
20946 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20947
20948         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20949         allocations.
20950
20951 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20952
20953         * cs-parser.jay: Add cleanup call.
20954
20955 2003-01-13  Duncan Mak  <duncan@ximian.com>
20956
20957         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20958         consistent with other methods.
20959
20960 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20961
20962         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20963
20964 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20965
20966         * attribute.cs: only set GuidAttr to true when we have a
20967         GuidAttribute.
20968
20969 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20970
20971         * ecore.cs:
20972         * expression.cs:
20973         * typemanager.cs: fixes to allow mcs compile corlib with the new
20974         Type.IsSubclassOf fix.
20975
20976 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
20977
20978         * expression.cs (LocalVariableReference.DoResolve): Classify a
20979         constant as a value, not as a variable.   Also, set the type for
20980         the variable.
20981
20982         * cs-parser.jay (fixed_statement): take a type instead of a
20983         pointer_type, so we can produce a better error message later.
20984
20985         * statement.cs (Fixed.Resolve): Flag types that are not pointers
20986         as an error.  
20987
20988         (For.DoEmit): Make inifinite loops have a
20989         non-conditional branch back.
20990
20991         (Fixed.DoEmit): First populate the pinned variables, then emit the
20992         statement, then clear the variables.  Before I was emitting the
20993         code once for each fixed piece.
20994
20995
20996 2003-01-08  Martin Baulig  <martin@ximian.com>
20997
20998         * statement.cs (FlowBranching.MergeChild): A break in a
20999         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21000
21001 2003-01-08  Martin Baulig  <martin@ximian.com>
21002
21003         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21004         lives in the same number space than `param_map'.  Fixes #36154.
21005
21006 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21007
21008         * cs-parser.jay (constructor_declaration): Set the
21009         Constructor.ModFlags before probing for it.  This makes the
21010         compiler report 514, 515 and 132 (the code was there, but got
21011         broken). 
21012
21013         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21014         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21015         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21016
21017 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21018
21019         * enum.cs: create the enum static fields using the enum type.
21020
21021 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21022
21023         * class.cs: don't try to create the ParamBuilder for the return
21024         type if it's not needed (and handle it breaking for the ms runtime
21025         anyway).
21026
21027 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21028
21029         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21030
21031 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21034         the command.   This showed up while compiling the JANET source
21035         code, which used \r as its only newline separator.
21036
21037 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21038
21039         * class.cs (Method.Define): If we are an operator (because it
21040         reuses our code), then set the SpecialName and HideBySig.  #36128
21041
21042 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21045         exception, report error 120 `object reference required'.
21046
21047         * driver.cs: Add --pause option, used during to measure the size
21048         of the process as it goes with --timestamp.
21049
21050         * expression.cs (Invocation.DoResolve): Do not allow methods with
21051         SpecialName to be invoked.
21052
21053 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21054
21055         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21056         number before adding it.
21057
21058 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21059
21060         * ecore.cs (StandardImplicitConversion): When in an unsafe
21061         context, we allow conversion between void * to any other pointer
21062         type. This fixes bug #35973.
21063
21064 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21065
21066         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21067         is not thrown when extensionless outputs are used 
21068
21069 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21070
21071         * rootcontext.cs: fixed compilation of corlib.
21072
21073 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21074
21075         * attribute.cs (Attributes.Contains): Add new method.
21076
21077         * class.cs (MethodCore.LabelParameters): if the parameter is an
21078         `out' parameter, check that no attribute `[In]' has been passed.
21079
21080         * enum.cs: Handle the `value__' name in an enumeration.
21081
21082 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21083
21084         * decl.cs: Added special case to allow overrides on "protected
21085         internal" methods
21086
21087 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21088
21089         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21090         since it makes much more sense.
21091
21092         (Attributes.ctor): Don't require a Location parameter.
21093
21094         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21095
21096         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21097         since we already have that information per attribute.
21098
21099         * everywhere : make appropriate changes.
21100
21101         * class.cs (LabelParameters): Write the code which actually
21102         applies attributes to the return type. We can't do this on the MS
21103         .NET runtime so we flag a warning in the case an exception is
21104         thrown.
21105
21106 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21107
21108         * const.cs: Handle implicit null conversions here too.
21109
21110 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21111
21112         * class.cs (MethodCore.LabelParameters): Remove the extra
21113         Type [] parameter since it is completely unnecessary. Instead
21114         pass in the method's attributes so that we can extract
21115         the "return" attribute.
21116
21117 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21118
21119         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21120         of ignoring it and letting the compile continue.
21121
21122         * typemanager.cs (ChangeType): use an extra argument to return an
21123         error condition instead of throwing an exception.
21124
21125 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21126
21127         * expression.cs (Unary.TryReduce): mimic the code for the regular
21128         code path.  Perform an implicit cast in the cases where we can
21129         implicitly convert to one of the integral types, and then reduce
21130         based on that constant.   This fixes bug #35483.
21131
21132 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21133
21134         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21135
21136 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21137
21138         * namespace.cs: fixed bug #35489.
21139
21140 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21141
21142         * class.cs: Remove some dead code.
21143
21144         * cs-parser.jay: Estimate the number of methods needed
21145         (RootContext.MethodCount);
21146
21147         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21148         numbers instead of StringBuilders.
21149
21150         * support.cs (PtrHashtable): Add constructor with initial size;
21151         We can now reduce reallocations of the method table.
21152
21153 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21154
21155         * attribute.cs (ApplyAttributes): Keep track of the emitted
21156         attributes on a per-target basis. This fixes bug #35413.
21157
21158 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21159
21160         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21161         default to the Windows 1252 encoding.
21162
21163         (UnixParseOption): Support version, thanks to Alp for the missing
21164         pointer. 
21165
21166         * AssemblyInfo.cs: Add nice assembly information.
21167
21168         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21169         (bug 35169).
21170
21171         * cs-parser.jay: Allow a trailing comma before the close bracked
21172         in the attribute_section production.
21173
21174         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21175         address of the instance was being taken, I will take this out,
21176         because we take the address of the object immediately here.
21177
21178 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21179
21180         * typemanager.cs (AreMultipleAllowed): Take care of the most
21181         obvious case where attribute type is not in the current assembly -
21182         stupid me ;-)
21183
21184 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21185
21186         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21187         definitions, instead of doing that afterwards.  
21188
21189         Also we use a nice little hack, depending on the constructor, we
21190         know if we are a "composed" name or a simple name.  Hence, we
21191         avoid the IndexOf test, and we avoid 
21192
21193         * codegen.cs: Add code to assist in a bug reporter to track down
21194         the source of a compiler crash. 
21195
21196 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21197
21198         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21199         types have been emitted for a given element and flag an error
21200         if something which does not have AllowMultiple set is used more
21201         than once.
21202
21203         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21204         attribute types and their corresponding AllowMultiple properties
21205
21206         (AreMultipleAllowed): Check the property for a given type.
21207
21208         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21209         property in the case we have a TypeContainer.
21210
21211         (Attributes.AddAttribute): Detect duplicates and just skip on
21212         adding them. This trivial fix catches a pretty gross error in our
21213         attribute emission - global attributes were being emitted twice!
21214
21215         Bugzilla bug #33187 is now fixed.
21216
21217 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21218
21219         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21220         instead of pp_and).
21221
21222         * expression.cs (Binary.ResolveOperator): I can only use the
21223         Concat (string, string, string) and Concat (string, string,
21224         string, string) if the child is actually a concatenation of
21225         strings. 
21226
21227 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21228
21229         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21230         context where we need a 2-character lookahead.
21231
21232         * pending.cs (PendingImplementation): Rework so we can keep track
21233         of interface types all the time, and flag those which were
21234         implemented by parents as optional.
21235
21236 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21237
21238         * expression.cs (Binary.ResolveOperator): Use
21239         String.Concat(string,string,string) or
21240         String.Concat(string,string,string,string) when possible. 
21241
21242         * typemanager: More helper methods.
21243
21244
21245 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21246
21247         * pending.cs: remove the bogus return from GetMissingInterfaces()
21248         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21249
21250 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21251
21252         * namespace.cs: avoid duplicated 'using xxx' being added to
21253         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21254         when we get more than one 'using' statement for the same namespace.
21255         Report a CS0105 warning for it.
21256
21257 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
21258
21259         * cs-tokenizer.cs (consume_identifier): use read directly, instead
21260         of calling getChar/putback, uses internal knowledge of it.    
21261
21262         (xtoken): Reorder tokenizer so most common patterns are checked
21263         first.  This reduces the compilation time in another 5% (from 8.11s
21264         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21265
21266         The parsing time is 22% of the compilation in mcs, and from that
21267         64% is spent on the tokenization process.  
21268
21269         I tried using a binary search for keywords, but this is slower
21270         than the hashtable.  Another option would be to do a couple of
21271         things:
21272
21273                 * Not use a StringBuilder, instead use an array of chars,
21274                   with a set value.  Notice that this way we could catch
21275                   the 645 error without having to do it *afterwards*.
21276
21277                 * We could write a hand-parser to avoid the hashtable
21278                   compares altogether.
21279
21280         The identifier consumption process takes 37% of the tokenization
21281         time.  Another 15% is spent on is_number.  56% of the time spent
21282         on is_number is spent on Int64.Parse:
21283
21284                 * We could probably choose based on the string length to
21285                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21286                   computations. 
21287
21288         Another 3% is spend on wrapping `xtoken' in the `token' function.
21289
21290         Handle 0xa0 as whitespace (#34752)
21291
21292 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21293
21294         * typemanager.cs (IsCLRType): New routine to tell whether a type
21295         is one of the builtin types.  
21296
21297         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21298         typecode in more places instead of doing pointer comparissions.
21299         We could leverage some knowledge about the way the typecodes are
21300         laid out.
21301
21302         New code to cache namespaces in assemblies, it is currently not
21303         invoked, to be used soon.
21304
21305         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21306
21307         * expression.cs (Binary.ResolveOperator): specially handle
21308         strings, and do not perform user-defined operator overloading for
21309         built-in types.
21310
21311 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21314         internalcall as it is a pretty simple operation;  Avoid whenever
21315         possible to call Char.IsLetter.
21316
21317         (consume_identifier): Cut by half the number of
21318         hashtable calls by merging the is_keyword and GetKeyword behavior.
21319
21320         Do not short-circuit, because if we do, we
21321         report errors (ie, #if false && true would produce an invalid
21322         directive error);
21323
21324
21325 2002-11-24  Martin Baulig  <martin@ximian.com>
21326
21327         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21328         check constant ranges and report a CS0221.  Fixes #33186.
21329
21330 2002-11-24  Martin Baulig  <martin@ximian.com>
21331
21332         * cs-parser.jay: Make this work for uninitialized variable
21333         declarations in the `for' initializer.  Fixes #32416.
21334
21335 2002-11-24  Martin Baulig  <martin@ximian.com>
21336
21337         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21338         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21339
21340 2002-11-24  Martin Baulig  <martin@ximian.com>
21341
21342         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21343         argument; if true, we also check for user-defined conversions.
21344         This is only needed if both arguments are of a user-defined type.
21345         Fixes #30443, added test-175.cs.
21346         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21347
21348         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21349
21350 2002-11-24  Martin Baulig  <martin@ximian.com>
21351
21352         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21353         function to get the store opcode.
21354         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21355         only emit the Ldelema if the store opcode is Stobj.  You must run
21356         both test-34 and test-167 to test this.  Fixes #34529.
21357
21358 2002-11-23  Martin Baulig  <martin@ximian.com>
21359
21360         * ecore.cs (Expression.MemberLookup): Added additional
21361         `qualifier_type' argument which is used when we're being called
21362         from MemberAccess.DoResolve() and null if we're called from a
21363         SimpleName lookup.
21364         (Expression.MemberLookupFailed): New method to report errors; this
21365         does the CS1540 check and reports the correct error message.
21366
21367         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21368         argument for the CS1540 check and redone the way how we're dealing
21369         with private members.  See the comment in the source code for details.
21370         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21371         `closure_start_type' to `closure_qualifier_type' and check whether
21372         it's not null.  It was not this filter being broken, it was just
21373         being called with the wrong arguments.
21374
21375         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21376         and pass it the correct `qualifier_type'; this also does the error
21377         handling for us.
21378
21379 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * expression.cs (Invocation.EmitParams): If the we are dealing
21382         with a non-built-in value type, load its address as well.
21383
21384         (ArrayCreation): Use a a pretty constant instead
21385         of the hardcoded value 2.   Use 6 instead of 2 for the number of
21386         static initializers.  
21387
21388         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21389         because they are not really value types, just glorified integers. 
21390
21391         * driver.cs: Do not append .exe, the CSC compiler does not do it.
21392
21393         * ecore.cs: Remove redundant code for enumerations, make them use
21394         the same code path as everything else, fixes the casting issue
21395         with enumerations in Windows.Forms.
21396
21397         * attribute.cs: Do only cast to string if it is a string, the
21398         validation happens later.
21399
21400         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21401         people upgrade their corlibs.
21402
21403         * ecore.cs: Oops, enumerations were not following the entire code path
21404
21405 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
21406
21407         * typemanager.cs (FilterWithClosure): Commented out the test for
21408         1540 in typemanager.cs, as it has problems when accessing
21409         protected methods from a parent class (see test-174.cs). 
21410
21411         * attribute.cs (Attribute.ValidateGuid): new method.
21412         (Attribute.Resolve): Use above.
21413
21414 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
21415
21416         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21417
21418         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21419         handling for enumerations, as we only needed the TypeContainer
21420         functionality to begin with (this is required for the fix below to
21421         work for enums that reference constants in a container class for
21422         example). 
21423
21424         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21425
21426         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21427         a valid TypeBuilder to perform lookups on.o
21428
21429         * class.cs (InheritableMemberSignatureCompare): Use true in the
21430         call to GetGetMethod and GetSetMethod, because we are comparing
21431         the signature, and we need to get the methods *even* if they are
21432         private. 
21433
21434         (PropertyBase.CheckBase): ditto.
21435
21436         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21437         GotoCase.Resolve): Use Peel on EmpytCasts.
21438
21439         * ecore.cs (EmptyCast): drop child, add Peel method.
21440
21441 2002-11-17  Martin Baulig  <martin@ximian.com>
21442
21443         * ecore.cs (EmptyCast.Child): New public property.
21444
21445         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21446         label resolved to an EmptyCast.  Fixes #34162.
21447         (GotoCase.Resolve): Likewise.
21448         (Block.EmitMeta): Likewise.
21449
21450 2002-11-17  Martin Baulig  <martin@ximian.com>
21451
21452         * expression.cs (Invocation.BetterConversion): Prefer int over
21453         uint; short over ushort; long over ulong for integer literals.
21454         Use ImplicitConversionExists instead of StandardConversionExists
21455         since we also need to check for user-defined implicit conversions.
21456         Fixes #34165.  Added test-173.cs.
21457
21458 2002-11-16  Martin Baulig  <martin@ximian.com>
21459
21460         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21461         with the `true' and `false' literals.  Fixes #33151.
21462
21463 2002-11-16  Martin Baulig  <martin@ximian.com>
21464
21465         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21466         October 22nd; don't do the cs1540 check for static members.
21467
21468         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21469         now using our own filter here and doing the cs1540 check again.
21470
21471 2002-11-16  Martin Baulig  <martin@ximian.com>
21472
21473         * support.cs (InternalParameters): Don't crash if we don't have
21474         any fixed parameters.  Fixes #33532.
21475
21476 2002-11-16  Martin Baulig  <martin@ximian.com>
21477
21478         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21479         when looking up static methods to make this work on Windows.
21480         Fixes #33773.
21481
21482 2002-11-16  Martin Baulig  <martin@ximian.com>
21483
21484         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21485         a setter rather than using PropertyInfo.CanWrite.
21486
21487 2002-11-15  Nick Drochak  <ndrochak@gol.com>
21488
21489         * class.cs: Allow acces to block member by subclasses. Fixes build
21490         breaker.
21491
21492 2002-11-14  Martin Baulig  <martin@ximian.com>
21493
21494         * class.cs (Constructor.Emit): Added the extern/block check.
21495         Fixes bug #33678.
21496
21497 2002-11-14  Martin Baulig  <martin@ximian.com>
21498
21499         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21500         iteration while looking for indexers, this is needed because the
21501         indexer may have a different name in our base classes.  Fixed the
21502         error reporting (no indexers at all, not get accessor, no
21503         overloaded match).  Fixes bug #33089.
21504         (IndexerAccess.DoResolveLValue): Likewise.
21505
21506 2002-11-14  Martin Baulig  <martin@ximian.com>
21507
21508         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21509         indexers.  Fixes the first part of bug #33089.
21510         (MethodSignature.InheritableMemberSignatureCompare): Added support
21511         for properties.
21512
21513 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21514
21515         * attribute.cs (Attribute.Resolve): Catch the
21516         NullReferenceException and report it since it isn't supposed to
21517         happen. 
21518
21519 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21520
21521         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21522         LogicalOr and LogicalAnd that can benefit from recursively
21523         handling EmitBranchable.  The code now should be nice for Paolo.
21524
21525 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21526
21527         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21528         the Type lookups, as we perform quite a number of lookups on
21529         non-Types.  This can be removed once we can deterministically tell
21530         whether we have a type or a namespace in advance.
21531
21532         But this might require special hacks from our corlib.
21533
21534         * TODO: updated.
21535
21536         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21537         and double which avoids a conversion from an integer to a double.
21538
21539         * expression.cs: tiny optimization, avoid calling IsConstant,
21540         because it effectively performs the lookup twice.
21541
21542 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21543
21544         But a bogus return here to keep the semantics of the old code
21545         until the Mono runtime is fixed.
21546
21547         * pending.cs (GetMissingInterfaces): New method used to remove all
21548         the interfaces that are already implemented by our parent
21549         classes from the list of pending methods. 
21550
21551         * interface.cs: Add checks for calls after ResolveTypeExpr.
21552
21553 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21554
21555         * class.cs (Class.Emit): Report warning 67: event not used if the
21556         warning level is beyond 3.
21557
21558         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21559         being a NullLiteral.
21560
21561         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21562         specifiers. 
21563
21564         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21565         path that might fail if a type can not be resolved.
21566
21567         * expression.cs (Binary.Emit): Emit unsigned versions of the
21568         operators. 
21569
21570         * driver.cs: use error 5.
21571
21572 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21573
21574         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21575
21576 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21577
21578         * cs-parser.jay (switch_section): A beautiful patch from Martin
21579         Baulig that fixed 33094.
21580
21581 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21582
21583         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21584         Check whether the base is abstract and report an error if so.
21585
21586         * expression.cs (IndexerAccess.DoResolveLValue,
21587         IndexerAccess.DoResolve): ditto. 
21588
21589         (Invocation.DoResolve): ditto.
21590
21591         (Invocation.FullMethodDesc): Improve the report string.
21592
21593         * statement.cs (Block): Eliminate IsVariableDefined as it is
21594         basically just a wrapper for GetVariableInfo.
21595
21596         * ecore.cs (SimpleName): Use new 
21597
21598         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21599         type, as we return the actual parameter ref/unref state on a
21600         different call.
21601
21602 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * support.cs: Return proper flags REF/OUT fixing the previous
21605         commit.  
21606
21607         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21608         not used to mean `ref' but `ref or out' in ParameterReference
21609
21610         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21611         full type signature instead of calling TypeManger.CSharpName
21612         ourselves. 
21613
21614         * support.cs (InternalParameters.ParameterDesc): Do not compare
21615         directly to the modflags, because REF/OUT will actually be bitsets
21616         if set. 
21617
21618         * delegate.cs (VerifyMethod): Check also the modifiers.
21619
21620         * cs-tokenizer.cs: Fix bug where floating point values with an
21621         exponent where a sign was missing was ignored.
21622
21623         * driver.cs: Allow multiple assemblies to be specified in a single
21624         /r: argument
21625
21626 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21627
21628         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21629         because identifiers after a parenthesis would end up in this kind
21630         of production, and we needed to desamiguate it for having casts
21631         like:
21632
21633                 (UserDefinedType *) xxx
21634
21635 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21636
21637         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21638         we should set on the Bindingflags.NonPublic, but not turn on
21639         private_ok.  private_ok controls whether a Private member is
21640         returned (this is chekced on the filter routine), while the
21641         BindingFlags.NonPublic just controls whether private/protected
21642         will be allowed.   This fixes the problem part of the problem of
21643         private properties being allowed to be used in derived classes.
21644
21645         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21646         so we can call the children DoResolveLValue method (this will
21647         properly signal errors on lvalue assignments to base properties)
21648
21649         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21650         getter are null, and we have a property info, we know that this
21651         happened because the lookup failed, so we report an error 122 for
21652         protection level violation.
21653
21654         We also silently return if setter and getter are null in the
21655         resolve functions, this condition only happens if we have flagged
21656         the error before.  This is the other half of the problem. 
21657
21658         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21659         not have accessibility information, that is why we were returning
21660         true in the filter function in typemanager.cs.
21661
21662         To properly report 122 (property is inaccessible because of its
21663         protection level) correctly, we report this error in ResolveAccess
21664         by failing if both the setter and the getter are lacking (ie, the
21665         lookup failed). 
21666
21667         DoResolve and DoLResolve have been modified to check for both
21668         setter/getter being null and returning silently, the reason being
21669         that I did not want to put the knowledge about this error in upper
21670         layers, like:
21671
21672         int old = Report.Errors;
21673         x = new PropertyExpr (...);
21674         if (old != Report.Errors)
21675                 return null;
21676         else
21677                 return x;
21678
21679         So the property expr is returned, but it is invalid, so the error
21680         will be flagged during the resolve process. 
21681
21682         * class.cs: Remove InheritablePropertySignatureCompare from the
21683         class, as we no longer depend on the property signature to compute
21684         whether it is possible to implement a method or not.
21685
21686         The reason is that calling PropertyInfo.GetGetMethod will return
21687         null (in .NET, in Mono it works, and we should change this), in
21688         cases where the Get Method does not exist in that particular
21689         class.
21690
21691         So this code:
21692
21693         class X { public virtual int A { get { return 1; } } }
21694         class Y : X { }
21695         class Z : Y { public override int A { get { return 2; } } }
21696
21697         Would fail in Z because the parent (Y) would not have the property
21698         defined.  So we avoid this completely now (because the alternative
21699         fix was ugly and slow), and we now depend exclusively on the
21700         method names.
21701
21702         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21703         reference method, instead of using the property.
21704
21705         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21706         routines are gone now.
21707
21708         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21709         names, they were incorrectly named.
21710
21711         * cs-tokenizer.cs: Return are more gentle token on failure. 
21712
21713         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21714         had an out-of-sync index variable, which caused it to remove from
21715         the list of pending methods the wrong method sometimes.
21716
21717 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21718
21719         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21720         CanWrite, because those refer to this particular instance of the
21721         property, and do not take into account the fact that we can
21722         override single members of a property.
21723
21724         Constructor requires an EmitContext.  The resolution process does
21725         not happen here, but we need to compute the accessors before,
21726         because the resolution does not always happen for properties.
21727
21728         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21729         subclass, before we did not update this flag, but we did update
21730         bindingflags. 
21731
21732         (GetAccessors): Drop this routine, as it did not work in the
21733         presence of partially overwritten set/get methods. 
21734
21735         Notice that this broke the cs1540 detection, but that will require
21736         more thinking. 
21737
21738 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21739
21740         * class.cs:
21741         * codegen.cs:
21742         * driver.cs: issue a warning instead of an error if we don't support
21743         debugging for the platform. Also ignore a couple of errors that may
21744         arise when trying to write the symbols. Undo my previous patch.
21745
21746 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21747
21748         * driver.cs: ignore /debug switch except for Unix platforms.
21749
21750 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21751
21752         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21753
21754 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21755
21756         * driver.cs: Do not make mcs-debug conditional, so we do not break
21757         builds that use it.
21758
21759         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21760         review this patch.  But basically after all the children variables
21761         have been merged, the value of "Breaks" was not being set to
21762         new_breaks for Switch blocks.  I think that it should be set after
21763         it has executed.  Currently I set this to the value of new_breaks,
21764         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21765         conservative, but I do not understand this code very well.
21766
21767         I did not break anything in the build, so that is good ;-)
21768
21769         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21770
21771 2002-10-20  Mark Crichton  <crichton@gimp.org>
21772
21773         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21774
21775 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21776
21777         * cfold.cs: Fixed compile blocker.
21778
21779 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21780
21781         * driver.cs: I was chekcing the key, not the file.
21782
21783 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21784
21785         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21786         message that we were generating - we just need to silently return
21787         a null.
21788
21789 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21790
21791         * class.cs (Event.Define): Change my previous commit, as this
21792         breaks the debugger.  This is a temporary hack, as it seems like
21793         the compiler is generating events incorrectly to begin with.
21794
21795         * expression.cs (Binary.ResolveOperator): Added support for 
21796         "U operator - (E x, E y)"
21797
21798         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21799         y)".
21800
21801         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21802         init-only variables, but this path did not take into account that
21803         there might be also instance readonly variables.  Correct this
21804         problem. 
21805
21806         This fixes bug 32253
21807
21808         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21809         delegates as well.
21810
21811         * driver.cs: Change the extension for modules to `netmodule'
21812
21813         * cs-parser.jay: Improved slightly the location tracking for
21814         the debugger symbols.
21815
21816         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21817         modifiers that were specified instead of the hardcoded value
21818         (FamAndAssem).  This was basically ignoring the static modifier,
21819         and others.  Fixes 32429.
21820
21821         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21822         fixed a bug in the process (32476)
21823
21824         * expression.cs (ArrayAccess.EmitAssign): Patch from
21825         hwang_rob@yahoo.ca that fixes bug 31834.3
21826
21827 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21828
21829         * driver.cs: Make the module extension .netmodule.
21830
21831 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * driver.cs: Report an error if the resource file is not found
21834         instead of crashing.
21835
21836         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21837         false, like Emit does.
21838
21839 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21840
21841         * typemanager.cs: Remove unused private member.  Also reported mcs
21842         bug to report this as a warning like csc.
21843
21844 2002-10-15  Martin Baulig  <martin@gnome.org>
21845
21846         * statement.cs (Statement.Emit): Made this a virtual method; emits
21847         the line number info and calls DoEmit().
21848         (Statement.DoEmit): New protected abstract method, formerly knows
21849         as Statement.Emit().
21850
21851         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21852
21853 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21854
21855         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21856         have fixed a remaining problem: not every AddXXXX was adding a
21857         fully qualified name.  
21858
21859         Now everyone registers a fully qualified name in the DeclSpace as
21860         being defined instead of the partial name.  
21861
21862         Downsides: we are slower than we need to be due to the excess
21863         copies and the names being registered this way.  
21864
21865         The reason for this is that we currently depend (on the corlib
21866         bootstrap for instance) that types are fully qualified, because
21867         we dump all the types in the namespace, and we should really have
21868         types inserted into the proper namespace, so we can only store the
21869         basenames in the defined_names array.
21870
21871 2002-10-10  Martin Baulig  <martin@gnome.org>
21872
21873         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21874         from bug #31834, see the bug report for a testcase which is
21875         miscompiled.
21876
21877 2002-10-10  Martin Baulig  <martin@gnome.org>
21878
21879         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21880         flow analysis code for this.
21881
21882         * statement.cs (Do, While, For): Tell the flow analysis code about
21883         infinite loops.
21884         (FlowBranching.UsageVector): Added support for infinite loops.
21885         (Block.Resolve): Moved the dead code elimination here and use flow
21886         analysis to do it.
21887
21888 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21889
21890         * class.cs (Field.Define): Catch cycles on struct type
21891         definitions. 
21892
21893         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21894         fields if the fields are static.  We only need to check instance
21895         fields. 
21896
21897         * expression.cs (As.DoResolve): Test for reference type.
21898
21899         * statement.cs (Using.ResolveExpression): Use
21900         ConvertImplicitRequired, not ConvertImplicit which reports an
21901         error on failture
21902         (Using.ResolveLocalVariableDecls): ditto.
21903
21904         * expression.cs (Binary.ResolveOperator): Report errors in a few
21905         places where we had to.
21906
21907         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21908
21909 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
21910
21911         * expression.cs: Use StoreFromPtr instead of extracting the type
21912         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
21913
21914         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21915         an enumeration value to a System.Enum, but System.Enum is not a
21916         value type, but an class type, so we need to box.
21917
21918         (Expression.ConvertExplicit): One codepath could return
21919         errors but not flag them.  Fix this.  Fixes #31853
21920
21921         * parameter.cs (Resolve): Do not allow void as a parameter type.
21922
21923 2002-10-06  Martin Baulig  <martin@gnome.org>
21924
21925         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21926         if it's a class type and not a struct.  Fixes #31815.
21927
21928 2002-10-06  Martin Baulig  <martin@gnome.org>
21929
21930         * statement.cs: Reworked the flow analysis code a bit to make it
21931         usable for dead code elimination.
21932
21933 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21934
21935         * cs-parser.jay: allow empty source files. Fixes bug #31781.
21936
21937 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21938
21939         * expression.cs (ComposedCast.DoResolveType): A quick workaround
21940         to fix the test 165, will investigate deeper.
21941
21942 2002-10-04  Martin Baulig  <martin@gnome.org>
21943
21944         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21945         finally blocks actually work.
21946         (Try.Resolve): We don't need to create a sibling for `finally' if
21947         there is no finally block.
21948
21949 2002-10-04  Martin Baulig  <martin@gnome.org>
21950
21951         * class.cs (Constructor.Define): The default accessibility for a
21952         non-default constructor is private, not public.
21953
21954 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21955
21956         * class.cs (Constructor): Make AllowedModifiers public, add
21957         EXTERN.
21958
21959         * cs-parser.jay: Perform the modifiers test here, as the
21960         constructor for the Constructor class usually receives a zero
21961         because of the way we create it (first we create, later we
21962         customize, and we were never checking the modifiers).
21963
21964         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21965         is a version of LookupTypeReflection that includes the type-name
21966         cache.  This can be used as a fast path for functions that know
21967         the fully qualified name and are only calling into *.GetType() to
21968         obtain a composed type.
21969
21970         This is also used by TypeManager.LookupType during its type
21971         composition.
21972
21973         (LookupType): We now also track the real type name, as sometimes
21974         we can get a quey for the real type name from things like
21975         ComposedCast.  This fixes bug 31422.
21976
21977         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21978         complete type fullname, it does not have to go through the type
21979         resolution system to obtain the composed version of the type (for
21980         obtaining arrays or pointers).
21981
21982         (Conditional.Emit): Use the EmitBoolExpression to
21983         generate nicer code, as requested by Paolo.
21984
21985         (ArrayCreation.CheckIndices): Use the patch from
21986         hwang_rob@yahoo.ca to validate the array initializers. 
21987
21988 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
21989
21990         * class.cs (ConstructorInitializer.Emit): simplify code by using
21991         Invocation.EmitCall, and at the same time, fix the bugs in calling
21992         parent constructors that took variable arguments. 
21993
21994         * ecore.cs (Expression.ConvertNumericExplicit,
21995         Expression.ImplicitNumericConversion): Remove the code that
21996         manually wrapped decimal (InternalTypeConstructor call is now gone
21997         as well).
21998
21999         * expression.cs (Cast.TryReduce): Also handle decimal types when
22000         trying to perform a constant fold on the type.
22001
22002         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22003
22004         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22005         that only turned off an error report, and did nothing else. 
22006
22007 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22008
22009         * driver.cs: Handle and ignore /fullpaths
22010
22011 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22012
22013         * expression.cs (Binary.ResolveOperator): Catch the case where
22014         DoNumericPromotions returns true, 
22015
22016         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22017
22018 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22021         report error 70.
22022
22023 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22024
22025         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22026         conversion exists, but it is also required that the conversion be
22027         performed.  This manifested in "(Type64Enum) 2".  
22028
22029         * class.cs (TypeManager.AddMethod): The fix is not to change
22030         AddEnum, because that one was using a fully qualified name (every
22031         DeclSpace derivative does), but to change the AddMethod routine
22032         that was using an un-namespaced name.  This now correctly reports
22033         the duplicated name.
22034
22035         Revert patch until I can properly fix it.  The issue
22036         is that we have a shared Type space across all namespaces
22037         currently, which is wrong.
22038
22039         Options include making the Namespace a DeclSpace, and merge
22040         current_namespace/current_container in the parser.
22041
22042 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22043
22044         * cs-parser.jay: Improve error reporting when we get a different
22045         kind of expression in local_variable_type and
22046         local_variable_pointer_type. 
22047
22048         Propagate this to avoid missleading errors being reported.
22049
22050         * ecore.cs (ImplicitReferenceConversion): treat
22051         TypeManager.value_type as a target just like object_type.   As
22052         code like this:
22053
22054         ValueType v = 1;
22055
22056         Is valid, and needs to result in the int 1 being boxed before it
22057         is assigned to the value type v.
22058
22059         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22060         to validate the enumeration name.
22061
22062         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22063         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22064         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22065
22066         * ecore.cs (TryImplicitIntConversion): When doing an
22067         implicit-enumeration-conversion, check if the type is 64-bits and
22068         perform a conversion before passing to EnumConstant.
22069
22070 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22071
22072         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22073         report ambiguous type references.  Unlike the MS version, we
22074         report what the ambiguity is.   Innovation at work ;-)
22075
22076         (DeclSpace.FindType): Require a location argument to
22077         display when we display an ambiguous error.
22078
22079         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22080
22081         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22082
22083         * expression.cs (EmitDynamicInitializers): Apply patch from
22084         hwang_rob@yahoo.ca that fixes the order in which we emit our
22085         initializers. 
22086
22087 2002-09-21  Martin Baulig  <martin@gnome.org>
22088
22089         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22090         delegate takes no arguments.
22091
22092 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22093
22094         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22095         from integers.
22096
22097         * expression.cs: Extract the underlying type.
22098
22099         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22100
22101         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22102
22103 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22104
22105         * class.cs (TypeContainer.DefineType): We can not use the nice
22106         PackingSize with the size set to 1 DefineType method, because it
22107         will not allow us to define the interfaces that the struct
22108         implements.
22109
22110         This completes the fixing of bug 27287
22111
22112         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22113         means also structs.  This fixes part of the problem. 
22114         (Expresion.ImplicitReferenceConversionExists): ditto.
22115
22116         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22117         error if there were no errors reported during the type lookup
22118         process, to avoid duplicates or redundant errors.  Without this
22119         you would get an ambiguous errors plus a type not found.  We have
22120         beaten the user enough with the first error.  
22121
22122         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22123         reference. 
22124
22125         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22126         during the resolution process, stop the lookup, this avoids
22127         repeated error reports (same error twice).
22128
22129         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22130
22131         * typemanager.cs (LookupType): Redo the type lookup code to match
22132         the needs of System.Reflection.  
22133
22134         The issue is that System.Reflection requires references to nested
22135         types to begin with a "+" sign instead of a dot.  So toplevel
22136         types look like: "NameSpace.TopLevelClass", and nested ones look
22137         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22138         levels. 
22139
22140 2002-09-19  Martin Baulig  <martin@gnome.org>
22141
22142         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22143         says that a method always returns or always throws an exception,
22144         don't report the CS0161.
22145
22146         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22147         set `Returns = new_returns'.
22148
22149 2002-09-19  Martin Baulig  <martin@gnome.org>
22150
22151         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22152         to an enum constant, check for a CS0176.
22153
22154 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22155
22156         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22157         for operators that must be in pairs and report errors.
22158
22159         * ecore.cs (SimpleName.DoResolveType): During the initial type
22160         resolution process, when we define types recursively, we must
22161         check first for types in our current scope before we perform
22162         lookups in the enclosing scopes.
22163
22164         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22165
22166         (Invocation.VerifyArgumentsCompat): Call
22167         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22168         I thought we were supposed to always call this, but there are a
22169         few places in the code where we dont do it.
22170
22171 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22172
22173         * driver.cs: Add support in -linkres and -resource to specify the
22174         name of the identifier.
22175
22176 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22177
22178         * ecore.cs (StandardConversionExists): Sync with the conversion
22179         code: allow anything-* to void* conversions.
22180
22181         (FindMostSpecificSource): Use an Expression argument
22182         instead of a Type, because we might be handed over a Literal which
22183         gets a few more implicit conversions that plain types do not.  So
22184         this information was being lost.
22185
22186         Also, we drop the temporary type-holder expression when not
22187         required.
22188
22189 2002-09-17  Martin Baulig  <martin@gnome.org>
22190
22191         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22192         this is an explicit interface implementation.
22193
22194 2002-09-17  Martin Baulig  <martin@gnome.org>
22195
22196         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22197         different `IndexerName' attributes.
22198
22199         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22200         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22201         virtual CommonResolve().
22202
22203 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22204
22205         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22206         and convert that to the UnderlyingType.
22207
22208         * statement.cs (Foreach.Resolve): Indexers are just like variables
22209         or PropertyAccesses.
22210
22211         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22212         inside quoted strings, we were not doing this before.
22213
22214 2002-09-16  Martin Baulig  <martin@gnome.org>
22215
22216         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22217         resolve it.  This is needed for the definite assignment check of the
22218         instance expression, fixes bug #29846.
22219         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22220
22221 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22222
22223         * parameter.cs: Fix compile error.  Cannot reference static member
22224         from an instance object.  Is this an mcs bug?
22225
22226 2002-09-14  Martin Baulig  <martin@gnome.org>
22227
22228         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22229         multiple times.  Fixes bug #30295, added test-166.cs.
22230
22231 2002-09-14  Martin Baulig  <martin@gnome.org>
22232
22233         * statement.cs (Block.Emit): Don't emit unreachable code.
22234         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22235         `break' statements.
22236         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22237
22238 2002-09-14  Martin Baulig  <martin@gnome.org>
22239
22240         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22241         is set.
22242
22243 2002-09-14  Martin Baulig  <martin@gnome.org>
22244
22245         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22246         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22247         be false on the ms runtime.
22248
22249 2002-09-13  Martin Baulig  <martin@gnome.org>
22250
22251         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22252         the CS0038 error message.
22253
22254 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
22255
22256         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22257         constant inside, return it.
22258
22259 2002-09-12  Martin Baulig  <martin@gnome.org>
22260
22261         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22262         implicit conversion can be done between enum types.
22263
22264         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22265         check whether an implicit conversion to the current enum's UnderlyingType
22266         exists and report an error if not.
22267
22268         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22269         without debugging support.
22270
22271         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22272         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22273
22274 2002-09-12  Martin Baulig  <martin@gnome.org>
22275
22276         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22277
22278         * ecore.cs (IMemberExpr.DeclaringType): New property.
22279         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22280         nonstatic member of an outer type (CS0038).
22281
22282 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22283
22284         * driver.cs: Activate the using-error detector at warning level
22285         4 (at least for MS-compatible APIs).
22286
22287         * namespace.cs (VerifyUsing): Small buglett fix.
22288
22289         * pending.cs (PendingImplementation): pass the container pointer. 
22290
22291         * interface.cs (GetMethods): Allow for recursive definition.  Long
22292         term, I would like to move every type to support recursive
22293         definitions, not the current ordering mechanism that we have right
22294         now.
22295
22296         The situation is this: Attributes are handled before interfaces,
22297         so we can apply attributes to interfaces.  But some attributes
22298         implement interfaces, we will now handle the simple cases
22299         (recursive definitions will just get an error).  
22300
22301         * parameter.cs: Only invalidate types at the end if we fail to
22302         lookup all types.  
22303
22304 2002-09-09  Martin Baulig  <martin@gnome.org>
22305
22306         * ecore.cs (PropertyExpr.Emit): Also check for
22307         TypeManager.system_int_array_get_length so this'll also work when
22308         compiling corlib.  Fixes #30003.
22309
22310 2002-09-09  Martin Baulig  <martin@gnome.org>
22311
22312         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22313         and throw an exception if we can't get the type's size.  Fixed #30040,
22314         added test-165.cs.
22315
22316 2002-09-09  Martin Baulig  <martin@gnome.org>
22317
22318         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22319
22320         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22321         context.  Fixes bug #30027.
22322
22323         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22324         virtual functions.  Fixes bug #30043, added test-164.cs.
22325
22326 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22327
22328         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22329
22330 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22331
22332         * driver.cs: Use an object to get the windows codepage since it's not a
22333         static property.
22334
22335 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22336
22337         * statement.cs (For.Emit): for infinite loops (test == null)
22338         return whether there is a break inside, not always "true".
22339
22340         * namespace.cs (UsingEntry): New struct to hold the name of the
22341         using definition, the location where it is defined, and whether it
22342         has been used in a successful type lookup.
22343
22344         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22345         strings.
22346
22347         * decl.cs: ditto.
22348
22349 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22350
22351         * attribute.cs : Fix incorrect code which relied on catching
22352         a NullReferenceException to detect a null being passed in
22353         where an object was expected.
22354
22355 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22356
22357         * statement.cs (Try): flag the catch variable as assigned
22358
22359         * expression.cs (Cast): Simplified by using ResolveType instead of
22360         manually resolving.
22361
22362         * statement.cs (Catch): Fix bug by using ResolveType.
22363
22364 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22365
22366         * expression.cs (BetterConversion): Special case for when we have
22367         a NullLiteral as the argument and we have to choose between string
22368         and object types - we choose string the way csc does.
22369
22370         * attribute.cs (Attribute.Resolve): Catch the
22371         NullReferenceException and report error #182 since the Mono
22372         runtime no more has the bug and having this exception raised means
22373         we tried to select a constructor which takes an object and is
22374         passed a null.
22375
22376 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22377
22378         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22379         message (1502, 1503) when we can't locate a method after overload
22380         resolution. This is much more informative and closes the bug
22381         Miguel reported.
22382
22383         * interface.cs (PopulateMethod): Return if there are no argument
22384         types. Fixes a NullReferenceException bug.
22385
22386         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22387         expressions too. Previously we were checking only in one place for
22388         positional arguments leaving out named arguments.
22389
22390         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22391         type to the enum type is not allowed. Remove code corresponding to
22392         that.
22393
22394         (ConvertNumericExplicit): Allow explicit conversions from
22395         the underlying type to enum type. This precisely follows the spec
22396         and closes a bug filed by Gonzalo.
22397
22398 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22399
22400         * compiler.csproj:
22401         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22402
22403 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
22404
22405         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22406         it was important that we stored the right value after the
22407         reduction in `converted'.
22408
22409 2002-09-04  Martin Baulig  <martin@gnome.org>
22410
22411         * location.cs (Location.SymbolDocument): Use full pathnames for the
22412         source files.
22413
22414 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
22415
22416         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22417         of the expression resolve mechanism, because that will catch the
22418         SimpleName error failures.
22419
22420         (Conditional): If we can not resolve the
22421         expression, return, do not crash.
22422
22423 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22424
22425         * cs-tokenizer.cs:
22426         (location): display token name instead of its number.
22427
22428 2002-08-28  Martin Baulig  <martin@gnome.org>
22429
22430         * expression.cs (Binary.ResolveOperator): Don't silently return
22431         but return an error if an operator cannot be applied between two
22432         enum types.
22433
22434 2002-08-28  Martin Baulig  <martin@gnome.org>
22435
22436         * class.cs (Constructor.Define): Set the permission attributes
22437         correctly instead of making all constructors public.
22438
22439 2002-08-28  Martin Baulig  <martin@gnome.org>
22440
22441         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22442         for private members before reporting a CS0103; if we find anything,
22443         it's a CS0122.
22444
22445 2002-08-28  Martin Baulig  <martin@gnome.org>
22446
22447         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22448         to check whether `closure_start_type == closure_invocation_type',
22449         we also need to check whether `m.DeclaringType == closure_invocation_type'
22450         before bypassing the permission checks.  We might be accessing
22451         protected/private members from the base class.
22452         (TypeManager.RealMemberLookup): Only set private_ok if private
22453         members were requested via BindingFlags.NonPublic.
22454
22455         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22456
22457         * expression.cs (MemberAccess.ResolveMemberAccess): Set
22458         MethodGroupExpr.IsExplicitImpl if appropriate.
22459         (Invocation.DoResolve): Don't report the CS0120 for explicit
22460         interface implementations.
22461
22462 2002-08-27  Martin Baulig  <martin@gnome.org>
22463
22464         * expression.cs (Invocation.DoResolve): If this is a static
22465         method and we don't have an InstanceExpression, we must report
22466         a CS0120.
22467
22468 2002-08-25  Martin Baulig  <martin@gnome.org>
22469
22470         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22471         `==' between a valuetype and an object.
22472
22473 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
22474
22475         * ecore.cs (TypeExpr): Provide a ToString method.
22476
22477 2002-08-24  Martin Baulig  <martin@gnome.org>
22478
22479         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22480         now called proggie.dbg and it's a binary file.
22481
22482 2002-08-23  Martin Baulig  <martin@gnome.org>
22483
22484         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22485
22486 2002-08-23  Martin Baulig  <martin@gnome.org>
22487
22488         * struct.cs (MyStructInfo.ctor): Make this work with empty
22489         structs; it's not allowed to use foreach() on null.
22490
22491 2002-08-23  Martin Baulig  <martin@gnome.org>
22492
22493         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22494         writer the full pathname of the generated assembly.
22495
22496 2002-08-23  Martin Baulig  <martin@gnome.org>
22497
22498         * statements.cs (FlowBranching.UsageVector.MergeChildren):
22499         A `finally' block never returns or breaks; improved handling of
22500         unreachable code.
22501
22502 2002-08-23  Martin Baulig  <martin@gnome.org>
22503
22504         * statement.cs (Throw.Resolve): Allow `throw null'.
22505
22506 2002-08-23  Martin Baulig  <martin@gnome.org>
22507
22508         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22509         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22510         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22511         MemberLookup would return a wrong event if this is an explicit
22512         interface implementation and the class has an event with the same
22513         name.
22514
22515 2002-08-23  Martin Baulig  <martin@gnome.org>
22516
22517         * statement.cs (Block.AddChildVariableNames): New public method.
22518         (Block.AddChildVariableName): Likewise.
22519         (Block.IsVariableNameUsedInChildBlock): Likewise.
22520         (Block.AddVariable): Check whether a variable name has already
22521         been used in a child block.
22522
22523         * cs-parser.jay (declare_local_variables): Mark all variable names
22524         from the current block as being used in a child block in the
22525         implicit block.
22526
22527 2002-08-23  Martin Baulig  <martin@gnome.org>
22528
22529         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22530         find the symbol writer.
22531
22532         * driver.cs: csc also allows the arguments to /define being
22533         separated by commas, not only by semicolons.
22534
22535 2002-08-23  Martin Baulig  <martin@gnome.org>
22536
22537         * interface.cs (Interface.GetMembers): Added static check for events.
22538
22539 2002-08-15  Martin Baulig  <martin@gnome.org>
22540
22541         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22542         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22543
22544         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22545         why the MethodData.EmitDestructor() change was necessary.
22546
22547 2002-08-20  Martin Baulig  <martin@gnome.org>
22548
22549         * class.cs (TypeContainer.FindMembers): Added static check for events.
22550
22551         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22552
22553         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22554         use Type.GetEvents(), not Type.FindMembers().
22555
22556 2002-08-20  Martin Baulig  <martin@gnome.org>
22557
22558         * decl.cs (MemberCache): Added a special method cache which will
22559         be used for method-only searched.  This ensures that a method
22560         search will return a MethodInfo with the correct ReflectedType for
22561         inherited methods.      
22562
22563 2002-08-20  Martin Baulig  <martin@gnome.org>
22564
22565         * decl.cs (DeclSpace.FindMembers): Made this public.
22566
22567 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22568
22569         * delegate.cs: fixed build on windows.
22570         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22571
22572 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22573
22574         * ecore.cs (StandardConversionExists): Return a false
22575         if we are trying to convert the void type to anything else
22576         since that is not allowed.
22577
22578         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22579         we flag error 70 in the event an event is trying to be accessed
22580         directly from outside the declaring type.
22581
22582 2002-08-20  Martin Baulig  <martin@gnome.org>
22583
22584         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22585         MemberCache from typemanager.cs to decl.cs.
22586
22587 2002-08-19  Martin Baulig  <martin@gnome.org>
22588
22589         * class.cs (TypeContainer): Implement IMemberContainer.
22590         (TypeContainer.DefineMembers): Create the MemberCache.
22591         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22592         return public members if BindingFlags.Public was given, check
22593         whether members are static.
22594
22595 2002-08-16  Martin Baulig  <martin@gnome.org>
22596
22597         * decl.cs (DeclSpace.Define): Splitted this in Define and
22598         DefineMembers.  DefineMembers is called first and initializes the
22599         MemberCache.
22600
22601         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22602         DefineMembers() on all our DeclSpaces.
22603
22604         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22605         but call DefineMembers() on all nested interfaces.  We call their
22606         Define() in our new Define() function.
22607
22608         * interface.cs (Interface): Implement IMemberContainer.
22609         (Interface.Define): Moved all code except the attribute stuf to
22610         DefineMembers().
22611         (Interface.DefineMembers): Initialize the member cache.
22612
22613         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22614         need this anymore since we can use MemberCache.FindMembers directly.
22615
22616 2002-08-19  Martin Baulig  <martin@gnome.org>
22617
22618         * typemanager.cs (MemberCache): When creating the cache for an
22619         interface type, add all inherited members.
22620         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22621         to `out bool used_cache' and documented it.
22622         (TypeManager.MemberLookup): If we already used the cache in the first
22623         iteration, we don't need to do the interfaces check.
22624
22625 2002-08-19  Martin Baulig  <martin@gnome.org>
22626
22627         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22628         here from IMemberFinder and don't implement this interface anymore.
22629         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22630
22631         * typemanager.cs (IMemberFinder): This interface is now only used by
22632         classes which actually support the member cache.
22633         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22634         since we only put DeclSpaces into this Hashtable.
22635         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22636         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22637
22638 2002-08-16  Martin Baulig  <martin@gnome.org>
22639
22640         * typemanager.cs (ICachingMemberFinder): Removed.
22641         (IMemberFinder.MemberCache): New property.
22642         (TypeManager.FindMembers): Merged this with RealFindMembers().
22643         This function will never be called from TypeManager.MemberLookup()
22644         so we can't use the cache here, just the IMemberFinder.
22645         (TypeManager.MemberLookup_FindMembers): Check whether the
22646         IMemberFinder has a MemberCache and call the cache's FindMembers
22647         function.
22648         (MemberCache): Rewrote larger parts of this yet another time and
22649         cleaned it up a bit.
22650
22651 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22652
22653         * driver.cs (LoadArgs): Support quoting.
22654
22655         (Usage): Show the CSC-like command line arguments.
22656
22657         Improved a few error messages.
22658
22659 2002-08-15  Martin Baulig  <martin@gnome.org>
22660
22661         * typemanager.cs (IMemberContainer.Type): New property.
22662         (IMemberContainer.IsInterface): New property.
22663
22664         The following changes are conditional to BROKEN_RUNTIME, which is
22665         defined at the top of the file.
22666
22667         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22668         class'es members, but add all members from TypeHandle.ObjectType
22669         if we're an interface.
22670         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22671         is the current type.
22672         (MemberCache.CacheEntry.Container): Removed this field.
22673         (TypeHandle.GetMembers): Include inherited members.
22674
22675 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22676
22677         * typemanager.cs: fixed compilation and added a comment on a field that
22678         is never used.
22679
22680 2002-08-15  Martin Baulig  <martin@gnome.org>
22681
22682         * class.cs (ConstructorInitializer.Resolve): In the
22683         Expression.MemberLookup call, use the queried_type as
22684         invocation_type.
22685
22686         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22687         declared' attribute, it's always true.
22688         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22689         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22690         temporary wrapper for FindMembers which tells MemberLookup whether
22691         members from the base classes are included in the return value.
22692         This will go away soon.
22693         (TypeManager.MemberLookup): Use this temporary hack here; once the
22694         new MemberCache is completed, we don't need to do the DeclaredOnly
22695         looping here anymore since the MemberCache will take care of this.
22696         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22697         (MemberCache): When creating the MemberCache for a class, get
22698         members from the current class and all its base classes.
22699         (MemberCache.CacheEntry.Container): New field.  This is a
22700         temporary hack until the Mono runtime is fixed to distinguish
22701         between ReflectedType and DeclaringType.  It allows us to use MCS
22702         with both the MS runtime and the unfixed Mono runtime without
22703         problems and without accecting performance.
22704         (MemberCache.SearchMembers): The DeclaredOnly looping from
22705         TypeManager.MemberLookup is now done here.      
22706
22707 2002-08-14  Martin Baulig  <martin@gnome.org>
22708
22709         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22710         Type.GetFields on dynamic types but get the fields from the
22711         corresponding TypeContainer.
22712         (MyStructInfo.GetStructInfo): Added check for enum types.
22713
22714         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22715         (MemberList.SyncRoot): Implemented.
22716         (TypeManager.FilterWithClosure): No need to check permissions if
22717         closure_start_type == closure_invocation_type, don't crash if
22718         closure_invocation_type is null.
22719
22720 2002-08-13  Martin Baulig  <martin@gnome.org>
22721
22722         Rewrote TypeContainer.FindMembers to use a member cache.  This
22723         gives us a speed increase of about 35% for the self-hosting MCS
22724         build and of about 15-20% for the class libs (both on GNU/Linux).
22725
22726         * report.cs (Timer): New class to get enhanced profiling.  This
22727         whole class is "TIMER" conditional since it remarkably slows down
22728         compilation speed.
22729
22730         * class.cs (MemberList): New class.  This is an IList wrapper
22731         which we're now using instead of passing MemberInfo[]'s around to
22732         avoid copying this array unnecessarily.
22733         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22734         (ICachingMemberFinder, IMemberContainer): New interface.
22735         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22736         has already been checked, otherwise use it for the name comparision.
22737         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22738         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22739         if possible.  Returns a MemberList, not a MemberInfo [].
22740         (TypeHandle): New class, implements IMemberContainer.  We create
22741         one instance of this class per type, it contains a MemberCache
22742         which is used to do the member lookups.
22743         (MemberCache): New class.  Each instance of this class contains
22744         all members of a type and a name-based hash table.
22745         (MemberCache.FindMembers): This is our new member lookup
22746         function.  First, it looks up all members of the requested name in
22747         the hash table.  Then, it walks this list and sorts out all
22748         applicable members and returns them.
22749
22750 2002-08-13  Martin Baulig  <martin@gnome.org>
22751
22752         In addition to a nice code cleanup, this gives us a performance
22753         increase of about 1.4% on GNU/Linux - not much, but it's already
22754         half a second for the self-hosting MCS compilation.
22755
22756         * typemanager.cs (IMemberFinder): New interface.  It is used by
22757         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22758         Enum, Delegate or Interface.
22759         (TypeManager.finder_to_member_finder): New PtrHashtable.
22760         (TypeManager.finder_to_container): Removed.
22761         (TypeManager.finder_to_delegate): Removed.
22762         (TypeManager.finder_to_interface): Removed.
22763         (TypeManager.finder_to_enum): Removed.
22764
22765         * interface.cs (Interface): Implement IMemberFinder.
22766
22767         * delegate.cs (Delegate): Implement IMemberFinder.
22768
22769         * enum.cs (Enum): Implement IMemberFinder.
22770
22771         * class.cs (TypeContainer): Implement IMemberFinder.
22772
22773 2002-08-12  Martin Baulig  <martin@gnome.org>
22774
22775         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22776
22777 2002-08-12  Martin Baulig  <martin@gnome.org>
22778
22779         * ecore.cs (ITypeExpression): New interface for expressions which
22780         resolve to a type.
22781         (TypeExpression): Renamed to TypeLookupExpression.
22782         (Expression.DoResolve): If we're doing a types-only lookup, the
22783         expression must implement the ITypeExpression interface and we
22784         call DoResolveType() on it.
22785         (SimpleName): Implement the new ITypeExpression interface.
22786         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22787         hack, the situation that we're only looking up types can't happen
22788         anymore when this method is called.  Moved the type lookup code to
22789         DoResolveType() and call it.
22790         (SimpleName.DoResolveType): This ITypeExpression interface method
22791         is now doing the types-only lookup.
22792         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22793         (ResolveFlags): Added MaskExprClass.
22794
22795         * expression.cs (MemberAccess): Implement the ITypeExpression
22796         interface.
22797         (MemberAccess.DoResolve): Added support for a types-only lookup
22798         when we're called via ITypeExpression.DoResolveType().
22799         (ComposedCast): Implement the ITypeExpression interface.
22800
22801         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22802         Expression.Resolve() with ResolveFlags.Type instead.
22803
22804 2002-08-12  Martin Baulig  <martin@gnome.org>
22805
22806         * interface.cs (Interface.Define): Apply attributes.
22807
22808         * attribute.cs (Attribute.ApplyAttributes): Added support for
22809         interface attributes.
22810
22811 2002-08-11  Martin Baulig  <martin@gnome.org>
22812
22813         * statement.cs (Block.Emit): Only check the "this" variable if we
22814         do not always throw an exception.
22815
22816         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22817         whether the property has a set accessor.
22818
22819 2002-08-11  Martin Baulig  <martin@gnome.org>
22820
22821         Added control flow analysis support for structs.
22822
22823         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22824         with control flow analysis turned off.
22825         (IVariable): New interface.
22826         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22827         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22828         (FieldExpr.DoResolve): Resolve the instance expression with flow
22829         analysis turned off and do the definite assignment check after the
22830         resolving when we know what the expression will resolve to.
22831
22832         * expression.cs (LocalVariableReference, ParameterReference):
22833         Implement the new IVariable interface, only call the flow analysis
22834         code if ec.DoFlowAnalysis is true.
22835         (This): Added constructor which takes a Block argument.  Implement
22836         the new IVariable interface.
22837         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22838         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22839         This does the definite assignment checks for struct members.
22840
22841         * class.cs (Constructor.Emit): If this is a non-static `struct'
22842         constructor which doesn't have any initializer, call
22843         Block.AddThisVariable() to tell the flow analysis code that all
22844         struct elements must be initialized before control returns from
22845         the constructor.
22846
22847         * statement.cs (MyStructInfo): New public class.
22848         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22849         argument to this indexer.  If non-zero, check an individual struct
22850         member, not the whole struct.
22851         (FlowBranching.CheckOutParameters): Check struct members.
22852         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22853         overloaded versions of these methods which take an additional
22854         `int field_idx' argument to check struct members.
22855         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22856         overloaded versions of these methods which take an additional
22857         `string field_name' argument to check struct member.s
22858         (VariableInfo): Implement the IVariable interface.
22859         (VariableInfo.StructInfo): New public property.  Returns the
22860         MyStructInfo instance of the variable if it's a struct or null.
22861         (Block.AddThisVariable): New public method.  This is called from
22862         Constructor.Emit() for non-static `struct' constructor which do
22863         not have any initializer.  It creates a special variable for the
22864         "this" instance variable which will be checked by the flow
22865         analysis code to ensure that all of the struct's fields are
22866         initialized before control returns from the constructor.
22867         (UsageVector): Added support for struct members.  If a
22868         variable/parameter is a struct with N members, we reserve a slot
22869         in the usage vector for each member.  A struct is considered fully
22870         initialized if either the struct itself (slot 0) or all its
22871         members are initialized.
22872
22873 2002-08-08  Martin Baulig  <martin@gnome.org>
22874
22875         * driver.cs (Driver.MainDriver): Only report an error CS5001
22876         if there were no compilation errors.
22877
22878         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22879         `UnsafeContext' property to determine whether the parent is in
22880         unsafe context rather than checking the parent's ModFlags:
22881         classes nested in an unsafe class are unsafe as well.
22882
22883 2002-08-08  Martin Baulig  <martin@gnome.org>
22884
22885         * statement.cs (UsageVector.MergeChildren): Distinguish between
22886         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22887         we return.  Added test17() and test18() to test-154.cs.
22888
22889 2002-08-08  Martin Baulig  <martin@gnome.org>
22890
22891         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22892         Family access, make sure the invoking type isn't a subclass of the
22893         queried type (that'd be a CS1540).
22894
22895         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22896         this method which takes an additional `Type invocation_type'.
22897
22898         * expression.cs (BaseAccess.DoResolve): Use the base type as
22899         invocation and query type.
22900         (MemberAccess.DoResolve): If the lookup failed and we're about to
22901         report a CS0122, try a lookup with the ec.ContainerType - if this
22902         succeeds, we must report a CS1540.
22903
22904 2002-08-08  Martin Baulig  <martin@gnome.org>
22905
22906         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22907         (MethodGroupExpr): Implement the IMemberExpr interface.
22908
22909         * expression (MemberAccess.ResolveMemberAccess): No need to have
22910         any special code for MethodGroupExprs anymore, they're now
22911         IMemberExprs.   
22912
22913 2002-08-08  Martin Baulig  <martin@gnome.org>
22914
22915         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22916         Family, FamANDAssem and FamORAssem permissions.
22917         (TypeManager.IsSubclassOrNestedChildOf): New public method.
22918
22919 2002-08-08  Martin Baulig  <martin@gnome.org>
22920
22921         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22922         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22923         or loop block.
22924
22925 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22926
22927         * driver.cs: implemented /resource option to embed managed resources.
22928
22929 2002-08-07  Martin Baulig  <martin@gnome.org>
22930
22931         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22932         (FieldBase.HasFieldInitializer): New public property.
22933         (FieldBase.GetInitializerExpression): New public method.  Resolves and
22934         returns the field initializer and makes sure it is only resolved once.
22935         (TypeContainer.EmitFieldInitializers): Call
22936         FieldBase.GetInitializerExpression to get the initializer, this ensures
22937         that it isn't resolved multiple times.
22938
22939         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
22940         the resolving process (SimpleName/MemberLookup) that we're currently
22941         emitting a field initializer (which must not access any instance members,
22942         this is an error CS0236).
22943
22944         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22945         argument, if the `IsFieldInitializer' flag is set, we must report and
22946         error CS0236 and not an error CS0120.   
22947
22948 2002-08-07  Martin Baulig  <martin@gnome.org>
22949
22950         * ecore.cs (IMemberExpr): New public interface.
22951         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22952         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22953         if the expression is an IMemberExpr.
22954
22955         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22956         to be null, implicitly default to `this' if we're non-static in
22957         this case.  Simplified the code a lot by using the new IMemberExpr
22958         interface.  Also fixed bug #28176 here.
22959
22960 2002-08-06  Martin Baulig  <martin@gnome.org>
22961
22962         * cs-parser.jay (SimpleLookup): Removed.  We need to create
22963         ParameterReferences during semantic analysis so that we can do a
22964         type-only search when resolving Cast, TypeOf and SizeOf.
22965         (block): Pass the `current_local_parameters' to the Block's
22966         constructor.
22967
22968         * class.cs (ConstructorInitializer): Added `Parameters parameters'
22969         argument to the constructor.
22970         (ConstructorInitializer.Resolve): Create a temporary implicit
22971         block with the parameters.
22972
22973         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22974         references here if we aren't doing a type-only search.
22975
22976         * statement.cs (Block): Added constructor which takes a
22977         `Parameters parameters' argument.
22978         (Block.Parameters): New public property.
22979
22980         * support.cs (InternalParameters.Parameters): Renamed `parameters'
22981         to `Parameters' and made it public readonly.
22982
22983 2002-08-06  Martin Baulig  <martin@gnome.org>
22984
22985         * ecore.cs (Expression.Warning): Made this public as well.
22986
22987         * report.cs (Report.Debug): Print the contents of collections.
22988
22989 2002-08-06  Martin Baulig  <martin@gnome.org>
22990
22991         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
22992         used to tell Resolve() which kinds of expressions it may return.
22993         (Expression.Resolve): Added overloaded version of this method which
22994         takes a `ResolveFlags flags' argument.  This can be used to tell
22995         Resolve() which kinds of expressions it may return.  Reports a
22996         CS0118 on error.
22997         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22998         ResolveFlags.SimpleName.
22999         (Expression.Error118): Added overloaded version of this method which
23000         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23001         which kinds of expressions are allowed.
23002
23003         * expression.cs (Argument.ResolveMethodGroup): New public method.
23004         Resolves an argument, but allows a MethodGroup to be returned.
23005         This is used when invoking a delegate.
23006
23007         * TODO: Updated a bit.
23008
23009 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23010
23011         Fixed compilation with csc.
23012
23013         * ecore.cs: Expression.Error made public. Is this correct? Should
23014         Warning be made public too?
23015
23016         * expression.cs: use ea.Location instead of ea.loc.
23017         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23018
23019 2002-08-06  Martin Baulig  <martin@gnome.org>
23020
23021         * ecore.cs (Expression.loc): Moved the location here instead of
23022         duplicating it in all derived classes.
23023         (Expression.Location): New public property.
23024         (Expression.Error, Expression.Warning): Made them non-static and
23025         removed the location argument.
23026         (Expression.Warning): Added overloaded version which takes an
23027         `int level' argument.
23028         (Expression.Error118): Make this non-static and removed the
23029         expression and location arguments.
23030         (TypeExpr): Added location argument to the constructor.
23031
23032         * expression.cs (StaticCallExpr): Added location argument to
23033         the constructor.
23034         (Indirection, PointerArithmetic): Likewise.
23035         (CheckedExpr, UnCheckedExpr): Likewise.
23036         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23037         (StringPtr): Likewise.
23038
23039
23040 2002-08-05  Martin Baulig  <martin@gnome.org>
23041
23042         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23043
23044         * assign.cs (Assign.DoResolve): Check whether the source
23045         expression is a value or variable.
23046
23047         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23048         while resolving the corresponding blocks.
23049
23050         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23051         an error, don't silently return null.
23052
23053         * statement.cs (Block.AddVariable): Do the error reporting here
23054         and distinguish between CS0128 and CS0136.
23055         (Block.DoResolve): Report all unused labels (warning CS0164).
23056         (LabeledStatement): Pass the location to the constructor.
23057         (LabeledStatement.HasBeenReferenced): New property.
23058         (LabeledStatement.Resolve): Set it to true here.
23059
23060         * statement.cs (Return.Emit): Return success even after reporting
23061         a type mismatch error (CS0126 or CS0127), this is what csc does and
23062         it avoids confusing the users with any consecutive errors.
23063
23064 2002-08-05  Martin Baulig  <martin@gnome.org>
23065
23066         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23067
23068         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23069
23070         * expression.cs (MemberAccess.DoResolve): Silently return if an
23071         error has already been reported.
23072
23073         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23074         error has already been reported.
23075
23076 2002-08-05  Martin Baulig  <martin@gnome.org>
23077
23078         * statement.cs (UsageVector): Only initialize the `parameters'
23079         vector if we actually have any "out" parameters.
23080
23081 2002-08-05  Martin Baulig  <martin@gnome.org>
23082
23083         * expression.cs (Binary.ResolveOperator): When combining delegates,
23084         they must have the same type.
23085
23086 2002-08-05  Martin Baulig  <martin@gnome.org>
23087
23088         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23089         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23090         work with the ms runtime and we also don't need it: if we're a
23091         PropertyBuilder and not in the `indexer_arguments' hash, then we
23092         are a property and not an indexer.
23093
23094         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23095         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23096         since the latter one doesn't work with the ms runtime.
23097
23098 2002-08-03  Martin Baulig  <martin@gnome.org>
23099
23100         Fixed bugs #27998 and #22735.
23101
23102         * class.cs (Method.IsOperator): New public field.
23103         (Method.CheckBase): Report CS0111 if there's already a method
23104         with the same parameters in the current class.  Report CS0508 when
23105         attempting to change the return type of an inherited method.
23106         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23107         and it's not marked abstract or extern.
23108         (PropertyBase): New abstract base class for Property and Indexer.
23109         (PropertyBase.CheckBase): Moved here from Property and made it work
23110         for indexers.
23111         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23112         the same so we can reuse it there.
23113         (Property, Indexer): Derive from PropertyBase.
23114         (MethodSignature.inheritable_property_signature_filter): New delegate
23115         to find properties and indexers.
23116
23117         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23118         argument and improved error reporting.
23119
23120         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23121         EmptyReadOnlyParameters and made it a property.
23122
23123         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23124         version of this method which takes a `PropertyInfo indexer'.
23125         (TypeManager.RegisterIndexer): New method.
23126
23127         * class.cs: Added myself as author of this file :-)
23128
23129 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23130
23131         * class.cs: fixed compilation on windoze.
23132
23133 2002-08-03  Martin Baulig  <martin@gnome.org>
23134
23135         * interface.cs (Interface.GetInterfaceBases): Check whether all
23136         base interfaces are at least as accessible than the current one.
23137
23138         * class.cs (TypeContainer.GetClassBases): Check whether base types
23139         are at least as accessible than the current type.
23140         (TypeContainer.AsAccessible): Implemented and made non-static.
23141         (MemberBase.CheckParameters): Report errors if the accessibility
23142         checks fail.
23143
23144         * delegate.cs (Delegate.Delegate): The default visibility is
23145         internal for top-level types and private for nested types.
23146         (Delegate.Define): Report errors if the accessibility checks fail.
23147
23148         * enum.cs (Enum.Enum): The default visibility is internal for
23149         top-level types and private for nested types.
23150         (Enum.DefineType): Compute the correct visibility.
23151
23152         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23153         function which takes a `bool is_toplevel' instead of a TypeContainer.
23154
23155         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23156         builtin type.
23157
23158 2002-08-02  Martin Baulig  <martin@gnome.org>
23159
23160         * expression.cs (LocalVariableReferenc): Added constructor which
23161         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23162         (LocalVariableReference.IsReadOnly): New property.
23163         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23164         variable is readonly, use our own readonly flag to do this; you can
23165         use the new constructor to get a writable reference to a read-only
23166         variable.
23167
23168         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23169         reference to the local variable.
23170
23171 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23172
23173         * rootcontext.cs (ResolveCore): Also include System.Exception
23174
23175         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23176         we reach an EmptyStatement.
23177
23178         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23179         is also fine.
23180
23181         * expression.cs (Binary.ResolveOperator): Check error result in
23182         two places.
23183
23184         use brtrue/brfalse directly and avoid compares to null.
23185
23186 2002-08-02  Martin Baulig  <martin@gnome.org>
23187
23188         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23189         Fixes bug #28407, added test-155.cs.
23190
23191 2002-08-01  Martin Baulig  <martin@gnome.org>
23192
23193         * class.cs (Event.EmitDefaultMethod): Make this work with static
23194         events.  Fixes #28311, added verify-3.cs.
23195
23196 2002-08-01  Martin Baulig  <martin@gnome.org>
23197
23198         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23199         `is_disposable' fields.
23200         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23201         `hm.is_disposable' if we're using the collection pattern.
23202         (Foreach.EmitCollectionForeach): Use the correct type for the
23203         enumerator's local variable, only emit the try/finally block if
23204         necessary (fixes #27713).
23205
23206 2002-08-01  Martin Baulig  <martin@gnome.org>
23207
23208         * ecore.cs (Expression.report118): Renamed to Error118 and made
23209         it public static.
23210
23211         * statement.cs (Throw.Resolve): Check whether the expression is of
23212         the correct type (CS0118) and whether the type derives from
23213         System.Exception (CS0155).
23214         (Catch.Resolve): New method.  Do the type lookup here and check
23215         whether it derives from System.Exception (CS0155).
23216         (Catch.CatchType, Catch.IsGeneral): New public properties.
23217
23218         * typemanager.cs (TypeManager.exception_type): Added.
23219
23220 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23221
23222         * driver.cs: Updated About function.
23223
23224 2002-07-31  Martin Baulig  <martin@gnome.org>
23225
23226         Implemented Control Flow Analysis.
23227
23228         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23229         (EmitContext.CurrentBranching): Added.
23230         (EmitContext.StartFlowBranching): Added.
23231         (EmitContext.EndFlowBranching): Added.
23232         (EmitContext.KillFlowBranching): Added.
23233         (EmitContext.IsVariableAssigned): Added.
23234         (EmitContext.SetVariableAssigned): Added.
23235         (EmitContext.IsParameterAssigned): Added.
23236         (EmitContext.SetParameterAssigned): Added.
23237         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23238         Added control flow analysis stuff here.
23239
23240         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23241         resolve the expression as lvalue.
23242         (LocalVariableReference.DoResolve): Check whether the variable has
23243         already been assigned.
23244         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23245         the parameter as assigned here.
23246         (ParameterReference.DoResolve): Check whether the parameter has already
23247         been assigned.
23248         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23249         expression as lvalue.
23250
23251         * statement.cs (FlowBranching): New class for the flow analysis code.
23252         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23253         (LabeledStatement.IsDefined): New public property.
23254         (LabeledStatement.AddUsageVector): New public method to tell flow
23255         analyis that the label may be reached via a forward jump.
23256         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23257         flow analysis.
23258         (VariableInfo.Number): New public field.  This is used by flow analysis
23259         to number all locals of a block.
23260         (Block.CountVariables): New public property.  This is the number of
23261         local variables in this block (including the locals from all parent
23262         blocks).
23263         (Block.EmitMeta): Number all the variables.
23264
23265         * statement.cs: Added flow analysis support to all classes.
23266
23267 2002-07-31  Martin Baulig  <martin@gnome.org>
23268
23269         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23270         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23271         then use this argument.
23272
23273         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23274
23275         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23276         use this to specify /define options.
23277
23278 2002-07-29  Martin Baulig  <martin@gnome.org>
23279
23280         * statement.cs (Fixed): Moved all code that does variable lookups
23281         and resolvings from Emit to Resolve.
23282
23283         * statement.cs (For): Moved all code that does variable lookups
23284         and resolvings from Emit to Resolve.
23285
23286         * statement.cs (Using): Moved all code that does variable lookups
23287         and resolvings from Emit to Resolve.
23288
23289 2002-07-29  Martin Baulig  <martin@gnome.org>
23290
23291         * attribute.cs (Attribute.Resolve): Explicitly catch a
23292         System.NullReferenceException when creating the
23293         CustromAttributeBuilder and report a different warning message.
23294
23295 2002-07-29  Martin Baulig  <martin@gnome.org>
23296
23297         * support.cs (ParameterData.ParameterName): Added method to
23298         get the name of a parameter.
23299
23300         * typemanager.cs (TypeManager.IsValueType): New public method.
23301
23302 2002-07-29  Martin Baulig  <martin@gnome.org>
23303
23304         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23305         is a flag which specifies that it's either ref or out.
23306         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23307         the out parameter to `out Parameter.Modifier mod', also set the
23308         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23309
23310         * support.cs (InternalParameters.ParameterModifier): Distinguish
23311         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23312         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23313
23314         * expression.cs (Argument.GetParameterModifier): Distinguish
23315         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23316         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23317
23318 2002-07-29  Martin Baulig  <martin@gnome.org>
23319
23320         * expression.cs (ParameterReference.ParameterReference): Added
23321         `Location loc' argument to the constructor.
23322
23323         * cs-parser.jay: Pass location to ParameterReference.
23324
23325 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23326
23327         * statement.cs (Try): Initialize the location.
23328
23329         * cs-parser.jay: pass location to Try.
23330
23331         * expression.cs (Unary.Reduce): Change the prototype to return
23332         whether a constant fold could be performed or not.  The result is
23333         returned in an out parameters.  In the case of Indirection and
23334         AddressOf, we want to perform the full tests.
23335
23336 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23337
23338         * statement.cs (Statement.Emit): Flag dead code.
23339
23340 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23341
23342         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23343
23344 2002-07-27  Martin Baulig  <martin@gnome.org>
23345
23346         * class.cs (MethodData.Define): Put back call to
23347         TypeManager.AddMethod(), accidentally commented this out.
23348
23349         * report.cs (Debug): New public method to print debugging information,
23350         this is `[Conditional ("DEBUG")]'.
23351
23352 2002-07-26  Martin Baulig  <martin@gnome.org>
23353
23354         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23355         (switch_statement): Push the current_block to the switch_stack and
23356         pop it again when we're done with the switch.
23357         (switch_section): The new block is a child of the current_block.
23358         Fixes bug #24007, added test-152.cs.
23359
23360 2002-07-27  Martin Baulig  <martin@gnome.org>
23361
23362         * expression.cs (Invocation.EmitArguments): When calling a varargs
23363         function with only its fixed arguments, we need to pass an empty
23364         array.
23365
23366 2002-07-27  Martin Baulig  <martin@gnome.org>
23367
23368         Mono 0.13 has been released.
23369
23370 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23371
23372         * driver.cs: Rename --resource to --linkres, because that is what
23373         we do currently, we dont support --resource yet.
23374
23375         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23376
23377 2002-07-25  Martin Baulig  <martin@gnome.org>
23378
23379         * class.cs (MethodData): New public class.  This is a `method builder'
23380         class for a method or one accessor of a Property/Indexer/Event.
23381         (MethodData.GetMethodFlags): Moved here from MemberBase.
23382         (MethodData.ApplyAttributes): Likewise.
23383         (MethodData.ApplyObsoleteAttribute): Likewise.
23384         (MethodData.ApplyConditionalAttribute): Likewise.
23385         (MethodData.ApplyDllImportAttribute): Likewise.
23386         (MethodData.CheckAbstractAndExternal): Likewise.
23387         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23388         (MethodData.Emit): Formerly known as Method.Emit().
23389         (MemberBase): Moved everything which was specific to a single
23390         accessor/method to MethodData.
23391         (Method): Create a new MethodData and call Define() and Emit() on it.
23392         (Property, Indexer, Event): Create a new MethodData objects for each
23393         accessor and call Define() and Emit() on them.
23394
23395 2002-07-25  Martin Baulig  <martin@gnome.org>
23396
23397         Made MethodCore derive from MemberBase to reuse the code from there.
23398         MemberBase now also checks for attributes.
23399
23400         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23401         (MemberBase.GetMethodFlags): Moved here from class Method and marked
23402         as virtual.
23403         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23404         `CallingConventions cc' and `Attributes opt_attrs' arguments.
23405         (MemberBase.ApplyAttributes): New virtual method; applies the
23406         attributes to a method or accessor.
23407         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23408         (MemberBase.ApplyConditionalAttribute): Likewise.
23409         (MemberBase.ApplyDllImportAttribute): Likewise.
23410         (MemberBase.CheckAbstractAndExternal): Likewise.
23411         (MethodCore.ParameterTypes): This is now a property instead of a
23412         method, it's initialized from DoDefineParameters().
23413         (MethodCore.ParameterInfo): Removed the set accessor.
23414         (MethodCore.DoDefineParameters): New protected virtual method to
23415         initialize ParameterTypes and ParameterInfo.
23416         (Method.GetReturnType): We can now simply return the MemberType.
23417         (Method.GetMethodFlags): Override the MemberBase version and add
23418         the conditional flags.
23419         (Method.CheckBase): Moved some code from Define() here, call
23420         DoDefineParameters() here.
23421         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23422         here to avoid some larger code duplication.
23423         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23424         ensure that abstract and external accessors don't declare a body.
23425
23426         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23427         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23428         lookup in the attribute's parent classes, so we need to abort as soon
23429         as we found the first match.
23430         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23431         the attribute has no arguments.
23432
23433         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23434         of a Method.
23435
23436 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23437
23438         * cs-parser.jay: reverted previous patch.
23439
23440 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23441
23442         * cs-parser.jay: fixed bug #22119.
23443
23444 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23445
23446         * attribute.cs: fixed compilation. The error was:
23447         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
23448         be assigned to before control leaves the current method."
23449         [FIXME:  Filed as bug #28186: MCS must report this error.]
23450
23451 2002-07-25  Martin Baulig  <martin@gnome.org>
23452
23453         * attribute.cs (Attribute.Conditional_GetConditionName): New static
23454         method to pull the condition name ouf of a Conditional attribute.
23455         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23456         the obsolete message and error flag out of an Obsolete attribute.
23457
23458         * class.cs (Method.GetMethodFlags): New public method to get the
23459         TypeManager.MethodFlags for this method.
23460         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23461         private methods.
23462         (Method.Define): Get and apply the Obsolete and Conditional attributes;
23463         if we're overriding a virtual function, set the new private variable
23464         `parent_method'; call the new TypeManager.AddMethod().
23465
23466         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
23467         the MethodBuilder and the Method in a PtrHashtable.
23468         (TypeManager.builder_to_method): Added for this purpose.
23469         (TypeManager.MethodFlags): Added IsObsoleteError.
23470         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
23471         Obsolete and Conditional arguments in MethodBuilders.  If we discover
23472         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23473         the message from the attribute.
23474
23475 2002-07-24  Martin Baulig  <martin@gnome.org>
23476
23477         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23478         preprocessor directives, ensure that the argument to #define/#undef is
23479         exactly one identifier and that it's actually an identifier.
23480
23481         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23482         did not work ....
23483
23484 2002-07-24  Martin Baulig  <martin@gnome.org>
23485
23486         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23487         initialize it to TypeManager.object_type in the constructor.
23488         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23489         of the `hm.get_current' method if we're using the collection pattern.
23490         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23491         for the explicit conversion to make it work when we're using the collection
23492         pattern and the `Current' property has a different return type than `object'.
23493         Fixes #27713.
23494
23495 2002-07-24  Martin Baulig  <martin@gnome.org>
23496
23497         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23498         does not match, but don't report any errors.  This method is called in
23499         order for all methods in a MethodGroupExpr until a matching method is
23500         found, so we don't want to bail out if the first method doesn't match.
23501         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23502         matches, report the 123.  Fixes #28070.
23503
23504 2002-07-24  Martin Baulig  <martin@gnome.org>
23505
23506         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23507         TypeManager.TypeToCoreType() to the top of the method so the
23508         following equality checks will work.  Fixes #28107.
23509
23510 2002-07-24  Martin Baulig  <martin@gnome.org>
23511
23512         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23513         operand is of type uint, and the other operand is of type sbyte,
23514         short or int, the operands are converted to type long." -
23515         Actually do what this comment already told us.  Fixes bug #28106,
23516         added test-150.cs.
23517
23518 2002-07-24  Martin Baulig  <martin@gnome.org>
23519
23520         * class.cs (MethodBase): New abstract class.  This is now a base
23521         class for Property, Indexer and Event to avoid some code duplication
23522         in their Define() and DefineMethods() methods.
23523         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23524         generic methods for Define() and DefineMethods().
23525         (FieldBase): Derive from MemberBase, not MemberCore.
23526         (Property): Derive from MemberBase, not MemberCore.
23527         (Property.DefineMethod): Moved all the code from this method to the
23528         new MethodBase.DefineAccessor(), just call it with appropriate
23529         argumetnts.
23530         (Property.Define): Call the new Property.DoDefine(), this does some
23531         sanity checks and we don't need to duplicate the code everywhere.
23532         (Event): Derive from MemberBase, not MemberCore.
23533         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23534         accessors, this will also make them work with interface events.
23535         (Indexer): Derive from MemberBase, not MemberCore.
23536         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23537         (Indexer.Define): Use the new MethodBase functions.
23538
23539         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23540         argument to the constructor.
23541         (Interface.FindMembers): Added support for interface events.
23542         (Interface.PopluateEvent): Implemented.
23543
23544         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23545
23546 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23547
23548         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23549         but this is required to check for a method name being the same as
23550         the containing class.  
23551
23552         Handle this now.
23553
23554 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23555
23556         * interface.cs: initialize variable.
23557
23558 2002-07-23  Martin Baulig  <martin@gnome.org>
23559
23560         Implemented the IndexerName attribute in interfaces.
23561
23562         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23563         name if this is an explicit interface implementation.
23564         (Indexer.InterfaceIndexerName): New public variable.  If we're
23565         implementing an interface indexer, this is the IndexerName in that
23566         interface.  Otherwise, it's the IndexerName.
23567         (Indexer.DefineMethod): If we're implementing interface indexer,
23568         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23569         and Pending.ImplementIndexer methods.
23570         (Indexer.Define): Also define the PropertyBuilder if we're
23571         implementing an interface indexer and this is neither an explicit
23572         interface implementation nor do the IndexerName match the one in
23573         the interface.
23574
23575         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23576         If a method is defined here, then we always need to create a proxy
23577         for it.  This is used when implementing interface indexers.
23578         (Pending.IsInterfaceIndexer): New public method.
23579         (Pending.ImplementIndexer): New public method.
23580         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23581         This is used when implementing interface indexers to define a proxy
23582         if necessary.
23583         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23584         define a proxy if necessary.
23585
23586         * interface.cs (Interface.IndexerName): New public variable.
23587         (Interface.PopulateIndexer): Set the IndexerName.
23588         (Interface.DefineIndexers): New private method.  Populate all the
23589         indexers and make sure their IndexerNames match.
23590
23591         * typemanager.cs (IndexerPropertyName): Added support for interface
23592         indexers.
23593
23594 2002-07-22  Martin Baulig  <martin@gnome.org>
23595
23596         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23597         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23598         ret if HasReturnLabel.
23599         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23600         variables.
23601
23602         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23603         and set the ec.LoopBeginTryCatchLevel.
23604         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23605         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23606         the current ec.TryCatchLevel, the branch goes out of an exception
23607         block.  In this case, we need to use Leave and not Br.
23608
23609 2002-07-22  Martin Baulig  <martin@gnome.org>
23610
23611         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23612         block unless the block does not always return or it is contained in
23613         another try { ... } catch { ... } block.  Fixes bug #26506.
23614         Added verify-1.cs to the test suite.
23615
23616 2002-07-22  Martin Baulig  <martin@gnome.org>
23617
23618         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23619         then we do not always return.  Fixes bug #24985.
23620
23621 2002-07-22  Martin Baulig  <martin@gnome.org>
23622
23623         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23624         lookup on a per-class level; ie. walk up the class hierarchy until we
23625         found at least one applicable method, then choose the best among them.
23626         Fixes bug #24463 and test-29.cs.
23627
23628 2002-07-22  Martin Baulig  <martin@gnome.org>
23629
23630         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23631         return types of the methods.  The return type is not part of the
23632         signature and we must not check it to make the `new' modifier work.
23633         Fixes bug #27999, also added test-147.cs.
23634         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23635
23636         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23637         on the method's return type.
23638
23639 2002-07-21  Martin Baulig  <martin@gnome.org>
23640
23641         * assign.cs: Make this work if the rightmost source is a constant and
23642         we need to do an implicit type conversion.  Also adding a few more tests
23643         to test-38.cs which should have caught this.
23644
23645         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23646         target in the makefile for this.  The makefile.gnu is primarily intended
23647         for end-users who don't want to debug the compiler.
23648
23649 2002-07-21  Martin Baulig  <martin@gnome.org>
23650
23651         * assign.cs: Improved the Assign class so it can now handle embedded
23652         assignments (X = Y = Z = something).  As a side-effect this'll now also
23653         consume less local variables.  test-38.cs now passes with MCS, added
23654         a few new test cases to that test.
23655
23656 2002-07-20  Martin Baulig  <martin@gnome.org>
23657
23658         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23659         instructions.  Fixes bug #27977, also added test-146.cs.
23660
23661 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23662
23663         * cs-tokenizer.cs: fixed getHex ().
23664
23665 2002-07-19  Martin Baulig  <martin@gnome.org>
23666
23667         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23668         not Type.GetType() to lookup the array type.  This is needed when
23669         we're constructing an array of a user-defined type.
23670         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23671         single-dimensional arrays, but also for single-dimensial arrays of
23672         type decimal.
23673
23674 2002-07-19  Martin Baulig  <martin@gnome.org>
23675
23676         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23677         this function is called, it's not allowed to share LocalBuilders
23678         among ILGenerators.
23679
23680 2002-07-19  Martin Baulig  <martin@gnome.org>
23681
23682         * expression.cs (Argument.Resolve): Report an error 118 when trying
23683         to pass a type as argument.
23684
23685 2002-07-18  Martin Baulig  <martin@gnome.org>
23686
23687         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23688         Conv_R_Un for the signed `long' type.
23689
23690 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23691
23692         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23693         `expr' for the temporary result, as that will fail if we do
23694         multiple resolves on the same expression.
23695
23696 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23697
23698         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23699         ec.TypeContainer for looking up aliases. 
23700
23701         * class.cs (TypeContainer): Remove LookupAlias from here.
23702
23703         * decl.cs (DeclSpace); Move here.
23704
23705 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23706
23707         * class.cs (FindMembers): Only call filter if the constructor
23708         bulider is not null.
23709
23710         Also handle delegates in `NestedTypes' now.  Now we will perform
23711         type lookups using the standard resolution process.  This also
23712         fixes a bug.
23713
23714         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23715         This uses Expressions (the limited kind that can be parsed by the
23716         tree) instead of strings.
23717
23718         * expression.cs (ComposedCast.ToString): Implement, used to flag
23719         errors since now we have to render expressions.
23720
23721         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23722         FormArrayType. 
23723
23724         * ecore.cs (SimpleName.ToString): ditto.
23725
23726         * cs-parser.jay: Instead of using strings to assemble types, use
23727         Expressions to assemble the type (using SimpleName, ComposedCast,
23728         MemberAccess).  This should fix the type lookups in declarations,
23729         because we were using a different code path for this.
23730
23731         * statement.cs (Block.Resolve): Continue processing statements
23732         even when there is an error.
23733
23734 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23735
23736         * class.cs (Event.Define): Also remove the `remove' method from
23737         the list of pending items.
23738
23739         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23740         generate more compact code. 
23741
23742 2002-07-17  Martin Baulig  <martin@gnome.org>
23743
23744         * const.cs (Const.LookupConstantValue): Add support for constant
23745         `unchecked' and `checked' expressions.
23746         Also adding test case test-140.cs for this.
23747
23748 2002-07-17  Martin Baulig  <martin@gnome.org>
23749
23750         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23751         check whether mi.ReturnType implements the IEnumerator interface; the
23752         `==' and the IsAssignableFrom() will fail in this situation.
23753
23754 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23755
23756         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23757         here too.
23758
23759 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23760
23761         * expression.cs: fixed bug #27811.
23762
23763 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23764
23765         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23766         Molaro: when we are a ref, the value already contains a pointer
23767         value, do not take the address of it.
23768
23769 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23770         * removed mb-parser.jay and mb-tokenizer.cs
23771
23772 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23773
23774         * expression.cs: check against the building corlib void type.
23775
23776 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23777
23778         * ecore.cs: fix for valuetype static readonly fields: when 
23779         initializing them, we need their address, not the address of a copy.
23780
23781 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23782
23783         * typemanager.cs: register also enum_type in corlib.
23784
23785 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23786
23787         * class.cs: allow calling this (but not base) initializers in structs.
23788
23789 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23790
23791         * ecore.cs: make sure we compare against the building base types
23792         in GetTypeSize ().
23793
23794 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23795
23796         * typemanager.cs: fix TypeToCoreType() to handle void and object
23797         (corlib gets no more typerefs after this change).
23798
23799 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23800
23801         * expression.cs (ArrayCreation.EmitArrayArguments): use
23802         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23803
23804         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23805         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23806         array indexes, the runtime actually forbids them.
23807
23808         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23809         for array arguments here.
23810
23811         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23812         instead of the default for ValueTypes.
23813
23814         (New.DoEmit): Use IsValueType instead of
23815         IsSubclassOf (value_type)
23816         (New.DoResolve): ditto.
23817         (Invocation.EmitCall): ditto.
23818
23819         * assign.cs (Assign): ditto.
23820
23821         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23822         Statements *are* currently doing part of their resolution during
23823         Emit.  
23824
23825         Expressions do always resolve during resolve, but statements are
23826         only required to propagate resolution to their children.
23827
23828 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23829
23830         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23831
23832         (LoadAssembly): Do not add the dll if it is already specified
23833
23834         (MainDriver): Add the System directory to the link path at the end,
23835         after all the other -L arguments. 
23836
23837         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23838         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23839         ldelem.u1) and using the opposite for sbytes.
23840
23841         This fixes Digger, and we can finally run it.
23842
23843         * driver.cs (UnixParseOption): Move the option parsing here.  
23844         (CSCParseOption): Implement CSC-like parsing of options.
23845
23846         We now support both modes of operation, the old Unix way, and the
23847         new CSC-like way.  This should help those who wanted to make cross
23848         platform makefiles.
23849
23850         The only thing broken is that /r:, /reference: and /lib: are not
23851         implemented, because I want to make those have the same semantics
23852         as the CSC compiler has, and kill once and for all the confussion
23853         around this.   Will be doing this tomorrow.
23854
23855         * statement.cs (Unsafe.Resolve): The state is checked during
23856         resolve, not emit, so we have to set the flags for IsUnsfe here.
23857
23858 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23859
23860         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23861         not catch the Error_ObjectRefRequired in SimpleName (as it is
23862         possible to have a class/instance variable name that later gets
23863         deambiguated), we have to check this here.      
23864
23865 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23866
23867         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23868         make static and put into Expression.
23869
23870         (Event.Define): Register the private field of the event with the 
23871         TypeManager so that GetFieldFromEvent can get at it.
23872
23873         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23874         keep track of the private field associated with an event which
23875         has no accessors.
23876
23877         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23878         private field.
23879
23880         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23881
23882 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23883
23884         * expression.cs (Binary.EmitBranchable): this routine emits the
23885         Binary expression in a branchable context.  This basically means:
23886         we need to branch somewhere, not just get the value on the stack.
23887
23888         This works together with Statement.EmitBoolExpression.
23889
23890         * statement.cs (Statement.EmitBoolExpression): Use
23891         EmitBranchable. 
23892
23893 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23894
23895         * statement.cs (For): Reduce the number of jumps in loops.
23896
23897         (For): Implement loop inversion for the For statement.
23898
23899         (Break): We can be breaking out of a Try/Catch controlled section
23900         (foreach might have an implicit try/catch clause), so we need to
23901         use Leave instead of Br.
23902
23903         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23904         now).  If the instace expression supports IMemoryLocation, we use
23905         the AddressOf method from the IMemoryLocation to extract the
23906         address instead of emitting the instance.
23907
23908         This showed up with `This', as we were emitting the instance
23909         always (Emit) instead of the Address of This.  Particularly
23910         interesting when This is a value type, as we dont want the Emit
23911         effect (which was to load the object).
23912
23913 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
23914
23915         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23916
23917         * statement.cs (Checked): Set the CheckedState during the resolve
23918         process too, as the ConvCast operations track the checked state on
23919         the resolve process, and not emit.
23920
23921         * cs-parser.jay (namespace_member_declaration): Flag that we have
23922         found a declaration when we do.  This is used to flag error 1529
23923
23924         * driver.cs: Report ok when we display the help only.
23925
23926 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
23927
23928         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23929
23930 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
23931
23932         * cs-tokenizer.cs (define): We also have to track locally the
23933         defines.  AllDefines is just used for the Conditional Attribute,
23934         but we also need the local defines for the current source code. 
23935
23936 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
23937
23938         * statement.cs (While, For, Do): These loops can exit through a
23939         Break statement, use this information to tell whether the
23940         statement is the last piece of code.
23941
23942         (Break): Flag that we break.
23943
23944         * codegen.cs (EmitContexts): New `Breaks' state variable.
23945
23946 2002-07-03  Martin Baulig  <martin@gnome.org>
23947
23948         * class.cs (TypeContainer.MethodModifiersValid): Allow override
23949         modifiers in method declarations in structs.  Otherwise, you won't
23950         be able to override things like Object.Equals().
23951
23952 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23953
23954         * class.cs (Method, Property, Indexer): Do not allow the public
23955         modifier to be used in explicit interface implementations.
23956
23957         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23958         override modifiers in method declarations in structs
23959
23960 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
23961
23962         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23963         integer or real overflow, report an error
23964
23965 2002-07-02  Martin Baulig  <martin@gnome.org>
23966
23967         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23968         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23969         to tell the runtime about our newly created System.Object and
23970         System.ValueType types.
23971
23972 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23973
23974         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23975         struct instead of Ldarg/Starg.
23976
23977 2002-07-02  Martin Baulig  <martin@gnome.org>
23978
23979         * expression.cs (Indirection.Indirection): Call
23980         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23981
23982 2002-07-02  Martin Baulig  <martin@gnome.org>
23983
23984         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23985         ValueType, call TypeManager.TypeToCoreType() on it.
23986         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23987         the OpCodes.Newarr argument.
23988
23989 2002-07-02  Martin Baulig  <martin@gnome.org>
23990
23991         * expression.cs (Invocation.EmitCall): When compiling corlib,
23992         replace all calls to the system's System.Array type to calls to
23993         the newly created one.
23994
23995         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23996         System.Array methods.
23997         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23998         from the system's System.Array type which must be replaced.
23999
24000 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24001
24002         * typemanager.cs: load unverifiable_code_ctor so we can build
24003         corlib using the correct type. Avoid using GetTypeCode() with
24004         TypeBuilders.
24005         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24006         TypeManager.object_type to allow building corlib.
24007
24008 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24009
24010         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24011
24012 2002-07-01  Martin Baulig  <martin@gnome.org>
24013
24014         * class.cs: Make the last change actually work, we need to check
24015         whether `ifaces != null' to avoid a crash.
24016
24017 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24018
24019         * class.cs: when we build structs without fields that implement
24020         interfaces, we need to add the interfaces separately, since there is
24021         no API to both set the size and add the interfaces at type creation
24022         time.
24023
24024 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24025
24026         * expression.cs: the dimension arguments to the array constructors
24027         need to be converted if they are a long.
24028
24029 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24030
24031         * class.cs: don't emit ldarg.0 if there is no parent constructor
24032         (fixes showstopper for corlib).
24033
24034 2002-06-29  Martin Baulig  <martin@gnome.org>
24035
24036         MCS now compiles corlib on GNU/Linux :-)
24037
24038         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24039         ie. check for MethodImplOptions.InternalCall.
24040
24041         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24042         and TypeManager.attribute_type are null, so we must explicitly check
24043         whether parent is not null to find out whether it's an attribute type.
24044         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24045         and SetBuilder, not only if the property is neither abstract nor external.
24046         This is necessary to set the MethodImplOptions on the accessor methods.
24047         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24048         SetBuilder, see Property.Emit().
24049
24050         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24051         populate "System.Object", "System.ValueType" and "System.Attribute" since
24052         they've already been populated from BootCorlib_PopulateCoreTypes().
24053
24054 2002-06-29  Martin Baulig  <martin@gnome.org>
24055
24056         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24057         is the NullLiteral, we also need to make sure that target_type is not
24058         an enum type.   
24059
24060 2002-06-29  Martin Baulig  <martin@gnome.org>
24061
24062         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24063         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24064         before calling BootstrapCorlib_ResolveDelegate ().
24065
24066 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24067
24068         * statement.cs: fixed build-breaker. All tests passed ok.
24069
24070 2002-06-27  Martin Baulig  <martin@gnome.org>
24071
24072         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24073         for System.Decimal when compiling corlib.
24074
24075 2002-06-27  Martin Baulig  <martin@gnome.org>
24076
24077         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24078         switch blocks which contain nothing but a default clause.
24079
24080 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24081
24082        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24083
24084 2002-06-27  Martin Baulig  <martin@gnome.org>
24085
24086         * ecore.cs (PropertyExpr.PropertyExpr): Call
24087         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24088
24089         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24090         is already a TypeBuilder.
24091
24092 2002-06-27  Martin Baulig  <martin@gnome.org>
24093
24094         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24095         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24096         the "from an array-type to System.Array" case.  This makes it work
24097         when compiling corlib.
24098
24099 2002-06-27  Martin Baulig  <martin@gnome.org>
24100
24101         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24102         non-static PropertyExpr, set its InstanceExpression.  This makes
24103         the `ICollection.Count' property work in System/Array.cs.
24104
24105 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24106
24107         * driver.cs: Made error handling more consistent.  Errors now
24108         tracked by Report class, so many methods which used to return int
24109         now return void.  Main() now prints success/failure and 
24110         errors/warnings message.
24111
24112         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24113         the magic number return values (123 and 124).  Now, if the
24114         expected error occurs, the compiler exits with success (exit value
24115         0).  If the compilation completes without seeing that particular
24116         error, the compiler exits with failure (exit value 1).  The
24117         makefile in mcs/errors has been changed to handle the new behaviour.
24118
24119         * report.cs: Made 'expected error' number a property and renamed
24120         it from 'Probe' to 'ExpectedError'.
24121
24122         * genericparser.cs: Removed error handling support, since it is
24123         now all done by Report class.
24124
24125         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24126         class, so parse() no longer returns an int.
24127
24128         * namespace.cs: Use Report.Error instead of GenericParser.error
24129
24130 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24131
24132         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24133         TypeContainer.AddOperator): At the front of the list put the
24134         explicit implementations, so they get resolved/defined first. 
24135
24136 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24137
24138         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24139         interface type is implemented by this TypeContainer.  Used during
24140         explicit interface implementation.
24141
24142         (Property.Define, Indexer.Define, Method.Define): Validate that
24143         the given interface in the explicit implementation is one of the
24144         base classes for the containing type.
24145
24146         Also if we are explicitly implementing an interface, but there is
24147         no match in the pending implementation table, report an error.
24148
24149         (Property.Define): Only define the property if we are
24150         not explicitly implementing a property from an interface.  Use the
24151         correct name also for those properties (the same CSC uses,
24152         although that is really not needed).
24153
24154         (Property.Emit): Do not emit attributes for explicitly implemented
24155         properties, as there is no TypeBuilder.
24156
24157         (Indexer.Emit): ditto.
24158
24159         Hiding then means that we do not really *implement* a pending
24160         implementation, which makes code fail.
24161
24162 2002-06-22  Martin Baulig  <martin@gnome.org>
24163
24164         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24165         the return value of Object.GetType().  [FIXME: we need to do this whenever
24166         we get a type back from the reflection library].
24167
24168 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24169
24170         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24171
24172 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24173
24174         * attribute.cs: Return null if we can not look up the type.
24175
24176         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24177         the interface types found.
24178
24179         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24180         interface types found.
24181
24182         * typemanager.cs (GetInterfaces): Make this routine returns alll
24183         the interfaces and work around the lame differences between
24184         System.Type and System.Reflection.Emit.TypeBuilder in the results
24185         result for GetInterfaces.
24186
24187         (ExpandInterfaces): Given an array of interface types, expand and
24188         eliminate repeated ocurrences of an interface.  This expands in
24189         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24190         be IA, IB, IC.
24191
24192 2002-06-21  Martin Baulig  <martin@gnome.org>
24193
24194         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24195         on System.Enum.
24196
24197 2002-06-21  Martin Baulig  <martin@gnome.org>
24198
24199         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24200         and called with one of the core types, return the corresponding typebuilder for
24201         that type.
24202
24203         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24204         element type.
24205
24206 2002-06-21  Martin Baulig  <martin@gnome.org>
24207
24208         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24209         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24210         (Expression.ConvertReferenceExplicit): Likewise.
24211
24212         * expression.cs (ElementAccess.DoResolve): Likewise.
24213         (ElementAccess.DoResolveLValue): Likewise.
24214
24215 2002-06-10  Martin Baulig  <martin@gnome.org>
24216
24217         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24218         add the "value" parameter to the parameter list.
24219
24220         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24221         to our caller.
24222
24223 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24224
24225         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24226         the argument to an int, uint, long or ulong, per the spec.  Also
24227         catch negative constants in array creation.
24228
24229 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24230
24231         * class.cs: do not allow the same interface to appear twice in
24232         the definition list.
24233
24234 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24235
24236         * ecore.cs: don't use ldlen with System.Array.
24237
24238 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24239
24240         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24241
24242 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24243
24244         * modifiers.cs: produce correct field attributes for protected
24245         internal. Easy fix so miguel can work on ther harder stuff:-)
24246
24247 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
24248
24249         * pending.cs: New file.  Move the code from class.cs here.
24250         Support clearning the pending flag for all methods (when not doing
24251         explicit interface implementation).
24252
24253 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24254
24255         * rootcontext.cs: added a couple more types needed to bootstrap.
24256
24257 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
24258
24259         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24260         constructor in the type, instead of any constructor in the type
24261         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
24262         a bug in the Mono runtime when applying the params attribute). 
24263
24264 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
24265         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24266
24267 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
24268
24269         * expression.cs (Unary.ResolveOperator): Use TypeManager
24270         to resolve the type.
24271
24272 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24273
24274         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24275         attached.
24276
24277         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24278         with each member too.
24279
24280         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24281         field builders too - this takes care of the enum member case.
24282
24283 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24284
24285         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24286         address-of operator on both value types and pointers.
24287
24288 2002-06-10  Martin Baulig  <martin@gnome.org>
24289
24290         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24291         PropertyBuilder to the `property_builders' list.
24292
24293         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24294         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24295         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24296         find any indexers which are inherited from an interface.
24297
24298 2002-06-09  Martin Baulig  <martin@gnome.org>
24299
24300         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24301         the same type as the constant if necessary.  There's also a test-130.cs
24302         for this.
24303
24304         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24305
24306         * typemanager.cs (TypeManager.ChangeType): Previously known as
24307         Enum.ChangeEnumType().
24308
24309 2002-06-09  Martin Baulig  <martin@gnome.org>
24310
24311         * expression.cs (Cast.TryReduce): Added support for consts.
24312
24313 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24314
24315         * class.cs (Accessor): Hold attributes information so we can pass
24316         it along.
24317
24318         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24319         Modify to pass in attributes attached to the methods.
24320
24321         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24322
24323         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24324         to handle the Accessor kind :-)
24325
24326         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24327
24328 2002-06-08  Martin Baulig  <martin@gnome.org>
24329
24330         * expression.cs (Unary.TryReduceNegative): Added support for
24331         ULongConstants.
24332
24333 2002-06-08  Martin Baulig  <martin@gnome.org>
24334
24335         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24336         name can't be found in the `defined_names' - the caller will do a
24337         MemberLookup in this case and thus find methods in System.Enum
24338         such as Enum.IsDefined().
24339
24340 2002-06-08  Martin Baulig  <martin@gnome.org>
24341
24342         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24343         Convert.ChangeType() which works with TypeBuilder created types.
24344         (Enum.LookupEnumValue, Enum.Define): Use it here.
24345
24346         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24347         `TypeBuilder.BaseType != null' check.
24348         (TypeContainer.FindMembers): Only lookup parent members if we
24349         actually have a parent.
24350         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24351         (ConstructorInitializer.Resolve): Likewise.
24352
24353         * interface.cs (Interface.FindMembers): Added
24354         `TypeBuilder.BaseType != null' check.
24355
24356         * rootcontext.cs (RootContext.ResolveCore): Added
24357         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24358         classes_second_stage.
24359
24360         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24361         debug_type and trace_type when compiling with --nostdlib.       
24362
24363 2002-06-07  Martin Baulig  <martin@gnome.org>
24364
24365         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24366         (AddField): Set it to true when adding a non-static field.
24367         (DefineType): Use `have_nonstatic_fields' to find out whether we
24368         have non-static fields, not `Fields != null'.
24369
24370 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24371
24372         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24373         dereferencing a null on the static-field code path)
24374
24375 2002-05-30  Martin Baulig  <martin@gnome.org>
24376
24377         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24378         to take command line arguments.  Use reflection to call the new
24379         custom `Initialize' function on the symbol writer and pass it the
24380         command line arguments.
24381
24382         * driver.cs (--debug-args): New command line argument to pass command
24383         line arguments to the symbol writer.
24384
24385 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
24386
24387         * assign.cs (DoResolve): Forgot to do the implicit conversion to
24388         the target type for indexers and properties.  Thanks to Joe for
24389         catching this.
24390
24391 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
24392
24393         * typemanager.cs (MethodFlags): returns the method flags
24394         (Obsolete/ShouldIgnore) that control warning emission and whether
24395         the invocation should be made, or ignored. 
24396
24397         * expression.cs (Invocation.Emit): Remove previous hack, we should
24398         not do this on matching a base type, we should do this based on an attribute
24399
24400         Only emit calls to System.Diagnostics.Debug and
24401         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24402         on the command line.
24403
24404         * rootcontext.cs: Global settings for tracing and debugging.
24405
24406         * cs-tokenizer.cs (define): New utility function to track
24407         defines.   Set the global settings for TRACE and DEBUG if found.
24408
24409 2002-05-25  Ravi Pratap  <ravi@ximian.com>
24410
24411         * interface.cs (Populate*): Pass in the TypeContainer as well as
24412         the DeclSpace as parameters so that we can create EmitContexts and
24413         then use that to apply attributes etc.
24414
24415         (PopulateMethod, PopulateEvent, PopulateProperty)
24416         (PopulateIndexer): Apply attributes everywhere.
24417
24418         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24419         etc.
24420
24421         (ApplyAttributes): Update accordingly.
24422
24423         We now apply interface attributes for all members too.
24424
24425 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
24426
24427         * class.cs (Indexer.Define); Correctly check if we are explicit
24428         implementation (instead of checking the Name for a ".", we
24429         directly look up if the InterfaceType was specified).
24430
24431         Delay the creation of the PropertyBuilder.
24432
24433         Only create the PropertyBuilder if we are not an explicit
24434         interface implementation.   This means that explicit interface
24435         implementation members do not participate in regular function
24436         lookups, and hence fixes another major ambiguity problem in
24437         overload resolution (that was the visible effect).
24438
24439         (DefineMethod): Return whether we are doing an interface
24440         implementation. 
24441
24442         * typemanager.cs: Temporary hack until we get attributes in
24443         interfaces (Ravi is working on that) and we get IndexerName
24444         support in interfaces.
24445
24446         * interface.cs: Register the indexers as properties.
24447
24448         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24449         warning, I have verified that this is a bug in the .NET runtime
24450         (JavaScript suffers of the same problem).
24451
24452         * typemanager.cs (MemberLookup): When looking up members for
24453         interfaces, the parent of an interface is the implicit
24454         System.Object (so we succeed in searches of Object methods in an
24455         interface method invocation.  Example:  IEnumerable x;  x.ToString
24456         ()) 
24457
24458 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
24459
24460         * class.cs (Event): Events should also register if they do
24461         implement the methods that an interface requires.
24462
24463         * typemanager.cs (MemberLookup); use the new GetInterfaces
24464         method. 
24465
24466         (GetInterfaces): The code used to lookup interfaces for a type is
24467         used in more than one place, factor it here. 
24468
24469         * driver.cs: Track the errors at the bottom of the file, we kept
24470         on going.
24471
24472         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24473         instance if the method we are calling is static!
24474
24475 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
24476
24477         * attribute.cs (ApplyAttributes): Make this function filter out
24478         the IndexerName attribute (as that attribute in reality is never
24479         applied) and return the string constant for the IndexerName
24480         attribute. 
24481
24482         * class.cs (TypeContainer.Emit): Validate that all the indexers
24483         have the same IndexerName attribute, and if so, set the
24484         DefaultName attribute on the class. 
24485
24486         * typemanager.cs: The return value might contain other stuff (not
24487         only methods).  For instance, consider a method with an "Item"
24488         property and an Item method.
24489
24490         * class.cs: If there is a problem with the parameter types,
24491         return. 
24492
24493 2002-05-24  Ravi Pratap  <ravi@ximian.com>
24494
24495         * ecore.cs (ImplicitConversionExists): Wrapper function which also
24496         looks at user defined conversion after making a call to 
24497         StandardConversionExists - we need this for overload resolution.
24498
24499         * expression.cs : Update accordingly the various method calls.
24500
24501         This fixes 2 bugs filed against implicit user defined conversions 
24502
24503 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24504
24505         * statement.cs: Track the result of the assignment.
24506
24507 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24508
24509         * expression.cs (MemberAccess): Improved error reporting for
24510         inaccessible members.
24511
24512 2002-05-22  Martin Baulig  <martin@gnome.org>
24513
24514         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24515         itself with debugging support.
24516
24517 2002-05-22  Martin Baulig  <martin@gnome.org>
24518
24519         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24520         Removed, this isn't needed anymore.
24521
24522 2002-05-20  Martin Baulig  <martin@gnome.org>
24523
24524         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24525         be underlying type for an enum.
24526
24527 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24528
24529         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24530         that splits out the loading of just the core types.
24531
24532         * rootcontext.cs (ResolveCore): Split the struct resolution in
24533         two, so we can load the enumeration underlying types before any
24534         enums are used.
24535
24536         * expression.cs (Is): Bandaid until we fix properly Switch (see
24537         bug #24985 for details).
24538
24539         * typemanager.cs (ImplementsInterface): The hashtable will contain
24540         a null if there are no interfaces implemented.
24541
24542 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24543
24544         * cs-parser.jay (indexer_declarator): It is fine to have array
24545         parameters
24546
24547 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24548
24549         * typemanager.cs: (RegisterBuilder): New function used to register
24550         TypeBuilders that implement interfaces.  Since
24551         TypeBuilder.GetInterfaces (as usual) does not work with lame
24552         Reflection.Emit. 
24553         (AddUserType): register interfaces.
24554
24555         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24556         dealing with TypeBuilder.  Also, arrays are showing up as
24557         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24558         methods can not be invoked on them!
24559
24560         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24561         (ImplicitReferenceConversionExists): Split out from
24562         StandardConversionExists. 
24563
24564         * expression.cs (As): We were only implementing one of the three
24565         cases for the as operator.  We now implement them all.
24566         (Is): Implement the various other cases for Is as well.
24567
24568         * typemanager.cs (CACHE): New define used to control if we want or
24569         not the FindMembers cache.  Seems to have a negative impact on
24570         performance currently
24571
24572         (MemberLookup): Nested types have full acess to
24573         enclosing type members
24574
24575         Remove code that coped with instance/static returns for events, we
24576         now catch this in RealFindMembers.
24577
24578         (RealFindMembers): only perform static lookup if the instance
24579         lookup did not return a type or an event.  
24580
24581 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24582
24583         * assign.cs (CompoundAssign): We pass more semantic information
24584         now to Compound Assignments than we did before: now we have all
24585         the information at hand, and now we resolve the target *before* we
24586         do the expression expansion, which allows the "CacheValue" method
24587         to have the effect we intended (before, a [x] += 1 would generate
24588         two differen ArrayAccess expressions from the ElementAccess,
24589         during the resolution process).
24590
24591         (CompoundAssign.DoResolve): Resolve target and original_source here.
24592
24593 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24594
24595         * expression.cs (ArrayAccess): dropped debugging information. 
24596
24597         * typemanager.cs: Small bug fix: I was always returning i_members,
24598         instead of one of i_members or s_members (depending on which had
24599         the content).
24600
24601         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24602         method is invoked before any code generation takes place, and it
24603         is a mechanism to inform that the expression will be invoked more
24604         than once, and that the method should use temporary values to
24605         avoid having side effects
24606
24607         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24608
24609         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24610         implementation.
24611
24612         * expression.cs (Indirection, ArrayAccess): Add support for
24613         CacheTemporaries in these two bad boys. 
24614
24615         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24616         ldobj or ldind_ref.  
24617         (StoreFromPtr): Handle stobj as well.
24618
24619         * expression.cs (UnaryMutator): Share more code.
24620
24621         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24622         down: I was not tracking the Filter function as well, which
24623         was affecting the results of the cache.
24624
24625 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24626
24627         * attribute.cs: Remove the hack to handle the CharSet property on
24628         StructLayouts. 
24629
24630 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24631
24632         * attribute.cs (DoResolve): More uglyness, we now only try to
24633         resolve the attribute partially, to extract the CharSet
24634         information (only if we are a StructLayout attribute).  Otherwise 
24635
24636         (GetExtraTypeInfo): Add some code to conditionally kill in the
24637         future this.   I am more and more convinced that the .NET
24638         framework has special code to handle the attribute setting on
24639         certain elements.
24640
24641         * expression.cs (IsParamsMethodApplicable): Revert my previous
24642         foreach change here, it was wrong.
24643
24644 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24645
24646         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24647         (pp_expr): do not abort on unknown input, just return.
24648         (eval): abort if there are pending chars.
24649
24650         * attribute.cs (Attribute.Resolve): Positional parameters are
24651         optional.  Deal with that case.
24652
24653         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24654         the Ansi/Unicode/Auto information for the type.
24655
24656         (TypeContainer.DefineType): instantiate the EmitContext here, as
24657         we will be using it during the type definition (to resolve
24658         attributes) and during the emit phase.
24659
24660         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24661         to pull type information out of the attributes
24662
24663         (Attribute.Resolve): track the constructor builder, and allow for
24664         multiple invocations (structs and classes will use this).
24665
24666         * ecore.cs (MemberLookupFinal): new version with all the
24667         parameters customizable.
24668
24669         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24670         constructors.  Return if the result value is null (as the error
24671         would have been flagged already by MemberLookupFinal)
24672
24673         Do not allow instances of abstract classes or interfaces to be
24674         created.
24675
24676         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24677         We have to compare the assembly property here when dealing with
24678         FamANDAssem and Assembly access modifiers, because we might be
24679         creating an assembly from *modules* (that means that we are not
24680         getting TypeBuilders for types defined in other modules that are
24681         part of this assembly).
24682
24683         (Method.Emit): If the method is marked abstract and has a body,
24684         emit an error. 
24685
24686         (TypeContainer.DefineMembers): If both the defined member and the
24687         parent name match are methods, then do not emit any warnings: let
24688         the Method.Define routine take care of flagging warnings.  But if
24689         there is a mismatch (method overrides something else, or method is
24690         overriwritten by something, then emit warning).
24691
24692         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24693         set to null, this means `do not check for the return type on the
24694         signature'. 
24695
24696         (Method.Define): set the return type for the method signature to
24697         null, so that we get methods with the same name and parameters and
24698         different return types.  This is used to flag warning 114 (you are
24699         hiding a method, and you probably want to use the new/override
24700         keywords instead).
24701
24702         * typemanager.cs (MemberLookup): Implemented proper access
24703         control, closing a long standing set of bug reports.  The problem
24704         was that the Framework only has two bits: Public and NonPublic,
24705         and NonPublic includes private and protected methods, but we need
24706         to enforce the FamANDAssem, FamOrAssem and Family. 
24707
24708 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24709
24710         * statement.cs (GotoCase): Return true: Ammounts to giving up
24711         knowledge on whether we return or not, and letting the other case
24712         be responsible for it.
24713
24714 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24715
24716         * driver.cs: Do not load directories for each file processed, only
24717         do it if there is a pattern.
24718
24719         * ecore.cs: Report readonly assigns here as well, as we might have
24720         been resolved only by MemberAccess.
24721
24722         (SimpleName.SimpleNameResolve): Also be useful for LValue
24723         resolution.   We need this to propagate assign to local readonly variables
24724
24725         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24726         do not want to reuse potential criteria memory.
24727
24728         * class.cs (MyEventBuilder): Set reflected_type;
24729
24730         * ecore.cs (Constantify): Added support for constifying bools.
24731
24732         (RootContext.LookupType): Added a cache for values looked up in
24733         the declaration space.
24734
24735         * typemanager.cs (FindMembers): Now is a front-end to
24736         RealFindMembers, and provides a two-level hashtable-based cache to
24737         the request.  
24738
24739         15% performance improvement: from 22.5 to 19.2 seconds.
24740
24741         * expression.cs (IsParamsMethodApplicable): use foreach.
24742         (Invocation.DoResolve): ditto.
24743         (New.DoResolve): ditto.
24744         (ArrayCreation.DoResolve): ditto.
24745
24746         * ecore.cs (FindMostEncompassingType): use foreach.
24747
24748         * delegate.cs (NewDelegate.DoResolve): Use foreach
24749
24750         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24751         (RemoveMethods): use foreach.
24752
24753         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24754         nested foreach statements instead of for, and also break out of
24755         the inner loop once a match is found.
24756
24757         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24758
24759 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24760
24761         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24762         we actually unwrap the expression to allow for extra information
24763         to be extracted. 
24764
24765         * expression.cs: Use Shr_Un on unsigned operations. 
24766
24767 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24768
24769         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24770         applicable operators was not being considered correctly. This closes
24771         the bug Miguel reported.
24772
24773 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24774
24775         * attribute.cs: check that the type derives from System.Attribute
24776         and report the correct error in that case (moved the duplicate code to
24777         its own method, too).
24778
24779 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24780
24781         * attribute.cs: lookup attribute type name as the spec says: first the
24782         bare attribute name and then name + "Attribute" (nant compiles with
24783         mcs after this fix).
24784
24785 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24786
24787         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24788         Because of the way we parse things, we should try to see if a
24789         UIntConstant can fit in an integer.
24790
24791 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24792
24793         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24794         when we are in an explicit context.
24795
24796         (ConvertReferenceExplicit): When converting from Iface type S to Class
24797         T make sure the rules are implemented as an OR.
24798
24799         * parameter.cs (ParameterType): Make it a property for now although the
24800         purpose really isn't anything immediate.
24801
24802         * expression.cs (Is*Applicable): Do better checking on the parameter type
24803         of a ref/out parameter. The ones from the system assemblies are already 
24804         marked with the correct type so we don't need to do any correction.
24805
24806         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24807         the object type is standard too so include that.
24808
24809 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24810
24811         * ecore.cs (StandardConversionExists): Augment with missing code:
24812         deal with IntConstant, LongConstants and Enumerations.
24813
24814         * assign.cs: Report the error, instead of failing silently
24815
24816         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24817         typecontainer that they are declared, because the
24818         typecontainer/namespace will have the list of using clauses that
24819         need to be applied.
24820
24821         Assembly Attributes were escaping the normal registration
24822         mechanism. 
24823
24824         (EmitCode): Apply attributes within an EmitContext that represents
24825         the container they were declared on.
24826
24827         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24828
24829 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24830
24831         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24832         Revamp completely - make much cleaner as we now operate only
24833         on a set of Types.
24834
24835         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24836         to implement the logic detailed in the spec more correctly.
24837
24838         (UserDefinedConversion): Update accordingly.
24839
24840 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24841
24842         * statement.cs: Return flow analysis information up.
24843
24844         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24845         and the default.
24846
24847         (token): Do not consume an extra character before calling
24848         decimal_digits.
24849
24850 2002-05-06  Piers Haken <piersh@friskit.com>
24851
24852         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24853
24854 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24855
24856         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24857         EmitContext during the instance constructor initializer
24858         resolution, to stop access to instance variables.
24859
24860         This is mandated by the spec, last paragraph of the `constructor
24861         initializers' section. 
24862
24863 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24864
24865         * cs-parser.jay, class.cs (Accessor): new class used to represent
24866         an accessor (get or set).  In the past we used `null' to represent
24867         a missing accessor.  But this is ambiguous because there was no
24868         way to tell in abstract indexers/properties if one of them was
24869         specified.
24870
24871         Now there is a way of addressing that.
24872
24873         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24874         instead of FindMembers.
24875
24876         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24877         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24878
24879         * attribute.cs: Treat indexers and properties as the same in terms
24880         of applying attributes
24881
24882         * ecore.cs (FindMostEncompassedType): Use statically initialized
24883         EmptyExpressions()s like we do elsewhere to avoid creating useless
24884         objects (and we take this out of the tight loop).
24885
24886         (GetConversionOperators): Move the code to extract the actual
24887         operators to a separate routine to clean things up.
24888
24889 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24890
24891         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24892         events are always registered FieldBuilders.
24893
24894         * class.cs (FieldBase): New class shared by Fields 
24895
24896         * delegate.cs: If we are a toplevel delegate, use our full name.
24897         If we are a nested delegate, then only use our tail name.
24898
24899 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24900
24901         * expression.cs (IsApplicable): Ensure that we add the "&" to
24902         ref/out types before comparing it with the type of the argument.
24903
24904         (IsParamsMethodApplicable): Ditto.
24905
24906         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24907         silly me ;-)
24908
24909         * delegate.cs : Handle the case when we have more than one applicable
24910         method. Flag an error only when we finish checking all.
24911
24912 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
24913
24914         * expression.cs: Add support for boolean static initializers.
24915
24916 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
24917
24918         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24919
24920         * parameter.cs (ComputeParameterTypes,
24921         ComputeAndDefineParameterTypes): Better error handling: now we
24922         clear the `types' cache if we fail during any of the type lookups.
24923         We also return the status code correctly to our caller
24924
24925         * delegate.cs: If we fail to define a delegate, abort the extra
24926         steps. 
24927
24928         * expression.cs (Binary.ResolveOperator): for
24929         operator==(object,object) and operator !=(object, object) we also
24930         have to verify that there is an implicit conversion from one to
24931         the other.
24932
24933         (ArrayAccess.DoResolve): Array Access can operate on
24934         non-variables. 
24935
24936 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
24937
24938         * assign.cs (CompoundAssign): A new class used as a "flag" that
24939         the assignment actually is happening as part of a compound
24940         assignment operator.
24941
24942         During compound assignment, a few new rules exist to enable things
24943         like:
24944
24945         byte b |= 1 + 2
24946
24947         From the spec:
24948
24949         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24950         to the type of x) if y is implicitly convertible to the type of x,
24951         and the operator is a builtin operator and the return type of the
24952         operator is explicitly convertible to the type of x. 
24953
24954         * rootcontext.cs: Reset warning level to 2.  4 catches various
24955         "interesting" features in mcs, we must clean this up at some
24956         point, but currently am trying to kill other bugs ;-)
24957
24958         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24959         in container classes as well.  
24960
24961         * expression.cs (Binary.ResolveOperator): Handle string case
24962         before anything else (as operator overloading does emit an error
24963         before doing anything else).
24964
24965         This code could go away when we move to a table driven model, but
24966         i could not come up with a good plan last night.
24967
24968 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
24969
24970         * typemanager.cs (CSharpName): reimplementation using regex.
24971         * class.cs: added null check for fields in Emit
24972         * rootcontext.cs: set warninglevel to 4
24973
24974 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
24975
24976         * typemanager.cs (CSharpName): reimplemented with Lupus
24977         suggestion.
24978
24979 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
24980
24981         * statement.cs (If): correclty implement Resolve, because we were
24982         not catching sem errors in there.  The same process is needed
24983         everywhere else. 
24984         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24985
24986
24987         (Statement.Warning_DeadCodeFound): Factorize code.
24988         (While): Report dead code here too.
24989
24990         (Statement): Added Resolve virtual method to allow
24991         for resolution split from the emit code.
24992
24993 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24994
24995         * statement.cs (EmitBoolExpression): No longer try to resolve the
24996         expression here.    
24997         (MakeBoolean): New utility function that resolve, implicitly
24998         converts to boolean and tags the expression. 
24999
25000
25001         (If, Do): Implement dead code elimination.
25002         (While): Implement loop inversion
25003
25004         (Do, While, For, If): Resolve the expression prior to calling our
25005         code generation.
25006
25007 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25008
25009         * class.cs:
25010           - added method Report28 (warning: program has more than one entry point)
25011           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25012           - modified method Method.Define, the part at the end of the method
25013
25014         * rootcontext.cs: added static public Location EntryPointLocation;
25015           
25016         * ../errors/cs0028.cs : Add test case for the above warning.              
25017
25018         * typemanager.cs:
25019           - modified method CSharpName to allow arrays of primitive type to
25020             be printed nicely (e.g. instead of System.Int32[][] it now prints
25021             int[][])
25022           - added method CSharpSignature: returns the signature of a method
25023             in string format to be used in reporting errors, warnings, etc.
25024
25025         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25026         with String.Empty.
25027
25028 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25029
25030         * delegate.cs (Define): Fix extremely silly bug where I was
25031         setting the type of the 'object' parameter of the BeginInvoke
25032         method to System.IAsyncResult instead of System.Object ;-)
25033
25034 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25035
25036         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25037         here. 
25038
25039         (Constructor.Emit): return if we fail to initialize the
25040         constructor.  Another door closed!  
25041
25042         * expression.cs (New.DoResolve): Improve error message (from -6 to
25043         1501).  Use DeclaredOnly lookup to find the exact constructor.
25044
25045         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25046         loop.  This is useful.
25047
25048         * cs-parser.jay: Adjust the default parameters so that destructors
25049         have the proper signature.
25050
25051 2002-04-26  Martin Baulig  <martin@gnome.org>
25052
25053         * driver.cs (LoadAssembly): If `assembly' contains any characters
25054         which are only valid in path names and not in assembly names
25055         (currently slash, backslash and point), use Assembly.LoadFrom ()
25056         instead of Assembly.Load () on the `assembly' (before iteration
25057         over the link_paths).
25058
25059 2002-04-26  Martin Baulig  <martin@gnome.org>
25060
25061         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25062
25063 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25064
25065         * class.cs (Property): use the new typemanager.MemberLookup
25066
25067         (TypeContainer.MemberLookup): Implement using the
25068         TypeManager.MemberLookup now. 
25069
25070         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25071         and return MemberInfos, so that these can be used without an
25072         EmitContext (what we had before).
25073
25074 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25075
25076         * expression.cs: Fix the case where the argument to params if the
25077         type of the params.  I omitted handling this before.   Fixed
25078
25079 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25080
25081         * driver.cs: Call BootCorlib_PopulateCoreType
25082
25083         * class.cs (Property.CheckBase): Check for properties only, not
25084         for all members. 
25085
25086         * interface.cs: Temporary hack: try/catch around the
25087         CustomAttributeBuilder, because I am getting an exception that I
25088         do not understand.
25089
25090         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25091         types whose definitions are required to be there (attributes are
25092         defined before standard types).
25093
25094         Compute definitions as we boot the various types, as they are used
25095         immediately (value_type class will need object_type, but if we do
25096         not initialize object_type, we will pass a null, which will let
25097         the runtime pick the System.Object from the existing corlib, which
25098         is not what we want).
25099
25100 2002-04-22  Patrik Torstensson <totte@labs2.com>
25101
25102         * cs-tokenizer.cs: fixed a number of trim() issues.
25103
25104 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25105
25106         * expression.cs (Argument.Type): Ensure that we return the correct
25107         type when we have out or ref parameters [in which case we 
25108         append a "&"].
25109
25110 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25111
25112         * class.cs (Property, Indexer): Allow extern modifier in there. 
25113
25114         * typemanager.cs (InitBaseTypes): Initializes object_type and
25115         value_type, since those will be used early on during the bootstrap
25116         process to compile corlib.
25117
25118         (InitCoreTypes): Move code from here to InitBaseTypes.
25119
25120 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25121
25122         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25123         single-dimension arrays as using the ldlen opcode.  
25124
25125         Daniel Lewis discovered this optimization.  
25126
25127         * typemanager.cs: Add signature for System.Array::get_Length
25128
25129 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25130
25131         * statement.cs: report the error when the foreach does not apply to an
25132         array nor a collection.
25133
25134 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25135
25136         * expression.cs: Add implicit conversions to the operator ~.
25137
25138         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25139
25140         * typemanager.cs: Locate the decimal constructor.
25141
25142 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25143
25144         * attribute.cs: use the new property of TypeOf.
25145         * expression.cs: added 'get' property around typearg.
25146
25147         These changes fix a build breaker reported by NickD. Is this the
25148         correct way to fix?  If not, please, revert my changes and make it
25149         work :-).
25150
25151 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25152
25153         * attribute.cs: Add support for typeof in attribute invocations.
25154         I am not sure that this is right though.
25155
25156 2002-04-14  Duncan Mak  <duncan@ximian.com>
25157
25158         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25159         Binary.Operator.Division case.
25160
25161 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25162
25163         * class.cs (DefineType): Ensure that we do a proper check on
25164         attribute types and also register it with the TypeManager.
25165
25166         (TypeContainer.Targets): The default for attribute types is
25167         AttributeTargets.All.
25168
25169         * attribute.cs (ApplyAttributes): Registering the attribute type
25170         is done elsewhere, not when we discover we have a Usage attribute.
25171
25172 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25173
25174         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25175         and get rid of is_delegate parameter.
25176
25177         * everywhere : update.
25178
25179 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25180
25181         * cs-parser.jay (compilation_unit): Revamp completely to use
25182         some new ideas that I got from Rhys' grammar to solve the problems
25183         with assembly level attributes.
25184
25185         (outer_declaration): New grammar production.
25186
25187         (attribute_sections): Add.
25188
25189         (opt_attributes): Base on attribute_sections
25190
25191         (namespace_declaration): Allow opt_attributes to tackle the case
25192         when we have assembly level attributes - we are clever in this
25193         regard now ;-)
25194
25195         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25196         attributes in the non-global context.
25197
25198         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25199         instead of SetGlobalAttributes.
25200
25201         * class.cs, rootcontext.cs : Ensure we define and generate 
25202         attribute types before anything else.
25203
25204         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25205         and flag the new error -20 for the case when the attribute type
25206         does not have valid targets specified. csc does not catch this.
25207
25208         * ../errors/errors.txt : update for error # -20
25209
25210 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25211
25212         * support.cs (InternalParameters.ParameterModifier): Do some null
25213         checking and return sane values.
25214
25215         * class.cs (Method.Define): If we are a PInvoke method, ensure
25216         that we are static and extern. Report error # 601
25217
25218         * ../errors/cs0601.cs : Add test case for the above error.
25219
25220 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25221
25222         * rootcontext.cs (attribute_types): We need to keep type of
25223         all attribute types separately and emit code for them first.
25224
25225         (RegisterAttribute) : Implement.
25226
25227         * class.cs (DefineType): Check if the current Type is a custom
25228         attribute type and register it accordingly.
25229
25230         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25231         adding the first attribute twice and rename to
25232
25233         (SetGlobalAttributes): this.
25234
25235         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25236         lookups.
25237
25238         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25239         if we are processing global arguments. Hmm, I am unsure of this.
25240
25241 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25242
25243         * expression.cs: added static array of strings to avoid calling
25244         Enum.ToString () for Operator in Binary. Significant recover of
25245         performance.
25246
25247 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
25248
25249         * class.cs (FindMembers): Allow the Builders of the various
25250         members to be null.  If they are skip them.  This only happens
25251         during the PInvoke declaration.
25252
25253 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
25254
25255         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25256         failure, so we do not keep going afterwards.
25257
25258         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25259         wanted to pass `false' as the `is_delegate' argument.  If this is
25260         the case, why not use delegate_type == null to mean `is_delegate =
25261         false' and anything else as is_delegate = true.
25262
25263 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
25264
25265         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25266         code for the section, not the beginning of the tests.
25267
25268 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25269
25270         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25271
25272         * expression.cs (Binary): same.  Warn about errors where we have
25273         Enum/Enum in operator + as well.
25274
25275 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25276
25277         * statement.cs:
25278                 - added support for switch(bool)
25279                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25280                 - add TableSwitchEmit() to handle table-based switch statements
25281
25282 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25283
25284         * expression.cs (Invocation.OverloadResolve): Factor out code which
25285         does parameter compatibility checking with arguments so that we can 
25286         re-use the code even from Delegate.VerifyApplicability
25287
25288         (VerifyArgumentsCompat): Move above code here.
25289
25290         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25291         and instead make a call to the above method.
25292
25293 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25294
25295         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25296         We use it to keep track of classes which are attribute types.
25297
25298 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25299
25300         * delegate.cs (Delegate.Define): Correctly define the types in the
25301         presence of fixed and array parameters.
25302
25303         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25304         doing FindMembers.
25305
25306         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25307         include NonPublic after the first iteration.
25308
25309         * class.cs (Indexer.CheckBase): Only check if both parents are
25310         non-null. 
25311
25312         * cs-parser.jay (accessor_body): If empty, set to null.
25313
25314         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25315         same code path here to resolve constants names that we did have in
25316         MemberAccess.DoResolve.  There is too much code duplicated here.
25317
25318 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25319
25320         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25321
25322         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25323         to MakeUnionSet.
25324
25325         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25326         tokens, numbers and strings.
25327
25328         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25329         parenthesis.
25330
25331         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25332         asyncronous parameters and the regular parameters.  
25333
25334         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25335         specify the target directory.
25336
25337         * expression.cs: (This.DoResolve): Simplify
25338         (As.Emit): Optimize, do not generate IsInst if the expression is
25339         always of the given type.
25340
25341         (Is.DoResolve): Bug fix, we were reporting both always/never for
25342         the is expression.
25343
25344         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25345         creating too many unnecessary arrays.
25346
25347 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25348
25349         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25350         fields instead of rolling our own initializer.   Takes care of all
25351         implicit conversions, and drops unnecessary static checks/argument.
25352
25353 2002-03-31  Dick Porter  <dick@ximian.com>
25354
25355         * driver.cs: use the GetDirectories() return values properly, and
25356         use "/" as path separator.
25357
25358 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25359
25360         * expression.cs (Unary): Optimize - - expr into expr.
25361         (Binary): Optimize a + (-b) into a -b.
25362
25363         * codegen.cs (CodeGen): Made all methods static.
25364
25365 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25366
25367         * rootcontext.cs: 
25368
25369         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25370         TypeBuilder property.
25371
25372         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25373         instead. 
25374
25375         * tree.cs: Removed the various RecordXXXX, and replaced with a
25376         single RecordDecl.  Removed all the accessor methods, and just
25377         left a single access point Type 
25378
25379         * enum.cs: Rename DefineEnum to DefineType.
25380
25381         * decl.cs: New abstract method `DefineType' used to unify the
25382         Defines for Enumerations, Interfaces, TypeContainers and
25383         Delegates.
25384
25385         (FindType): Moved LookupInterfaceOrClass here.  Moved the
25386         LookupBaseClasses method that used to live in class.cs and
25387         interface.cs here, and renamed to FindType.
25388
25389         * delegate.cs: Implement DefineType.  Take advantage of the
25390         refactored pattern for locating the parent builder without taking
25391         the parent_builder argument (which we know does not work if we are
25392         nested, and triggering a toplevel definition).
25393
25394 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25395
25396         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25397         accessibility of a member has changed during override and report
25398         an error if so.
25399
25400         * class.cs (Method.Define, Property.Define): Only complain on
25401         overrides if the method is private, any other accessibility is
25402         fine (and since we just checked the permission is the same, we are
25403         good to go).
25404
25405         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25406         and elif are processed always.  The other pre-processing
25407         directives are only processed if we are "taking" the path
25408
25409 2002-03-29  Martin Baulig  <martin@gnome.org>
25410
25411         * class.cs (Method.Emit): Only emit symbolic debugging info if the
25412         current location is not Null.
25413
25414         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25415         a separate method so we can profile it.
25416
25417         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25418         `span.Seconds' are just seconds, but no minutes or hours.
25419         (MainDriver): Profile the CodeGen.SaveSymbols calls.
25420
25421 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25422
25423         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25424         Remove the gratuitous set of Final:
25425
25426                                 // If an interface implementation, then we can set Final.
25427                                 if (((flags & MethodAttributes.Abstract) == 0) &&
25428                                     implementing.DeclaringType.IsInterface)
25429                                         flags |= MethodAttributes.Final;
25430
25431         I do not know what I was smoking when I used that.
25432
25433
25434         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25435         step into fixing the name resolution issues for delegates and
25436         unifying the toplevel name resolution.
25437
25438 2002-03-28  Martin Baulig  <martin@gnome.org>
25439
25440         * class.cs (Method.Emit): If we have a symbol writer, call its
25441         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25442         tell it about the current method.
25443
25444         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25445         writer that we're going to emit the first byte of IL code for a new
25446         statement (a new source line).
25447         (EmitContext.EmitTopBlock): If we have a symbol writer, call
25448         EmitContext.Mark() before emitting any code.
25449
25450         * location.cs (SymbolDocument): Return null when we're Null.
25451
25452         * statement.cs (Statement): Moved the `Location loc' variable here.
25453         (Statement.EmitBoolExpression): If we have a symbol writer, call
25454         ec.Mark() before emitting any code to tell it that we're at the
25455         beginning of a new statement.
25456         (StatementExpression): Added `Location' argument to the constructor.
25457         (Block): Added public readonly variable `StartLocation' and public
25458         variable `EndLocation'.  The latter is to be set using SetEndLocation().
25459         (Block): Added constructor which takes a start and end location.
25460         (Block.SetEndLocation): New method. This sets the end location.
25461         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25462         local variables we create.
25463         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25464         each statement and do also mark the begin and end of the block.
25465
25466         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25467         tell it the current lexer.Location, use Location.Null for the end of the
25468         block.
25469         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25470         current block, set its end location using SetEndLocation().
25471         (statement_expression): StatementExpression constructor now takes the
25472         lexer.Location as additional argument.
25473         (for_statement, declare_local_variables): Likewise.
25474         (declare_local_variables): When creating a new implicit block, use the
25475         new Block constructor and pass it the lexer.Location.
25476
25477 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25478
25479         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25480         members also on the parent interfaces recursively.
25481
25482 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
25483
25484         * report.cs: Use new formats, since Gonzalo finished the missing
25485         bits. 
25486
25487         * expression.cs (Binary.ResolveOperator): added missing operator|
25488         operator& and operator^ for bool/bool.
25489
25490         * cs-parser.jay: CheckDef now takes a Location argument that is
25491         used to report errors more precisly (instead of reporting the end
25492         of a definition, we try to track something which is a lot closer
25493         to the source of the problem).
25494
25495         * cs-tokenizer.cs: Track global token use, so we can properly flag
25496         the use of #define/#undef after the first token has been seen.
25497
25498         Also, rename the reportXXXX to Error_DescriptiveName
25499
25500         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25501         TypeContainer, so that Enum and Interface can use this too.
25502
25503         * class.cs (TypeContainer.LookupInterfaceOrClass,
25504         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25505         `builder' argument.  Typically this was used to pass the parent
25506         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25507         the definition).  
25508
25509         The problem is that a nested class could trigger the definition of
25510         a toplevel class, and the builder would be obviously wrong in that
25511         case. 
25512
25513         So we drop this argument, and we compute dynamically the
25514         TypeBuilder/ModuleBuilder (the correct information was available
25515         to us anyways from DeclSpace.Parent)
25516
25517         * interface.cs (Interface.DefineInterface): Drop builder
25518         parameter cleanup like class.cs
25519
25520         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25521         like class.cs
25522
25523         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25524         values. 
25525
25526         (Try.Emit): Propagate the returns value from the statement.
25527
25528         (Return.Emit): Even if we are leavning 
25529
25530         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25531
25532         * modifiers.cs: Fix the computation of MethodAttributes flags.
25533
25534 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25535
25536         * driver.cs: allow compilation of files that start with '/'.
25537         Add a default case when checking the argument of --target.
25538
25539 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25540
25541         * interface.cs: Implement the same search algorithm for types in
25542         the interface code.
25543
25544         * delegate.cs: Do not allow multiple definition.
25545
25546         * Recovered ChangeLog that got accidentally amputated
25547
25548         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25549
25550         * rootcontext.cs: Load manually enum to allow core classes to
25551         contain enumerations.
25552
25553         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25554         Update to new static methods in TypeManager.
25555
25556         * typemanager.cs (GetMethod, GetConstructor): Use our
25557         implementation of FindMembers to find the members, since during
25558         corlib compilation, the types are TypeBuilders and GetMethod and
25559         GetConstructor do not work.
25560
25561         Make all methods in TypeManager static.
25562
25563         (InitCodeHelpers): Split the functionality from
25564         the InitCodeTypes function.
25565
25566         * driver.cs: Call InitCodeHelpers after we have populated the
25567         types. 
25568
25569         * cs-parser.jay (delegate_declaration): we did not used to compute
25570         the delegate name correctly for void delegates.
25571
25572 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25573
25574         * rootcontext.cs (RootContext): Init the interface_resolve_order
25575         and type_container_resolve_order always.
25576
25577         (ResolveCore, BootstrapCorlib_ResolveClass,
25578         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25579         compiler when compiling with --nostdlib
25580
25581         * class.cs (TypeContainer.DefineType): Check that our parent is
25582         not null.  This test is most important when we are bootstraping
25583         the core types.
25584
25585         * codegen.cs: Split out the symbol writing code.
25586
25587 2002-03-25  Martin Baulig  <martin@gnome.org>
25588
25589         * driver.cs (-g): Made -g an alias for --debug.
25590
25591 2002-03-24  Martin Baulig  <martin@gnome.org>
25592
25593         * codegen.cs (SymbolWriter): New public variable. Returns the
25594         current symbol writer.
25595         (CodeGen): Added `bool want_debugging_support' argument to the
25596          constructor. If true, tell the ModuleBuild that we want debugging
25597         support and ask it for the ISymbolWriter.
25598         (Save): If we have a symbol writer, call it's Close() method after
25599         saving the assembly.
25600
25601         * driver.c (--debug): New command line argument to create a
25602         debugger information file.
25603
25604         * location.cs (SymbolDocument): New public property. Returns an
25605         ISymbolDocumentWriter object for the current source file or null
25606         if we don't have a symbol writer.
25607
25608 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25609
25610         * driver.cs (LoadAssembly): Correctly return when all the paths
25611         have been tried and not before.
25612
25613         * statement.cs (Switch.Emit): return the actual coverage for this
25614         statement (returns/not-returns)
25615
25616         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25617         switch of the statement if we are the last switch section.  That
25618         kills two problems: try/catch problems (we used to emit an empty
25619         nop at the end) and switch statements where all branches would
25620         return. 
25621
25622 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25623
25624         * driver.cs: Add default assemblies (the equivalent to the
25625         Microsoft CSC.RSP file)
25626
25627         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25628         also update tokens_seen and set it to false.
25629
25630         * driver.cs: Implement --recurse for Mike.
25631
25632         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25633         correctly splitting out the paths.
25634
25635 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25636
25637         * interface.cs (Interface.PopulateProperty): Instead of using
25638         `parent' as the declaration space for the set parameters, use
25639         `this' 
25640
25641         * support.cs (InternalParameters): InternalParameters constructor
25642         takes a DeclSpace instead of a TypeContainer.
25643
25644         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25645         types are being initialized, load the address of it before calling
25646         the function.  
25647
25648         (New): Provide a mechanism to disable the generation of local
25649         value type temporaries when the caller will be providing us with
25650         an address to store it.
25651
25652         (ArrayCreation.EmitDynamicInitializers): Use it.
25653
25654 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25655
25656         * expression.cs (Invocation.EmitArguments): Only probe for array
25657         property if there is more than one argument.  Sorry about that.
25658
25659         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25660         empty param arrays.
25661
25662         * class.cs (Method.LabelParameters): Fix incorrect code path that
25663         prevented the `ParamArrayAttribute' from being applied to the
25664         params attribute.
25665
25666 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25667
25668         * support.cs (ReflectionParameters): Correctly compute whether the
25669         last argument is a params array.  Fixes the problem with
25670         string.Split ('a')
25671
25672         * typemanager.cs: Make the assemblies array always be non-null
25673         (empty, but non-null)
25674
25675         * tree.cs (RecordDecl): New function that abstracts the recording
25676         of names.  This reports error 101, and provides a pointer to the
25677         previous declaration.  Fixes a crash in the compiler.
25678
25679         * cs-parser.jay (constructor_declaration): Update to new grammar,
25680         and provide a constructor_body that can be empty.
25681
25682 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25683
25684         * driver.cs: Add support for --resources.
25685
25686         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25687         Make all types for the various array helper methods be integer.
25688
25689         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25690         CheckState to ConvCast.
25691
25692         (ConvCast): Now it takes a `checked' state argument, to avoid
25693         depending on the emit context for the conversion, and just using
25694         the resolve time setting.
25695
25696         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25697         instead of Invocation.EmitArguments.  We do not emit the original
25698         arguments, instead we emit those which have been converted to
25699         unsigned int expressions.
25700
25701         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25702
25703         * codegen.cs: ditto.
25704
25705         * expression.cs (LocalVariableReference): Drop the use of the
25706         Store function that depended on the variable index.
25707
25708         * statement.cs (VariableInfo): Drop the `Idx' property from this
25709         class, as this is not taking into account the indexes for
25710         temporaries tat we generate during the execution, getting the
25711         indexes wrong.
25712
25713         * class.cs: First emit class initializers, then call the parent
25714         constructor. 
25715
25716         * expression.cs (Binary): Fix opcode emision.
25717         (UnaryMutator.EmitCode): Support checked code generation
25718
25719         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25720         matches for events for both the Static and Instance scans,
25721         pointing to the same element.   Fix that.
25722
25723 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25724
25725         * rootcontext.cs (ResolveTree): Always set the
25726         interface_resolve_order, because nested interfaces will be calling
25727         into us.
25728
25729         * class.cs (GetInterfaceOrClass): Track the same resolution
25730         process used by TypeManager.LookupType.  This fixes the nested
25731         type lookups in class declarations (separate path from
25732         LookupType). 
25733
25734         (TypeContainer.DefineType): Also define nested interfaces.
25735         (TypeContainer.RegisterOrder): New public function used to
25736         register the order in which child interfaces need to be closed.
25737
25738         Nested interfaces need to be closed after their parents have been
25739         created. 
25740
25741         * interface.cs (InterfaceAttr): Put all the logic for computing
25742         the interface attribute here. 
25743
25744         (DefineInterface): Register our interface order with the
25745         RootContext or with the TypeContainer depending on the case.
25746
25747 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25748
25749         * cs-parser.jay: rework foreach statement to work with the new
25750         changes to the policy on SimpleNames.
25751
25752         * report.cs: support Stacktrace on warnings as well.
25753
25754         * makefile: drop --unsafe and /unsafe from the compile.
25755
25756 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25757
25758         * ecore.cs (StandardConversionExists): Modify to take an Expression
25759         as the first parameter. Ensure we do null -> reference type conversion
25760         checking.
25761
25762         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25763         temporary Expression objects.
25764
25765 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25766
25767         * interface.cs: workaround bug in method overloading resolution
25768         (there is already a bugzilla bug for it).
25769
25770 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25771
25772         We could also solve this problem by having a separate path for
25773         performing type lookups, instead of DoResolve, we could have a
25774         ResolveType entry point, and only participating pieces of the
25775         production (simplename, deref, array) would implement this. 
25776
25777         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25778         signal SimpleName to only resolve type names and not attempt to
25779         resolve anything else.
25780
25781         * expression.cs (Cast): Set the flag.
25782
25783         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25784
25785         * class.cs: Only report 108 if there is no `new' modifier.
25786
25787         * cs-parser.jay: rework foreach statement to work with the new
25788         changes to the policy on SimpleNames.
25789
25790         * report.cs: support Stacktrace on warnings as well.
25791
25792         * makefile: drop --unsafe and /unsafe from the compile.
25793
25794 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25795
25796         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25797         lookups here, instead of doing that at parse time.  This means
25798         that our grammar will not introduce `LocalVariableReferences' as
25799         expressions at this point.  That solves the problem of code like
25800         this:
25801
25802         class X {
25803            static void Main ()
25804            { int X = 1;
25805             { X x = null }}}
25806
25807         This is only half the fix.  The full fix requires parameters to
25808         also be handled in this way.
25809
25810         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25811         makes the use more obvious of the DeclSpace.  The
25812         ec.TypeContainer.TypeBuilder is now only used to pull the
25813         TypeBuilder for it.
25814
25815         My theory is that I can get rid of the TypeBuilder completely from
25816         the EmitContext, and have typecasts where it is used (from
25817         DeclSpace to where it matters).  
25818
25819         The only pending problem is that the code that implements Aliases
25820         is on TypeContainer, and probably should go in DeclSpace.
25821
25822         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25823         lookups here, instead of doing that at parse time.  This means
25824         that our grammar will not introduce `LocalVariableReferences' as
25825         expressions at this point.  That solves the problem of code like
25826         this:
25827
25828         class X {
25829            static void Main ()
25830            { int X = 1;
25831             { X x = null }}}
25832
25833         This is only half the fix.  The full fix requires parameters to
25834         also be handled in this way.
25835
25836         * class.cs (Property.DefineMethod): When implementing an interface
25837         method, set newslot, when implementing an abstract method, do not
25838         set the flag (before we tried never setting it, or always setting
25839         it, which is the difference).
25840         (Indexer.DefineMethod): same.
25841         (Method.DefineMethod): same.
25842
25843         * ecore.cs: Only set the status used flag if we get back a Field.
25844
25845         * attribute.cs: Temporary hack, so Paolo can keep working.
25846
25847 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25848
25849         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25850         the unmanaged type in the case we have a MarshalAs attribute.
25851
25852         (Resolve): Handle the case when we are parsing the special MarshalAs
25853         attribute [we need to store the unmanaged type to use later]
25854
25855         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25856         MarshalAs Attribute.
25857
25858         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25859         on parameters and accordingly set the marshalling info.
25860
25861 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25862
25863         * class.cs: Optimizing slightly by removing redundant code after
25864         we switched to the `NoTypes' return value.
25865         (Property.DefineMethod): use NoTypes here too.
25866
25867         This fixes the bug I introduced in my last batch of changes.
25868
25869 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25870
25871         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25872
25873         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25874         Enums since those are types too. 
25875
25876         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25877
25878         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25879         thanks to a call during the lookup process.
25880
25881 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25882
25883         * statement.cs (Foreach): Lots of work to accomodate a particular
25884         kind of foreach statement that I had not kept in mind.  It is
25885         possible to have foreachs on classes that provide a GetEnumerator
25886         method that return objects that implement the "pattern" for using
25887         a foreach, there is no need to support GetEnumerator
25888         specifically. 
25889
25890         This is needed to compile nant.
25891
25892         * decl.cs: Only report 114 if the member is not `Finalize' and if
25893         the warning level is at least 2.
25894
25895         * class.cs: Moved the compare function from Method to
25896         MethodSignature. 
25897
25898         (MethodSignature.InheritableMemberSignatureCompare): Add new
25899         filter function that is used to extract inheritable methods from a
25900         class. 
25901
25902         (Method.Define): Use the new `inheritable_method_signature_filter'
25903         delegate
25904
25905         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25906         command. 
25907
25908 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25909
25910         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25911
25912         * cs-parser.jay: Add opt_semicolon to the interface declaration.
25913
25914         * expression.cs: Pass location information to
25915         ConvertImplicitStandard. 
25916
25917         * class.cs: Added debugging code to track return values from
25918         interfaces. 
25919
25920 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
25921
25922         * expression.cs (Is.DoResolve): If either side of the `is' is an
25923         interface, do not flag the warning.
25924
25925         * ecore.cs (ImplicitReferenceConversion): We need a separate test
25926         for interfaces
25927
25928         * report.cs: Allow for --fatal to be used with --probe.
25929
25930         * typemanager.cs (NoTypes): Move the definition for the empty Type
25931         array here. 
25932
25933         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25934         properties. 
25935         (TypeContainer.DefineProxy): New function used to proxy to parent
25936         implementations when implementing interfaces.
25937         (TypeContainer.ParentImplements): used to lookup if our parent
25938         implements a public function that is required by an interface.
25939         (TypeContainer.VerifyPendingMethods): Hook this up.
25940
25941         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25942         `modules' and `assemblies' arraylists into arrays.  We only grow
25943         these are the very early start up of the program, so this improves
25944         the speedof LookupType (nicely measured).
25945
25946         * expression.cs (MakeByteBlob): Replaced unsafe code with
25947         BitConverter, as suggested by Paolo.
25948
25949         * cfold.cs (ConstantFold.Binary): Special case: perform constant
25950         folding of string concatenation, but if either side is a string,
25951         and the other is not, then return null, and let the runtime use
25952         the concatenation on the string plus the object (using
25953         `Object.ToString'). 
25954
25955 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
25956
25957         Constant Folding has been implemented now.
25958
25959         * expression.cs (Unary.Reduce): Do not throw an exception, catch
25960         the error instead on types that are not supported in one's
25961         complement. 
25962
25963         * constant.cs (Constant and all children): New set of functions to
25964         perform implict and explicit conversions.
25965
25966         * ecore.cs (EnumConstant): Implement the new functions to perform
25967         conversion by proxying to the child expression.
25968
25969         * codegen.cs: (ConstantCheckState): Constant evaluation has its
25970         own separate setting that can not be turned off from the command
25971         line using --unchecked or --checked and is only controlled using
25972         the checked/unchecked statements and expressions.  This setting is
25973         used by the constant folder to flag errors.
25974
25975         * expression.cs (CheckedExpr, UncheckedExpr): Set the
25976         ConstantCheckState as well.   
25977
25978         During Resolve, they also have to flag the state, because the
25979         constant folder runs completely in the Resolve phase.
25980
25981         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25982         well.
25983
25984 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25985
25986         * cfold.cs: New file, this file contains the constant folder.
25987
25988         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25989         argument to track whether we are using the resulting address to
25990         load or store a value and provide better error messages. 
25991
25992         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25993         new AddressOf arguments.
25994
25995         * statement.cs (Foreach.EmitCollectionForeach): Update
25996
25997         * expression.cs (Argument.Emit): Call AddressOf with proper
25998         arguments to track usage.
25999
26000         (New.DoEmit): Call AddressOf with new arguments.
26001
26002         (Unary.Emit): Adjust AddressOf call.
26003
26004 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26005
26006         * cs-parser.jay (member_access): Change the case for pre-defined types
26007         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26008         this suggestion.
26009
26010         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26011         a method body.
26012
26013         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26014         essentially like methods and apply attributes like MethodImplOptions to them too.
26015
26016         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26017         not being null.
26018
26019         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26020         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26021         is the DeclSpace.
26022
26023         * Update code everywhere accordingly.
26024
26025         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26026
26027         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26028
26029 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26030
26031         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26032         try performing lookups against those instead of jumping straight into using
26033         the 'using' clauses.
26034
26035         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26036
26037         (LookupType): Perform lookups in implicit parents too.
26038
26039         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26040         sequence as RootContext.LookupType. 
26041
26042         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26043         the various cases of namespace lookups into this method.
26044
26045 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26046
26047         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26048         in positional arguments)
26049
26050         * class.cs (Operator): Update the AllowedModifiers to contain
26051         extern. 
26052
26053         * cs-parser.jay: Update operator declaration to allow for the
26054         operator body to be empty.
26055
26056         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26057         values. 
26058
26059 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26060
26061         * class.cs (Method.Emit): Label parameters.
26062
26063         * driver.cs: Return 1 or 0 as the program exit code.
26064
26065 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26066
26067         * expression.cs: Special case the `null' object when trying to
26068         auto-compute the type, as anything can be explicitly converted to
26069         that. 
26070
26071         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26072         spotting this Paolo.
26073
26074         (Expression.ImplicitNumericConversion): Perform comparissions of
26075         the type using the underlying type in the case of an enumeration
26076         rather than using the enumeration type for the compare.
26077
26078         Cope with the underlying == type case, which is not possible to
26079         catch before. 
26080
26081         (Expression.ConvertNumericExplicit): Perform comparissions of
26082         the type using the underlying type in the case of an enumeration
26083         rather than using the enumeration type for the compare.
26084
26085         * driver.cs: If the user does not supply an extension, assume .exe
26086
26087         * cs-parser.jay (if_statement): Rewrote so that we can track the
26088         location for the if statement.
26089
26090         * expression.cs (Binary.ConstantFold): Only concat strings when
26091         the operation is "+", not everything ;-)
26092
26093         * statement.cs (Statement.EmitBoolExpression): Take a location
26094         argument. 
26095         (If, While, Do): Track location.
26096
26097         * expression.cs (Binary.ResolveOperator): In the object + string
26098         case, I was missing a call to ConvertImplicit
26099
26100 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26101
26102         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26103         Location arguments. Ensure we use RootContext.LookupType to do our work
26104         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26105
26106         * interface.cs (PopulateMethod): Handle the type of the parameter being
26107         null gracefully.
26108
26109         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26110         have a params method with no fixed arguments and a call is made with no
26111         arguments.
26112
26113 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26114
26115         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26116         the verbatim-string-literal
26117
26118         * support.cs (InternalParameters.ParameterModifier): handle null
26119         fixed parameters.
26120         (InternalParameters.ParameterType): ditto.
26121
26122         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26123         duplicating the name of the variable parameter.
26124         (GetParameterByName): Fix bug where we were not looking up array
26125         paramters if they were the only present (thanks Paolo!).
26126         (GetParameterInfo): We only have an empty set of types if both
26127         fixed and array are set to null.
26128         (GetParameterInfo-idx): Handle FixedParameter == null
26129
26130         * cs-parser.jay: Handle the case where there is no catch
26131         statements (missing null test).
26132
26133 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26134
26135         * driver.cs (MainDriver): Be conservative on our command line
26136         handling.
26137
26138         Catch DirectoryNotFoundException when calling GetFiles.
26139
26140         (SplitPathAndPattern): Used to split the input specification into
26141         a path and a pattern that we can feed to Directory.GetFiles.
26142
26143 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26144
26145         * statement.cs (Fixed): Implement the last case of the Fixed
26146         statement (string handling).
26147
26148         * expression.cs (StringPtr): New class used to return a char * to
26149         a string;  Used by the Fixed statement.
26150
26151         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26152
26153         * expression.cs (Binary.ResolveOperator): Remove redundant
26154         MemberLookup pn parent type.
26155         Optimize union call, we do not need a union if the types are the same.
26156         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26157         type.
26158
26159         Specialize the use of MemberLookup everywhere, instead of using
26160         the default settings. 
26161
26162         (StackAlloc): Implement stackalloc keyword.
26163
26164         * cs-parser.jay: Add rule to parse stackalloc.
26165
26166         * driver.cs: Handle /h, /help, /?
26167
26168         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26169         before we supported unsafe code.
26170
26171         * makefile: add --unsafe to the self compilation of mcs.
26172
26173 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26174
26175         * expression.cs (PointerArithmetic): New class that is used to
26176         perform pointer arithmetic.
26177         (Binary.Resolve): Handle pointer arithmetic
26178         Handle pointer comparission.
26179         (ArrayPtr): Utility expression class that is used to take the
26180         address of an array.
26181
26182         (ElementAccess): Implement array access for pointers
26183
26184         * statement.cs (Fixed): Implement fixed statement for arrays, we
26185         are missing one more case before we are done.
26186
26187         * expression.cs (Indirection): Implement EmitAssign and set the
26188         ExprClass to Variable.  This allows pointer dereferences to be
26189         treated as variables, and to have values assigned to them.
26190
26191         * ecore.cs (Expression.StoreFromPtr): New utility function to
26192         store values dereferencing.
26193
26194 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26195
26196         * expression.cs (Binary.ResolveOperator): Ensure that we are
26197         not trying to operate on a void type - this fixes the reported
26198         bug.
26199
26200         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26201         the parent implementation is sealed.
26202
26203         * ../errors/cs0239.cs : Add.
26204
26205         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26206
26207         * typemanager.cs (unverifiable_code_type): Corresponds to 
26208         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26209         which have unsafe code in them.
26210
26211         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26212         unsafe context.
26213
26214 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26215
26216         * cs-tokenizer.cs: Add support for @"litreal strings"
26217
26218         Make tokenizer accept pre-processor directives
26219         on any column (remove the old C-like limitation). 
26220
26221         * rootcontext.cs (EmitCode): Emit any global attributes.
26222         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26223
26224         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26225
26226         * cs-parser.jay: Add support for global attributes.  
26227
26228 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26229
26230         * expression.cs (Indirection): New helper class.  Unary will
26231         create Indirection classes to be able to implement the
26232         IMemoryLocation interface on it.
26233
26234 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26235
26236         * cs-parser.jay (fixed_statement): reference the right statement.
26237
26238         * statement.cs (Fixed.Emit): Finish implementing the fixed
26239         statement for the &x case.
26240
26241 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
26242
26243         * class.cs (Property.Define, Method.Define): Remove newslot when
26244         `implementing'.  
26245
26246         * modifiers.cs: My use of NewSlot when `Abstract' was set was
26247         wrong.  NewSlot should only be used if the `new' keyword is present.
26248
26249         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26250         locating our system dir.  Sorry about this.
26251
26252 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26253
26254         * driver.cs (GetSystemDir): Compute correctly the location of our
26255         system assemblies.  I was using the compiler directory instead of
26256         the library directory.
26257
26258 2002-02-13  Ravi Pratap  <ravi@ximian.com>
26259
26260         * expression.cs (BetterFunction): Put back in what Miguel commented out
26261         since it is the correct fix. The problem is elsewhere ;-)
26262
26263         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26264         parameters of the parms method are themselves compatible or not !
26265
26266         (StandardConversionExists): Fix very dangerous bug where we were forgetting
26267         to check that a class implements an interface before saying that an implicit
26268         conversion was allowed. Use ImplementsInterface to do the checking.
26269
26270 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26271
26272         * class.cs (Method.Define): Track whether we are an explicit
26273         implementation or not.  And only call DefineMethodOverride if we
26274         are an explicit implementation.
26275
26276         (Property.DefineMethod): Ditto.
26277
26278 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26279
26280         * expression.cs (BetterFunction): Catch hideous bug which was
26281          preventing us from detecting ambiguous calls due to implicit casts i.e
26282         cs0121.
26283
26284 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26285
26286         * support.cs (Pair): Remove un-needed method.  I figured why I was
26287         getting the error in cs-parser.jay, the variable in a foreach loop
26288         is readonly, and the compiler does not really treat this as a variable.
26289
26290         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26291         instead of EQUALS in grammar.  
26292
26293         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26294
26295         * expression.cs (Unary.DoResolve): Check whether the argument is
26296         managed or not.
26297
26298 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26299
26300         * support.cs: Api for Pair to set a value.  Despite the fact that
26301         the variables are public the MS C# compiler refuses to compile
26302         code that accesses the field if the variable is part of a foreach
26303         statement. 
26304
26305         * statement.cs (Fixed): Begin implementation of the fixed
26306         statement.
26307
26308         (Block.AddVariable): Return the VariableInfo on success and null
26309         on failure instead of true/false. 
26310
26311         * cs-parser.jay (foreach): Catch errors on variables already
26312         defined (we were ignoring this value before) and properly unwind
26313         the block hierarchy
26314
26315         (fixed_statement): grammar for the fixed statement.
26316
26317 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26318
26319         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26320         pointer types to be incretemented.
26321
26322         (SizeOf): Implement.
26323
26324         * cs-parser.jay (pointer_member_access): Implement
26325         expr->IDENTIFIER production.
26326
26327         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26328         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26329         on safe contexts.
26330
26331         (Unary): Implement indirection.
26332
26333         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26334         use in non-unsafe context).
26335
26336         (SimpleName.DoResolve): Check for pointers in field access on safe
26337         contexts. 
26338
26339         (Expression.LoadFromPtr): Factor the load-indirect code in this
26340         function.  This was duplicated in UnboxCast and ParameterReference
26341
26342 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26343
26344         * expression.cs (ComposedCast): report an error if a pointer cast
26345         is used in a safe region.
26346
26347         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26348         pointer type casts in unsafe context.
26349
26350         * codegen.cs (EmitContext): Set up IsUnsafe.
26351
26352         * cs-parser.jay (non_expression_type): Add productions for pointer
26353         casts. 
26354
26355         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26356         code.  We should not use force into static mode if the method is
26357         not virtual.  Fixes bug in MIS
26358
26359         * statement.cs (Do.Emit, While.Emit, For.Emit,
26360         Statement.EmitBoolExpression): Add support to Do and While to
26361         propagate infinite loop as `I do return' semantics.
26362
26363         Improve the For case to also test for boolean constants.
26364
26365         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26366         to the list of attributes we can add.
26367
26368         Remove `EmitContext' argument.
26369
26370         * class.cs (Method.Define): Apply parameter attributes.
26371         (Constructor.Define): Apply parameter attributes.
26372         (MethodCore.LabelParameters): Move here the core of labeling
26373         parameters. 
26374
26375         * support.cs (ReflectionParameters.ParameterModifier,
26376         InternalParameters.ParameterModifier): Use IsByRef on the type and
26377         only return the OUT bit for these parameters instead of in/out/ref
26378         flags.
26379
26380         This is because I miss-understood things.  The ParameterInfo.IsIn
26381         and IsOut represent whether the parameter has the [In] and [Out]
26382         attributes set.  
26383
26384 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
26385
26386         * ecore.cs (FieldExpr.Emit): Release temporaries.
26387
26388         * assign.cs (LocalTemporary.Release): new function.
26389
26390         * codegen.cs (EmitContext.GetTemporaryStorage,
26391         EmitContext.FreeTemporaryStorage): Rework the way we deal with
26392         temporary storage.  Now we can "put back" localbuilders when we
26393         are done with them
26394
26395 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
26396
26397         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26398         need to make a copy of the variable to generate verifiable code.
26399
26400 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
26401
26402         * driver.cs: Compute dynamically the system directory.
26403
26404         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26405         Slower, but more generally useful.  Used by the abstract
26406         registering implementation. 
26407
26408         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26409         the rules for the special rule on Type/instances.  First check if
26410         we have the same name, and if so, try that special static path
26411         rather than the instance path.
26412
26413 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
26414
26415         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26416         for, while and if.
26417
26418         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26419         Enum, ValueType, Delegate or Array for non-corlib compiles.
26420
26421         * cs-tokenizer.cs: Catch long identifiers (645)
26422
26423         * typemanager.cs (IndexerPropetyName): Ravi never tested this
26424         piece of code.
26425
26426         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26427         fix, we were returning too early, so we were not registering
26428         pending methods from abstract classes.
26429
26430         Do not register pending methods if the class is abstract.
26431
26432         * expression.cs (Conditional.DoResolve): Report circular implicit
26433         conversions when we neecd to compute it for conditional
26434         expressions. 
26435
26436         (Is.DoResolve): If the expression is always of the provided type,
26437         flag warning 183.  If the expression can not ever be of the
26438         provided type flag warning 184.
26439
26440         * class.cs: Catch 169 as well.
26441
26442         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26443         read. 
26444
26445 2002-01-18  Nick Drochak  <ndrochak@gol.com>
26446
26447         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
26448
26449 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
26450
26451         * interface.cs: (PopulateMethod): Check for pointers being defined
26452         only if the unsafe context is active.
26453         (PopulateProperty): ditto.
26454         (PopulateIndexer): ditto.
26455
26456         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26457         specified.  If pointers are present, make sure that they are
26458         present in an unsafe context.
26459         (Constructor, Constructor.Define): ditto.
26460         (Field, Field.Define): ditto.
26461         (Property, Property.Define): ditto.
26462         (Event, Event.Define): ditto.
26463
26464         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26465         hashtable if there are classes or structs defined.
26466
26467         * expression.cs (LocalVariableReference.DoResolve): Simplify this
26468         code, as the constant resolution moved.
26469
26470         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26471         the metadata, so we can flag error 133. 
26472
26473         * decl.cs (MemberCore.UnsafeOK): New function to test that a
26474         pointer is being declared in an unsafe context.
26475
26476 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
26477
26478         * modifiers.cs (Modifiers.Check): Require a Location argument.
26479         Report error 227 for Unsafe use.
26480
26481         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26482
26483         * statement.cs (For.Emit): If the test is null, then report that
26484         we do `return', as we wont reach anything afterwards.
26485
26486         (Switch.SwitchGoverningType): Track the expression that matched
26487         the conversion.
26488
26489         * driver.cs: Allow negative numbers as an error code to flag.
26490
26491         * cs-parser.jay: Handle 1551.
26492
26493         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26494
26495 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26496
26497         * cs-parser.jay: Report 1518 (type declaration can only contain
26498         class, struct, interface, enum or delegate)
26499
26500         (switch_label): Report 1523 (keywords `case' or `default' must
26501         preced code)
26502
26503         (opt_switch_sections): Report 1522 (empty switch)
26504
26505         * driver.cs: Report 1515 (response file specified multiple times)
26506         Report 1516 (Source file specified multiple times).
26507
26508         * expression.cs (Argument.Resolve): Signal 1510
26509
26510         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26511         access not allowed in static code)
26512
26513 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26514
26515         * typemanager.cs (IsPointerType): Utility method which we are going
26516         to need a lot.
26517
26518         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26519         the object type, so we take care of that.
26520
26521         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26522
26523         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26524         added to non-params parameters :-)
26525
26526         * typemanager.cs (CSharpName): Include 'void' type too. 
26527
26528         (void_ptr_type): Include in the set of core types.
26529
26530         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26531         duplicating code.
26532
26533         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26534         an unsafe context.
26535
26536         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26537         completely forgotten about it.
26538
26539 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26540
26541         * cs-parser.jay (pointer_type): Add. This begins our implementation
26542         of parsing rules for unsafe code.
26543
26544         (unsafe_statement): Implement.
26545
26546         (embedded_statement): Modify to include the above.
26547
26548         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26549
26550         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26551         if the current context is an unsafe one.
26552
26553         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26554         are handled differently, we need separate rules for them.
26555
26556         (local_variable_declaration): Update to use local_variable_pointer_type
26557         to allow variable declarations of unmanaged pointer types.
26558
26559         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26560         in unsafe contexts.
26561
26562         * ../errors/cs0214.cs : Add.
26563
26564 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26565
26566         * makefile: remove 'response' file when cleaning.
26567
26568 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26569
26570         * cs-parser.jay: Report 1524.
26571
26572 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26573
26574         * typemanager.cs (RegisterMethod): drop checking if we have
26575         registered this from here
26576
26577 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26578
26579         * class.cs (Method.EmitDestructor): Implement calling our base
26580         destructor. 
26581
26582         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26583         value of InFinally.
26584
26585         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26586         this routine and will wrap the call in a try/catch block.  Deal
26587         with the case.
26588
26589 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26590
26591         * ecore.cs (Expression.MemberLookup): instead of taking a
26592         parameter `same_type' that was used to tell whether we could
26593         access private members we compute our containing type from the
26594         EmitContext.
26595
26596         (FieldExpr): Added partial support for volatile fields.  This does
26597         not work for volatile fields exposed from assemblies, as I can not
26598         figure out how to extract the modreq from it.
26599
26600         Updated all the source files to use this.
26601
26602         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26603         because it is referenced by MemberLookup very often. 
26604
26605 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26606
26607         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26608         TypeBuilder.GetCustomAttributes to retrieve what we need.
26609
26610         Get rid of redundant default_member_attr_type as this is the same as
26611         default_member_type which already exists.
26612
26613         * interface.cs, attribute.cs : Update accordingly.
26614
26615 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26616
26617         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26618         work for TYpeBuilders though.  Ravi, can you please fix this?
26619
26620         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26621
26622         * expression.cs (Argument.Emit): Handle the case of ref objects
26623         being passed to ref functions;  
26624
26625         (ParameterReference.EmitLoad): Loads the content of the pointer
26626         without dereferencing.
26627
26628 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26629
26630         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26631
26632 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26633
26634         * class.cs (Indexer.DefineMethod): Incorporate the interface
26635         type in the name of the method if we are doing explicit interface
26636         implementation.
26637
26638         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26639
26640         (BetterConversion): Fix extremely trivial bug where we were referring to
26641         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26642         again !
26643
26644         * ../errors/bug16.cs : Add although we have fixed it.
26645
26646 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26647
26648         * expression.cs (BaseIndexer): Begin implementation.
26649
26650         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26651
26652         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26653         production directly to remove a shift/reduce, and implement
26654         explicit interface implementation.
26655
26656         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26657         after a floating point suffix.
26658
26659         * expression.cs (DoNumericPromotions): Improved the conversion for
26660         uint/uint.  If we have a constant, we avoid doing a typecast to a
26661         larger type.
26662
26663         * class.cs (Indexer): Implement explicit interface implementation
26664         for indexers.
26665
26666 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26667
26668         * class.cs: make the default instance constructor public and hidebysig.
26669
26670 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26671
26672         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26673         so we can call it from elsewhere.
26674
26675         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26676         we emit it internally if the class has a defined indexer; otherwise the user
26677         emits it by decorating the class definition with the DefaultMemberAttribute.
26678
26679         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26680         attribute is not used on a type which defines an indexer.
26681
26682         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26683         character when we skip whitespace.
26684
26685         * ../errors/cs0646.cs : Add.
26686
26687 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26688
26689         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26690         again. 
26691
26692         * makefile: Add practical target `mcs3.exe' which builds the third
26693         generation compiler. 
26694
26695         * expression.cs (New): Fix structures constructor calling.
26696
26697         * class.cs (Property, Method, Indexer): Emit Final flag on the
26698         method if we are an interface implementation and we are not
26699         abstract. 
26700
26701         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26702         whether this property is referencing a `base' method.
26703
26704         * expression.cs (Invocation.EmitCall): take an extra argument:
26705         is_base, this is used to determine whether the `call' or
26706         `callvirt' opcode should be used.
26707
26708
26709         * delegate.cs: update EmitCall.
26710
26711         * class.cs (Method.Define): Set NewSlot for the cases where we are
26712         not implementing an interface method.
26713
26714         (Property.Define): ditto.
26715
26716 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26717
26718         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26719         'r'.  Allows mcs to parse itself fully.
26720
26721 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26722
26723         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26724         of the number of initializers that require the InitializeArray method.
26725
26726         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26727         update the above field where necessary.
26728
26729         (MakeByteBlob): Update accordingly.
26730
26731         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26732         greater than 2.
26733
26734         (EmitDynamicInitializers): Update in accordance with the new optimization.
26735
26736         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26737         same OpCode applies.
26738
26739         * cs-parser.jay : Fix some glaring errors I introduced.
26740
26741 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26742
26743         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26744         so that we can check for name clashes there too.
26745
26746         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26747         for interface indexers.
26748
26749         * interfaces.cs (Define): Emit the default member attribute.
26750
26751         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26752         variable was being referred to while setting the value ;-)
26753
26754 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26755
26756         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26757         byte-by-byte information when we know the data is zero.
26758
26759         Make the block always a multiple of 4, because
26760         DefineInitializedData has a bug.
26761
26762         * assign.cs: Fix, we should assign from the temporary, not from
26763         the source. 
26764
26765         * expression.cs (MakeByteBlob): Fix my incorrect code.
26766
26767 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26768
26769         * typemanager.cs (EnumToUnderlying): This function is used to get
26770         the underlying type from an enumeration, because it does not
26771         always work. 
26772
26773         * constant.cs: Use the I4_S form for values between -128 and 127.
26774
26775         * statement.cs (Block.LookupLabel): Looks up a label.
26776         (Block): Drop support for labeled blocks.
26777
26778         (LabeledStatement): New kind of statement that represents a label
26779         only.
26780
26781         (Goto): Finally implement this bad boy.
26782
26783         * cs-parser.jay: Update to reflect new mechanism to implement
26784         labels.
26785
26786 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26787
26788         * codegen.cs (EmitContext.This): a codegen property that keeps the
26789         a single instance of this instead of creating many different this
26790         instances. 
26791
26792         * delegate.cs (Delegate.DoResolve): Update to use the property;
26793
26794         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26795
26796         * expression.cs (BaseAccess.DoResolve): Ditto.
26797
26798 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26799
26800         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26801         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26802
26803         (InitCoreTypes): Update accordingly.
26804
26805         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26806         so we can quickly store the state.
26807
26808         (ApplyAttributes): Set the correct implementation flags
26809         for InternalCall methods.
26810
26811 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26812
26813         * expression.cs (EmitCall): if a method is not virtual, then do
26814         not use callvirt on it.
26815
26816         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26817         user defined stuff) requires the use of stobj, which takes an
26818         address on the stack instead of an array and an index.  So emit
26819         the Ldelema operation for it.
26820
26821         (EmitStoreOpcode): Use stobj for valuetypes.
26822
26823         (UnaryMutator.EmitCode): Use the right 1 value depending on
26824         whether we are dealing with int64/uint64, float or doubles.
26825
26826         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26827         constructors that I implemented last night.
26828
26829         (Constructor.IsDefault): Fix to work properly for static
26830         constructors.
26831
26832         * cs-parser.jay (CheckDef): report method signature errors.
26833         Update error number 103 to be 132.
26834
26835         * decl.cs: New AdditionResult enumeration value: MethodExists.
26836         Although we do this check for methods later on in the semantic
26837         analysis, catching repeated default constructors is so easy that
26838         we catch these here. 
26839
26840         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26841         promotions code.
26842
26843         (ParameterReference.EmitAssign, Emit): handle
26844         bools as bytes.
26845
26846         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26847         (ArrayAccess.EmitStoreOpcode): ditto.
26848
26849         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26850
26851         * expression.cs (MakeByteBlob): Complete all the missing types
26852         (uint, short, ushort, byte, sbyte)
26853
26854         * class.cs: Only init instance field initializers on instance
26855         constructors. 
26856
26857         Rename `constructors' to instance_constructors. 
26858
26859         (TypeContainer.AddConstructor): Only add constructors to the list
26860         if it is not static.
26861
26862         Make sure that we handle default_static_constructor independently
26863         everywhere where we handle instance_constructors
26864
26865 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26866
26867         * class.cs: Do not lookup or create a base initializer for a
26868         static constructor.
26869
26870         (ConstructorInitializer.Resolve): use the proper type to lookup
26871         for constructors.
26872
26873         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26874
26875         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26876         in DeclSpace. 
26877
26878         * decl.cs: CloseType is now an virtual method, the default
26879         implementation just closes this type.
26880
26881 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26882
26883         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26884         to PreserveSig by default. Also emit HideBySig on such methods.
26885
26886         Basically, set the defaults to standard values.
26887
26888         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26889         argument, if candidate is better, it can't be worse than the best !
26890
26891         (Invocation): Re-write bits to differentiate between methods being
26892         applicable in their expanded form and their normal form - for params
26893         methods of course.
26894
26895         Get rid of use_standard everywhere as only standard conversions are allowed
26896         in overload resolution. 
26897
26898         More spec conformance.
26899
26900 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26901
26902         * driver.cs: Add --timestamp, to see where the compiler spends
26903         most of its time.
26904
26905         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26906         `this' in static code.
26907
26908         (SimpleName.DoResolve): Implement in terms of a helper function
26909         that allows static-references to be passed upstream to
26910         MemberAccess.
26911
26912         (Expression.ResolveWithSimpleName): Resolve specially simple
26913         names when called by MemberAccess to implement the special
26914         semantics. 
26915
26916         (Expression.ImplicitReferenceConversion): Handle conversions from
26917         Null to reference types before others, as Null's type is
26918         System.Object. 
26919
26920         * expression.cs (Invocation.EmitCall): Handle the special case of
26921         calling methods declared on a reference type from a ValueType
26922         (Base classes System.Object and System.Enum)
26923
26924         (MemberAccess.Resolve): Only perform lookups on Enumerations if
26925         the left hand side is a TypeExpr, not on every enumeration. 
26926
26927         (Binary.Resolve): If types are reference types, then do a cast to
26928         object on operators != and == of both arguments.
26929
26930         * typemanager.cs (FindMembers): Extract instance and static
26931         members if requested.
26932
26933         * interface.cs (PopulateProperty): Use void_type instead of null
26934         as the return type for the setter method.
26935
26936         (PopulateIndexer): ditto.
26937
26938 2001-12-27  Ravi Pratap  <ravi@ximian.com>
26939
26940         * support.cs (ReflectionParameters): Fix minor bug where we
26941         were examining the wrong parameter for the ParamArray attribute.
26942
26943         Cope with requests for the type of the parameter at position
26944         greater than the params parameter's. We now return the element
26945         type of the params array as that makes more sense.
26946
26947         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
26948         accordingly as we no longer have to extract the element type
26949         ourselves.
26950
26951         (Invocation.OverloadResolve): Update.
26952
26953 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26954
26955         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26956         against IEnumerator, test whether the return value is a descendant
26957         of the IEnumerator interface.
26958
26959         * class.cs (Indexer.Define): Use an auxiliary method to implement
26960         the other bits of the method definition.  Begin support for
26961         explicit interface implementation.
26962
26963         (Property.DefineMethod): Use TypeManager.void_type instead of null
26964         for an empty return value.
26965
26966 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
26967
26968         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26969         dealing with a FieldExpr which is composed of a FieldBuilder, in
26970         the code path we did extract the constant, but we should have
26971         obtained the underlying value to be able to cast it (otherwise we
26972         end up in an infinite loop, this is what Ravi was running into).
26973
26974         (ArrayCreation.UpdateIndices): Arrays might be empty.
26975
26976         (MemberAccess.ResolveMemberAccess): Add support for section
26977         14.5.4.1 that deals with the special case of E.I when E is a type
26978         and something else, that I can be a reference to a static member.
26979
26980         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26981         handle a particular array type to create byte blobs, it is just
26982         something we dont generate byteblobs for.
26983
26984         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26985         arguments. 
26986
26987         * location.cs (Push): remove the key from the hashtable that we
26988         are about to add.   This happens for empty files.
26989
26990         * driver.cs: Dispose files after we have parsed them.
26991
26992         (tokenize): new function that only runs the tokenizer on its
26993         input, for speed testing.
26994
26995 2001-12-26  Ravi Pratap  <ravi@ximian.com>
26996
26997         * class.cs (Event.Define): Define the private field only if there
26998         are no accessors defined.
26999
27000         * expression.cs (ResolveMemberAccess): If there is no associated
27001         field with the event, that means we have an event defined with its
27002         own accessors and we should flag error cs0070 since transforming
27003         ourselves into a field is not valid in that case.
27004
27005         * ecore.cs (SimpleName.DoResolve): Same as above.
27006
27007         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27008         and charset to sane values.
27009
27010 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27011
27012         * assign.cs (DoResolve): Perform check on events only if they 
27013         are being accessed outside the declaring type.
27014
27015         * cs-parser.jay (event_declarations): Update rules to correctly
27016         set the type of the implicit parameter etc.
27017
27018         (add_accessor, remove_accessor): Set current local parameters.
27019
27020         * expression.cs (Binary): For delegate addition and subtraction,
27021         cast the return value from the method into the appropriate delegate
27022         type.
27023
27024 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27025
27026         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27027         of these as the workaround is unnecessary.
27028
27029         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27030         delegate data - none of that is needed at all.
27031
27032         Re-write bits to extract the instance expression and the delegate method
27033         correctly.
27034
27035         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27036         on delegates too.
27037
27038         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27039         of attaching attributes instead of duplicating code everywhere.
27040
27041         * everywhere : Update code to do attribute emission using the above method.
27042
27043 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27044
27045         * expression.cs (IsParamsMethodApplicable): if there are not
27046         parameters, return immediately.
27047
27048         * ecore.cs: The 0 literal can be implicity converted to an enum
27049         type. 
27050
27051         (SimpleName.DoResolve): First lookup the type, then lookup the
27052         members. 
27053
27054         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27055         want to get its address.  If the InstanceExpression is not
27056         addressable, store the result in a temporary variable, then get
27057         the address of it.
27058
27059         * codegen.cs: Only display 219 errors on warning level or above. 
27060
27061         * expression.cs (ArrayAccess): Make it implement the
27062         IMemoryLocation interface.
27063
27064         (Binary.DoResolve): handle the operator == (object a, object b)
27065         and operator != (object a, object b) without incurring into a
27066         BoxedCast (because 5 != o should never be performed).
27067
27068         Handle binary enumerator operators.
27069
27070         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27071         value type, otherwise use Ldelem_ref.
27072
27073         Use precomputed names;
27074
27075         (AddressOf): Implement address of
27076
27077         * cs-parser.jay (labeled_statement): Fix recursive block
27078         addition by reworking the production.
27079
27080         * expression.cs (New.DoEmit): New has a special case:
27081                 
27082                  If we are dealing with a ValueType, we have a few
27083                  situations to deal with:
27084                 
27085                     * The target of New is a ValueType variable, that is
27086                       easy, we just pass this as the variable reference
27087                 
27088                     * The target of New is being passed as an argument,
27089                       to a boxing operation or a function that takes a
27090                       ValueType.
27091                 
27092                       In this case, we need to create a temporary variable
27093                       that is the argument of New.
27094
27095
27096 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27097
27098         * rootcontext.cs (LookupType): Check that current_type is not null before
27099         going about looking at nested types.
27100
27101         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27102         not implement the IAssignMethod interface any more.
27103
27104         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27105         where we tranform them into FieldExprs if they are being resolved from within
27106         the declaring type.
27107
27108         * ecore.cs (SimpleName.DoResolve): Do the same here.
27109
27110         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27111
27112         * ../errors/bug10.cs : Add.
27113
27114         * ../errors/cs0070.cs : Add.
27115
27116         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27117
27118         * assign.cs : Get rid of EventIsLocal everywhere.
27119
27120 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27121
27122         * ecore.cs (ConvertIntLiteral): finished the implementation.
27123
27124         * statement.cs (SwitchLabel): Convert the value we are using as a
27125         key before looking up the table.
27126
27127 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27128
27129         * codegen.cs (EmitTopBlock): Require a Location argument now.
27130
27131         * cs-parser.jay (constructor_declarator): We need to setup
27132         current_local_parameters before we parse the
27133         opt_constructor_initializer, to allow the variables to be bound
27134         to the constructor arguments.
27135
27136         * rootcontext.cs (LookupType): First lookup nested classes in our
27137         class and our parents before we go looking outside our class.
27138
27139         * expression.cs (ConstantFold): Extract/debox the values at the
27140         beginnning. 
27141
27142         * rootcontext.cs (EmitCode): Resolve the constants first before we
27143         resolve the types.  This is not really needed, but it helps debugging.
27144
27145         * statement.cs: report location.
27146
27147         * cs-parser.jay: pass location to throw statement.
27148
27149         * driver.cs: Small bug fix.
27150
27151         * report.cs: Updated format to be 4-zero filled digits.
27152
27153 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27154
27155         * expression.cs (CheckIndices): Fix minor bug where the wrong
27156         variable was being referred to ;-)
27157
27158         (DoEmit): Do not call EmitStaticInitializers when the 
27159         underlying type is System.Object.
27160
27161 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27162
27163         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27164         and do the usual workaround for SRE.
27165
27166         * class.cs (MyEventBuilder.EventType): New member to get at the type
27167         of the event, quickly.
27168
27169         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27170
27171         * assign.cs (Assign.DoResolve): Handle the case when the target
27172         is an EventExpr and perform the necessary checks.
27173
27174         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27175         interface.
27176
27177         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27178
27179         (EventExpr): Set the type in the constructor itself since we 
27180         are meant to be born fully resolved.
27181
27182         (EventExpr.Define): Revert code I wrote earlier.
27183                 
27184         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27185         instance expression is null. The instance expression is a This in that case
27186         or a null, depending on whether it is a static method or not.
27187
27188         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27189         refers to more than one method.
27190
27191         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27192         and accordingly flag errors.
27193
27194 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27195
27196         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27197
27198 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27199
27200         * location.cs (ToString): Provide useful rutine.
27201
27202 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27203
27204         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27205         objects, return the actual integral boxed.
27206
27207         * statement.cs (SwitchLabel): define an ILLabel for each
27208         SwitchLabel. 
27209
27210         (Switch.CheckSwitch): If the value is a Literal, extract
27211         the underlying literal.
27212
27213         Also in the unused hashtable we had, add the SwitchLabel so we can
27214         quickly look this value up.
27215
27216         * constant.cs: Implement a bunch of new constants.  Rewrite
27217         Literal based on this.  Made changes everywhere to adapt to this.
27218
27219         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27220         dereferencing array only once, and also copes with enumrations.
27221
27222         bytes are two bytes wide, not one.
27223
27224         (Cast): Perform constant conversions.
27225
27226         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27227         wrappers to the literals here.
27228
27229         * expression.cs (DoNumericPromotions): long literals can converted
27230         to ulong implicity (this is taken care of elsewhere, but I was
27231         missing this spot).
27232
27233         * ecore.cs (Expression.Literalize): Make the return type Literal,
27234         to improve type checking.
27235
27236         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27237
27238 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27239
27240         * literal.cs: Revert code from ravi that checked the bounds.  The
27241         bounds are sane by the definition of the type itself. 
27242
27243         * typemanager.cs: Fix implementation of ImplementsInterface.  We
27244         need to actually look up in our parent hierarchy for interfaces
27245         implemented. 
27246
27247         * const.cs: Use the underlying type for enumerations
27248
27249         * delegate.cs: Compute the basename for the delegate creation,
27250         that should fix the delegate test case, and restore the correct
27251         Type Lookup semantics in rootcontext
27252
27253         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
27254         referencing a nested type with the Reflection API is using the "+"
27255         sign. 
27256
27257         * cs-parser.jay: Do not require EOF token at the end.
27258
27259 2001-12-20  Ravi Pratap  <ravi@ximian.com>
27260
27261         * rootcontext.cs (LookupType): Concatenate type names with
27262         a '.' instead of a '+' The test suite passes again.
27263
27264         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27265         field of the enumeration.
27266
27267         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27268         the case when the member is an EventExpr.
27269
27270         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27271         static has an associated instance expression.
27272
27273         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27274
27275         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27276
27277         * class.cs (Event.Define): Register event and perform appropriate checks
27278         for error #111.
27279
27280         We define the Add and Remove methods even if the use provides none because
27281         in that case, we provide default implementations ourselves.
27282
27283         Define a private field of the type of the event. This is done by the CSC compiler
27284         and we should be doing it too ;-)
27285
27286         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27287         More methods we use in code we generate.
27288
27289         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27290         is important.
27291
27292         (InitCoreTypes): Update accordingly for the above.
27293
27294         * class.cs (Event.Emit): Generate code for default accessors that we provide
27295
27296         (EmitDefaultMethod): Do the job in the above.
27297
27298         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27299         appropriate place.
27300
27301 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27302
27303         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27304         builders even if we were missing one.
27305
27306         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27307         pass the Basename as our class name instead of the Name.  The
27308         basename will be correctly composed for us.
27309
27310         * parameter.cs (Paramters): Now takes a Location argument.
27311
27312         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27313         make all the code call directly LookupType in RootContext and take
27314         this chance to pass the Location information everywhere.
27315
27316         * Everywhere: pass Location information.
27317
27318 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27319
27320         * class.cs (Constructor.Define): Updated way of detecting the
27321         length of the parameters.
27322
27323         (TypeContainer.DefineType): Use basename as the type name for
27324         nested types.
27325
27326         (TypeContainer.Define): Do not recursively define types here, as
27327         definition is taken care in order by the RootContext.
27328
27329         * tree.cs: Keep track of namespaces in a per-file basis.
27330
27331         * parameter.cs (Parameter.ComputeSignature): Update to use
27332         DeclSpace. 
27333
27334         (Parameters.GetSignature): ditto.
27335
27336         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27337         instead of a TypeContainer.
27338
27339         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27340         resolve names.  Because we need to be resolve in our context, not
27341         our parents.
27342
27343         * driver.cs: Implement response files.
27344
27345         * class.cs (TypeContainer.DefineType): If we are defined, do not
27346         redefine ourselves.
27347
27348         (Event.Emit): Emit the code for add/remove handlers.
27349         (Event.Define): Save the MethodBuilders for add/remove.
27350
27351         * typemanager.cs: Use pair here too.
27352
27353         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27354         DictionaryEntry requires the first argument to be non-null.  
27355
27356         (enum_declaration): Compute full name for registering the
27357         enumeration.
27358
27359         (delegate_declaration): Instead of using
27360         formal_parameter_list, use opt_formal_parameter_list as the list
27361         can be empty.
27362
27363         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27364         (EventParsing): New property that controls whether `add' and
27365         `remove' are returned as tokens or identifiers (for events);
27366
27367 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27368
27369         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27370         use MyEventBuilder only and let it wrap the real builder for us.
27371
27372         (MyEventBuilder): Revamp constructor etc.
27373
27374         Implement all operations that we perform on EventBuilder in precisely the same
27375         way here too.
27376
27377         (FindMembers): Update to use the EventBuilder member.
27378
27379         (Event.Emit): Update accordingly.
27380
27381 2001-12-18  Ravi Pratap  <ravi@ximian.com>
27382
27383         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27384         by calling the appropriate methods.
27385
27386         (GetCustomAttributes): Make stubs as they cannot possibly do anything
27387         useful.
27388
27389         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27390
27391 2001-12-17  Ravi Pratap  <ravi@ximian.com>
27392
27393         * delegate.cs (Delegate.Populate): Check that the return type
27394         and various parameters types are indeed accessible.
27395
27396         * class.cs (Constructor.Define): Same here.
27397
27398         (Field.Define): Ditto.
27399
27400         (Event.Define): Ditto.
27401
27402         (Operator.Define): Check that the underlying Method defined itself
27403         correctly - so it's MethodBuilder should not be null.
27404
27405         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27406         expression happens to be null.
27407
27408         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27409         members but as of now we don't seem to be able to do anything really useful with it.
27410
27411         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27412         not the EventBuilder.
27413
27414 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
27415
27416         * cs-tokenizer.cs: Add support for defines.
27417         Add support for #if, #elif, #else, #endif
27418
27419         (eval_var): evaluates a variable.
27420         (eval): stubbed for evaluating functions.
27421
27422         * cs-parser.jay: Pass the defines information
27423
27424         * driver.cs: Add --define command line option.
27425
27426         * decl.cs: Move MemberCore here.
27427
27428         Make it the base class for DeclSpace.  This allows us to catch and
27429         report 108 and 109 for everything now.
27430
27431         * class.cs (TypeContainer.Define): Extract all the members
27432         before populating and emit the warning 108 (new keyword required
27433         to override) instead of having each member implement this.
27434
27435         (MemberCore.Define): New abstract method, we will be using this in
27436         the warning reporting engine in Populate.
27437
27438         (Operator.Define): Adjust to new MemberCore protocol. 
27439
27440         * const.cs (Const): This does not derive from Expression, it is a
27441         temporary object we use to create fields, it is a MemberCore. 
27442
27443         * class.cs (Method.Define): Allow the entry point to be in a
27444         specific class.
27445
27446         * driver.cs: Rewrite the argument handler to clean it up a bit.
27447
27448         * rootcontext.cs: Made it just an auxiliary namespace feature by
27449         making everything static.
27450
27451         * driver.cs: Adapt code to use RootContext type name instead of
27452         instance variable.
27453
27454         * delegate.cs: Remove RootContext argument.
27455
27456         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27457         argument. 
27458
27459         * class.cs (Event.Define): The lookup can fail.
27460
27461         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
27462
27463         * expression.cs: Resolve the this instance before invoking the code.
27464
27465 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
27466
27467         * cs-parser.jay: Add a production in element_access that allows
27468         the thing to become a "type" reference.  This way we can parse
27469         things like "(string [])" as a type.
27470
27471         Note that this still does not handle the more complex rules of
27472         casts. 
27473
27474
27475         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
27476
27477         * ecore.cs: (CopyNewMethods): new utility function used to
27478         assemble the list of methods from running FindMembers.
27479
27480         (MemberLookup): Rework FindMembers so that 
27481
27482 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
27483
27484         * class.cs (TypeContainer): Remove Delegates who fail to be
27485         defined.
27486
27487         * delegate.cs (Populate): Verify that we dont get null return
27488         values.   TODO: Check for AsAccessible.
27489
27490         * cs-parser.jay: Use basename to emit error 574 (destructor should
27491         have the same name as container class), not the full name.
27492
27493         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27494         possible representation.  
27495
27496         Also implements integer type suffixes U and L.
27497
27498 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
27499
27500         * expression.cs (ArrayCreation.DoResolve): We need to do the
27501         argument resolution *always*.
27502
27503         * decl.cs: Make this hold the namespace.  Hold the root context as
27504         well.
27505         (LookupType): Move here.
27506
27507         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27508
27509         * location.cs (Row, Name): Fixed the code, it was always returning
27510         references to the first file.
27511
27512         * interface.cs: Register properties defined through interfaces.
27513
27514         * driver.cs: Add support for globbing on the command line
27515
27516         * class.cs (Field): Make it derive from MemberCore as well.
27517         (Event): ditto.
27518
27519 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27520
27521         * class.cs (Event::Define): Check that the type of the event is a delegate
27522         type else flag error #66.
27523
27524         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27525         same.
27526
27527         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27528         values of EntryPoint, CharSet etc etc.
27529
27530         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27531
27532         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27533         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27534         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27535         which needs this to do its work.
27536
27537         * ../errors/cs0066.cs : Add.
27538
27539 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27540
27541         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27542         helper functions.
27543
27544         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27545         clears out the parameters field.
27546         (MemberSignatureCompare): Cleanup
27547
27548         (MemberCore): New base class used to share code between MethodCore
27549         and Property.
27550
27551         (RegisterRequiredImplementations) BindingFlags.Public requires
27552         either BindingFlags.Instace or Static.  Use instance here.
27553
27554         (Property): Refactored code to cope better with the full spec.
27555
27556         * parameter.cs (GetParameterInfo): Return an empty array instead
27557         of null on error.
27558
27559         * class.cs (Property): Abstract or extern properties have no bodies.
27560
27561         * parameter.cs (GetParameterInfo): return a zero-sized array.
27562
27563         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27564         method modifier validation to the typecontainer so we can reuse
27565         this on properties.
27566
27567         (MethodCore.ParameterTypes): return an empty sized array of types.
27568
27569         (Property.Define): Test property modifier validity.
27570
27571         Add tests for sealed/override too.
27572
27573         (Method.Emit): abstract or extern methods have no bodies.
27574
27575 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27576
27577         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27578         thing.
27579
27580         (Method::Define, ::Emit): Modify accordingly.
27581
27582         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27583
27584         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27585
27586         * makefile: Pass in /unsafe.
27587
27588 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27589
27590         * class.cs (MakeKey): Kill routine.
27591
27592         * class.cs (TypeContainer.Define): Correctly define explicit
27593         method implementations (they require the full interface name plus
27594         the method name).
27595
27596         * typemanager.cs: Deply the PtrHashtable here and stop using the
27597         lame keys.  Things work so much better.
27598
27599         This of course broke everyone who depended on `RegisterMethod' to
27600         do the `test for existance' test.  This has to be done elsewhere.
27601
27602         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27603         the object stupid Equals method (because, that like fails all over
27604         the place).  We still do not use it.
27605
27606         * class.cs (TypeContainer.SetRequiredInterface,
27607         TypeContainer.RequireMethods): Killed these two routines and moved
27608         all the functionality to RegisterRequiredImplementations.
27609
27610         (TypeContainer.RegisterRequiredImplementations): This routine now
27611         registers all the implementations required in an array for the
27612         interfaces and abstract methods.  We use an array of structures
27613         which can be computed ahead of time to reduce memory usage and we
27614         also assume that lookups are cheap as most classes will not
27615         implement too many interfaces.
27616
27617         We also avoid creating too many MethodSignatures.
27618
27619         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27620         clear the "pending" bit if we find that there are problems with
27621         the declaration.
27622
27623         (TypeContainer.VerifyPendingMethods): Update to report errors of
27624         methods that look like implementations but are not.
27625
27626         (TypeContainer.Define): Add support for explicit interface method
27627         implementation. 
27628
27629 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27630
27631         * typemanager.cs: Keep track of the parameters here instead of
27632         being a feature of the TypeContainer.
27633
27634         * class.cs: Drop the registration of parameters here, as
27635         InterfaceMethods are also interface declarations.
27636
27637         * delegate.cs: Register methods with the TypeManager not only with
27638         the TypeContainer.  This code was buggy.
27639
27640         * interface.cs: Full registation here.
27641
27642 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27643
27644         * expression.cs: Remove reducer for binary expressions, it can not
27645         be done this way.
27646
27647         * const.cs: Put here the code that used to go into constant.cs
27648
27649         * constant.cs: Put here the code for constants, this is a new base
27650         class for Literals.
27651
27652         * literal.cs: Make Literal derive from Constant.
27653
27654 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27655
27656         * statement.cs (Return.Emit): Report error 157 if the user
27657         attempts to return from a finally block.
27658
27659         (Return.Emit): Instead of emitting a return, jump to the end of
27660         the function.
27661
27662         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27663         LocalBuilder to store the result of the function.  ReturnLabel is
27664         the target where we jump.
27665
27666
27667 2001-12-09  Radek Doulik  <rodo@ximian.com>
27668
27669         * cs-parser.jay: remember alias in current namespace
27670
27671         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27672         namespaces
27673
27674         * class.cs (LookupAlias): lookup alias in my_namespace
27675
27676         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27677         aliases hashtable
27678         (LookupAlias): lookup alias in this and if needed in parent
27679         namespaces
27680
27681 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27682
27683         * support.cs: 
27684
27685         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27686         making things static.  I need this to avoid passing the
27687         TypeContainer when calling ParameterType.
27688
27689         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27690         that did string manipulation to compute the type and then call
27691         GetType.  Use Parameter.ParameterType instead.
27692
27693         * cs-tokenizer.cs: Consume the suffix for floating values.
27694
27695         * expression.cs (ParameterReference): figure out whether this is a
27696         reference parameter or not.  Kill an extra variable by computing
27697         the arg_idx during emission.
27698
27699         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27700         function that returns whether a parameter is an out/ref value or not.
27701
27702         (Parameter.ParameterType): The type of the parameter (base,
27703         without ref/out applied).
27704
27705         (Parameter.Resolve): Perform resolution here.
27706         (Parameter.ExternalType): The full type (with ref/out applied).
27707
27708         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27709         support for expressions on the using statement.
27710
27711 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27712
27713         * statement.cs (Using.EmitLocalVariableDecls): Split the
27714         localvariable handling of the using statement.
27715
27716         (Block.EmitMeta): Keep track of variable count across blocks.  We
27717         were reusing slots on separate branches of blocks.
27718
27719         (Try.Emit): Emit the general code block, we were not emitting it. 
27720
27721         Check the type of the declaration to be an IDisposable or
27722         something that can be implicity converted to it. 
27723
27724         Emit conversions if required.
27725
27726         * ecore.cs (EmptyExpression): New utility class.
27727         (Expression.ImplicitConversionExists): New utility function.
27728
27729 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27730
27731         * statement.cs (Using): Implement.
27732
27733         * expression.cs (LocalVariableReference): Support read only variables.
27734
27735         * statement.cs: Remove the explicit emit for the Leave opcode.
27736         (VariableInfo): Add a readonly field.
27737
27738 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27739
27740         * ecore.cs (ConvCast): new class used to encapsulate the various
27741         explicit integer conversions that works in both checked and
27742         unchecked contexts.
27743
27744         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27745         properly generate the overflow opcodes.
27746
27747 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27748
27749         * statement.cs: The correct type for the EmptyExpression is the
27750         element_type, not the variable type.  Ravi pointed this out.
27751
27752 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27753
27754         * class.cs (Method::Define): Handle PInvoke methods specially
27755         by using DefinePInvokeMethod instead of the usual one.
27756
27757         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27758         above to do the task of extracting information and defining the method.
27759
27760 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27761
27762         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27763         of the condition for string type.
27764
27765         (Emit): Move that here. 
27766
27767         (ArrayCreation::CheckIndices): Keep string literals in their expression
27768         form.
27769
27770         (EmitDynamicInitializers): Handle strings appropriately.
27771
27772 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27773
27774         * codegen.cs (EmitContext): Replace multiple variables with a
27775         single pointer to the current Switch statement.
27776
27777         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27778         EmitContext.
27779
27780 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27781
27782         * statement.cs 
27783
27784         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27785         default'.
27786
27787         (Foreach.Emit): Foreach on arrays was not setting
27788         up the loop variables (for break/continue).
27789
27790         (GotoCase): Semi-implented.
27791
27792 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27793
27794         * attribute.cs (CheckAttribute): Handle system attributes by using
27795         Attribute.GetAttributes to examine information we need.
27796
27797         (GetValidPlaces): Same here.
27798
27799         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27800
27801         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27802
27803         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27804
27805         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27806
27807         (Method::Emit): Handle the case when we are a PInvoke method.
27808
27809 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27810
27811         * expression.cs: Use ResolveWithSimpleName on compound names.
27812
27813 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27814
27815         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27816         before trying to reduce it.
27817
27818         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27819
27820         * constant.cs (LookupConstantValue): Implement.
27821
27822         (EmitConstant): Use the above in emitting the constant.
27823
27824         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27825         that are user-defined by doing a LookupConstantValue on them.
27826
27827         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27828         too, like above.
27829
27830 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27831
27832         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27833
27834         (BaseAccess.DoResolve): Implement.
27835
27836         (MemberAccess.DoResolve): Split this routine into a
27837         ResolveMemberAccess routine that can be used independently
27838
27839 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27840
27841         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27842         As that share bits of the implementation.  Is returns a boolean,
27843         while As returns the Type that is being probed.
27844
27845 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27846
27847         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27848         instead of a Literal - much easier.
27849
27850         (EnumInTransit): Remove - utterly useless :-)
27851
27852         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27853
27854         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27855
27856         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27857         chain when we have no associated expression.
27858
27859 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27860
27861         * constant.cs (Define): Use Location while reporting the errror.
27862
27863         Also emit a warning when 'new' is used and there is no inherited
27864         member to hide.
27865
27866         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27867         populated.
27868
27869         (LookupEnumValue): Implement to lookup an enum member's value and define it
27870         if necessary.
27871
27872         (Populate): Re-write accordingly to use the above routine.
27873
27874 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27875
27876         * expression.cs (This): Fix prototype for DoResolveLValue to
27877         override the base class DoResolveLValue.
27878
27879         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27880         declarations) 
27881
27882         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27883         (we need to load the address of the field here).  This fixes
27884         test-22. 
27885
27886         (FieldExpr.DoResolveLValue): Call the DoResolve
27887         function to initialize the Instance expression.
27888
27889         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27890         correctly the GetEnumerator operation on a value type.
27891
27892         * cs-parser.jay: Add more simple parsing error catches.
27893
27894         * statement.cs (Switch): Add support for string switches.
27895         Handle null specially.
27896
27897         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27898
27899 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27900
27901         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27902
27903         (declare_local_constant): New helper function.
27904
27905         * statement.cs (AddConstant): Keep a separate record of constants
27906
27907         (IsConstant): Implement to determine if a variable is a constant.
27908
27909         (GetConstantExpression): Implement.
27910
27911         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27912
27913         * statement.cs (IsVariableDefined): Re-write.
27914
27915 2001-11-27  Ravi Pratap  <ravi@ximian.com>
27916
27917         * class.cs (TypeContainer::FindMembers): Look for constants
27918         in the case when we are looking for MemberTypes.Field
27919
27920         * expression.cs (MemberAccess::DoResolve): Check that in the
27921         case we are a FieldExpr and a Literal, we are not being accessed
27922         by an instance reference.
27923
27924         * cs-parser.jay (local_constant_declaration): Implement.
27925
27926         (declaration_statement): Implement for constant declarations.
27927
27928 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
27929
27930         * statement.cs (Switch): Catch double defaults.
27931
27932         (Switch): More work on the switch() statement
27933         implementation.  It works for integral values now, need to finish
27934         string support.
27935
27936
27937 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27938
27939         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27940         integer literals into other integer literals.  To be used by
27941         switch. 
27942
27943 2001-11-24  Ravi Pratap  <ravi@ximian.com>
27944
27945         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27946         some memory.
27947
27948         (EmitDynamicInitializers): Cope with the above since we extract data
27949         directly from ArrayData now.
27950
27951         (ExpectInitializers): Keep track of whether initializers are mandatory
27952         or not.
27953
27954         (Bounds): Make it a hashtable to prevent the same dimension being 
27955         recorded for every element in that dimension.
27956
27957         (EmitDynamicInitializers): Fix bug which prevented the Set array method
27958         from being found.
27959
27960         Also fix bug which was causing the indices to be emitted in the reverse
27961         order.
27962
27963 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27964
27965         * expression.cs (ArrayCreation): Implement the bits that Ravi left
27966         unfinished.  They do not work, because the underlying code is
27967         sloppy.
27968
27969 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27970
27971         * cs-parser.jay: Remove bogus fixme.
27972
27973         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27974         on Switch statement.
27975
27976 2001-11-23  Ravi Pratap  <ravi@ximian.com>
27977
27978         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27979         the same. 
27980
27981         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27982         parameter. Apparently, any expression is allowed. 
27983
27984         (ValidateInitializers): Update accordingly.
27985
27986         (CheckIndices): Fix some tricky bugs thanks to recursion.
27987
27988         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
27989         I was being completely brain-dead.
27990
27991         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27992         and re-write acordingly.
27993
27994         (DelegateInvocation): Re-write accordingly.
27995
27996         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27997
27998         (MakeByteBlob): Handle types more correctly.
27999
28000         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28001         initialization from expressions but it is incomplete because I am a complete
28002         Dodo :-|
28003
28004 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28005
28006         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28007         on If.  Basically, we have to return `true' (ie, we do return to
28008         our caller) only if both branches of the if return.
28009
28010         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28011         short-circuit operators, handle them as short circuit operators. 
28012
28013         (Cast.DoResolve): Resolve type.
28014         (Cast.Cast): Take an expression as the target type.
28015
28016         * cs-parser.jay (cast_expression): Remove old hack that only
28017         allowed a limited set of types to be handled.  Now we take a
28018         unary_expression and we resolve to a type during semantic
28019         analysis.
28020
28021         Use the grammar productions from Rhys to handle casts (this is
28022         not complete like Rhys syntax yet, we fail to handle that corner
28023         case that C# has regarding (-x), but we will get there.
28024
28025 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28026
28027         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28028         field which is an array type.
28029
28030         * cs-parser.jay (declare_local_variables): Support array initialization too.
28031
28032         * typemanager.cs (MakeKey): Implement.
28033
28034         (everywhere): Use the above appropriately.
28035
28036         * cs-parser.jay (for_statement): Update for array initialization while
28037         declaring variables.
28038
28039         * ecore.cs : The error message was correct, it's the variable's names that
28040         were misleading ;-) Make the code more readable.
28041
28042         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28043         the correct type etc.
28044
28045         (ConvertExplicit): Handle Enum types by examining the underlying type.
28046
28047 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28048
28049         * parameter.cs (GetCallingConvention): Always return
28050         CallingConventions.Standard for now.
28051
28052 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28053
28054         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28055         and `r' after calling DoNumericPromotions.
28056
28057         * ecore.cs: Fix error message (the types were in the wrong order).
28058
28059         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28060         BindingFlags.Instance as well 
28061
28062         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28063         implicit int literal conversion in an empty cast so that we
28064         propagate the right type upstream.
28065
28066         (UnboxCast): new class used to unbox value types.
28067         (Expression.ConvertExplicit): Add explicit type conversions done
28068         by unboxing.
28069
28070         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28071         the target type before applying the implicit LongLiterals to ULong
28072         literal cast.
28073
28074 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28075
28076         * cs-parser.jay (for_statement): Reworked the way For works: now
28077         we declare manually any variables that are introduced in
28078         for_initializer to solve the problem of having out-of-band code
28079         emition (that is what got for broken).
28080
28081         (declaration_statement): Perform the actual variable declaration
28082         that used to be done in local_variable_declaration here.
28083
28084         (local_variable_declaration): Do not declare anything, just pass
28085         the information on a DictionaryEntry
28086
28087 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28088
28089         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28090         re-write of the logic to now make it recursive.
28091
28092         (UpdateIndices): Re-write accordingly.
28093
28094         Store element data in a separate ArrayData list in the above methods.
28095
28096         (MakeByteBlob): Implement to dump the array data into a byte array.
28097
28098 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28099
28100         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28101         into CheckIndices.
28102
28103         * constant.cs (Define): Implement.
28104
28105         (EmitConstant): Re-write fully.
28106
28107         Pass in location info.
28108
28109         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28110         respectively.
28111
28112         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28113         DictionaryEntry since we need location info too.
28114
28115         (constant_declaration): Update accordingly.
28116
28117         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28118         code into another method : UpdateIndices.
28119
28120 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28121
28122         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28123         some type checking etc.
28124
28125 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28126
28127         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28128         bits to provide dimension info if the user skips doing that.
28129
28130         Update second constructor to store the rank correctly.
28131
28132 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28133
28134         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28135         and try to implement.
28136
28137         * ../errors/cs0150.cs : Add.
28138
28139         * ../errors/cs0178.cs : Add.
28140
28141 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28142
28143         * statement.cs: Implement foreach on multi-dimensional arrays. 
28144
28145         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28146         name of the params argument.
28147
28148         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28149         initializing the array.
28150
28151         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28152         we can use this elsewhere.
28153
28154         * statement.cs: Finish implementation of foreach for single
28155         dimension arrays.
28156
28157         * cs-parser.jay: Use an out-of-band stack to pass information
28158         around, I wonder why I need this.
28159
28160         foreach_block: Make the new foreach_block the current_block.
28161
28162         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28163         function used to return a static Parameters structure.  Used for
28164         empty parameters, as those are created very frequently.
28165
28166         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28167
28168 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28169
28170         * interface.cs : Default modifier is private, not public. The
28171         make verify test passes again.
28172
28173 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28174
28175         * support.cs (ReflectionParameters): Fix logic to determine
28176         whether the last parameter is a params one. Test 9 passes again.
28177
28178         * delegate.cs (Populate): Register the builders we define with
28179         RegisterParameterForBuilder. Test 19 passes again.
28180
28181         * cs-parser.jay (property_declaration): Reference $6 instead
28182         of $$ to get at the location.
28183
28184         (indexer_declaration): Similar stuff.
28185
28186         (attribute): Ditto.
28187
28188         * class.cs (Property): Register parameters for the Get and Set methods
28189         if they exist. Test 23 passes again.
28190
28191         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28192         call to EmitArguments as we are sure there aren't any params arguments. 
28193         Test 32 passes again.
28194
28195         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28196         IndexOutOfRangeException. 
28197
28198         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28199         Test 33 now passes again.
28200
28201 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28202
28203         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28204         broke a bunch of things.  Will have to come up with a better way
28205         of tracking locations.
28206
28207         * statement.cs: Implemented foreach for single dimension arrays.
28208
28209 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28210
28211         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28212         an error.  This removes the lookup from the critical path.
28213
28214         * cs-parser.jay: Removed use of temporary_loc, which is completely
28215         broken. 
28216
28217 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28218
28219         * support.cs (ReflectionParameters.ParameterModifier): Report
28220         whether the argument is a PARAMS argument or not.
28221
28222         * class.cs: Set the attribute `ParamArrayAttribute' on the
28223         parameter argument.
28224
28225         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28226         and cons_param_array_attribute (ConstructorInfo for
28227         ParamArrayAttribute)., 
28228
28229         * codegen.cs: Emit the return using the `Return' statement, that
28230         way we can report the error correctly for missing return values. 
28231
28232         * class.cs (Method.Emit): Clean up.
28233
28234         * expression.cs (Argument.Resolve): Take another argument: the
28235         location where this argument is used.  Notice that this is not
28236         part of the "Argument" class as to reduce the size of the
28237         structure (we know the approximate location anyways).
28238
28239         Test if the argument is a variable-reference, if not, then
28240         complain with a 206.
28241
28242         (Argument.Emit): Emit addresses of variables.
28243
28244         (Argument.FullDesc): Simplify.
28245
28246         (Invocation.DoResolve): Update for Argument.Resolve.
28247
28248         (ElementAccess.DoResolve): ditto.
28249
28250         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28251         method should be virtual, as this method is always virtual.
28252
28253         (NewDelegate.DoResolve): Update for Argument.Resolve.
28254
28255         * class.cs (ConstructorInitializer.DoResolve): ditto.
28256
28257         * attribute.cs (Attribute.Resolve): ditto.
28258
28259 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
28260
28261         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28262
28263         * expression.cs (ParameterReference): Drop IStackStorage and implement
28264         IAssignMethod instead. 
28265
28266         (LocalVariableReference): ditto.
28267
28268         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28269         IAssignMethod instead. 
28270
28271 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28272
28273         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28274         enumerations that are used in heavily used structures derive from
28275         byte in a laughable and pathetic attempt to reduce memory usage.
28276         This is the kind of pre-optimzations that you should not do at
28277         home without adult supervision.
28278
28279         * expression.cs (UnaryMutator): New class, used to handle ++ and
28280         -- separatedly from the other unary operators.  Cleans up the
28281         code, and kills the ExpressionStatement dependency in Unary.
28282
28283         (Unary): Removed `method' and `Arguments' from this class, making
28284         it smaller, and moving it all to SimpleCall, so I can reuse this
28285         code in other locations and avoid creating a lot of transient data
28286         strucutres when not required.
28287
28288         * cs-parser.jay: Adjust for new changes.
28289
28290 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28291
28292         * enum.cs (Enum.Populate): If there is a failure during
28293         definition, return
28294
28295         * cs-parser.jay (opt_enum_base): we used to catch type errors
28296         here, but this is really incorrect.  The type error should be
28297         catched during semantic analysis.
28298
28299 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28300
28301         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28302         current_local_parameters as expected since I, in my stupidity, had forgotten
28303         to do this :-)
28304
28305         * attribute.cs (GetValidPlaces): Fix stupid bug.
28306
28307         * class.cs (Method::Emit): Perform check on applicability of attributes.
28308
28309         (Constructor::Emit): Ditto.
28310
28311         (Field::Emit): Ditto.
28312
28313         (Field.Location): Store location information.
28314
28315         (Property, Event, Indexer, Operator): Ditto.
28316
28317         * cs-parser.jay (field_declaration): Pass in location for each field.
28318
28319         * ../errors/cs0592.cs : Add.
28320
28321 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28322
28323         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28324
28325         (InitCoreTypes): Update accordingly.
28326
28327         (RegisterAttrType, LookupAttr): Implement.
28328
28329         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28330         info about the same.
28331
28332         (Resolve): Update to populate the above as necessary.
28333
28334         (Error592): Helper.
28335
28336         (GetValidPlaces): Helper to the above.
28337
28338         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28339
28340         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28341
28342 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28343
28344         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28345
28346         * ../errors/cs0617.cs : Add.
28347
28348 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28349
28350         * enum.cs (Emit): Rename to Populate to be more consistent with what
28351         we expect it to do and when exactly it is called.
28352
28353         * class.cs, rootcontext.cs : Update accordingly.
28354
28355         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28356         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28357
28358         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28359
28360         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28361         of a fieldinfo using the above, when dealing with a FieldBuilder.
28362
28363 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28364
28365         * ../errors/cs0031.cs : Add.
28366
28367         * ../errors/cs1008.cs : Add.
28368
28369         * ../errrors/cs0543.cs : Add.
28370
28371         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28372         enum type.
28373
28374         (FindMembers): Implement.
28375
28376         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28377         enums and delegates too.
28378
28379         (enum_types): Rename to builder_to_enum.
28380
28381         (delegate_types): Rename to builder_to_delegate.
28382
28383         * delegate.cs (FindMembers): Implement.
28384
28385 2001-11-09  Ravi Pratap  <ravi@ximian.com>
28386
28387         * typemanager.cs (IsEnumType): Implement.
28388
28389         * enum.cs (Emit): Re-write parts to account for the underlying type
28390         better and perform checking etc.
28391
28392         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28393         of the underlying type.
28394
28395         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28396         value
28397
28398         * enum.cs (error31): Helper to report error #31.
28399
28400         * cs-parser.jay (enum_declaration): Store location of each member too.
28401
28402         * enum.cs (member_to_location): New hashtable. 
28403
28404         (AddEnumMember): Update location hashtable.
28405
28406         (Emit): Use the location of each member while reporting errors.
28407
28408 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28409
28410         * cs-parser.jay: A for_initializer if is a
28411         local_variable_declaration really ammount to have an implicit
28412         block with the variable declaration and no initializer for for.
28413
28414         * statement.cs (For.Emit): Cope with null initializers.
28415
28416         This fixes the infinite loop on for initializers.
28417
28418 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
28419
28420         * enum.cs: More cleanup.
28421
28422         * ecore.cs: Remove dead code.
28423
28424         * class.cs (Property.Emit): More simplification.
28425         (Event.Emit): ditto.
28426
28427         Reworked to have less levels of indentation.
28428
28429 2001-11-08  Ravi Pratap  <ravi@ximian.com>
28430
28431         * class.cs (Property): Emit attributes.
28432
28433         (Field): Ditto.
28434
28435         (Event): Ditto.
28436
28437         (Indexer): Ditto.
28438
28439         (Operator): Ditto.
28440
28441         * enum.cs (Emit): Ditto.
28442
28443         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28444         Enums too.
28445
28446         * class.cs (Field, Event, etc.): Move attribute generation into the
28447         Emit method everywhere.
28448
28449         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28450         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28451         as we had no way of defining nested enums !
28452
28453         * rootcontext.cs : Adjust code accordingly.
28454
28455         * typemanager.cs (AddEnumType): To keep track of enum types separately.
28456
28457 2001-11-07  Ravi Pratap  <ravi@ximian.com>
28458
28459         * expression.cs (EvalConstantExpression): Move into ecore.cs
28460
28461         * enum.cs (Enum): Rename some members and make them public and readonly
28462         according to our convention.
28463
28464         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28465         nothing else.
28466
28467         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28468
28469         (Enum::Emit): Write a simple version for now which doesn't try to compute
28470         expressions. I shall modify this to be more robust in just a while.
28471
28472         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28473
28474         (TypeContainer::CloseType): Create the Enum types too.
28475
28476         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28477
28478         * expression.cs (EvalConstantExpression): Get rid of completely.
28479
28480         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28481         user-defined values and other cases.
28482
28483         (IsValidEnumLiteral): Helper function.
28484
28485         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
28486         out there in the case we had a literal FieldExpr.
28487
28488         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28489
28490         (Literalize): Revamp a bit to take two arguments.
28491
28492         (EnumLiteral): New class which derives from Literal to wrap enum literals.
28493
28494 2001-11-06  Ravi Pratap  <ravi@ximian.com>
28495
28496         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28497
28498         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28499
28500         (Resolve): Use the above to ensure we have proper initializers.
28501
28502 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28503
28504         * expression.cs (Expression::EvalConstantExpression): New method to 
28505         evaluate constant expressions.
28506
28507         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28508
28509 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28510
28511         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28512         in an array.
28513
28514         (Binary.ResolveOperator): Handle operator != (object a, object b)
28515         and operator == (object a, object b);
28516
28517         (Binary.DoNumericPromotions): Indicate whether the numeric
28518         promotion was possible.
28519
28520         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28521         Implement.  
28522
28523         Made the ArrayAccess implement interface IAssignMethod instead of
28524         IStackStore as the order in which arguments are passed reflects
28525         this.
28526
28527         * assign.cs: Instead of using expr.ExprClass to select the way of
28528         assinging, probe for the IStackStore/IAssignMethod interfaces.
28529
28530         * typemanager.cs: Load InitializeArray definition.
28531
28532         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28533         static data that can be used to initialize arrays. 
28534
28535 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28536
28537         * expression.cs: Handle operator== and operator!= for booleans.
28538
28539         (Conditioal.Reduce): Implement reducer for the ?: operator.
28540
28541         (Conditional.Resolve): Implement dead code elimination.
28542
28543         (Binary.Resolve): Catch string literals and return a new
28544         concatenated string.
28545
28546         (Unary.Reduce): Implement reduction of unary expressions.
28547
28548         * ecore.cs: Split out the expression core handling here.
28549
28550         (Expression.Reduce): New method used to perform constant folding
28551         and CSE.  This is needed to support constant-expressions. 
28552
28553         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28554         targets, and optimize for !x.
28555
28556 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28557
28558         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28559         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28560         set custom atttributes.
28561
28562         * literal.cs (Literal::GetValue): New abstract method to return the actual
28563         value of the literal, cast as an object.
28564
28565         (*Literal): Implement GetValue method.
28566
28567         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28568         expressions to the arraylist but objects of type Argument.
28569
28570         * class.cs (TypeContainer::Emit): Emit our attributes too.
28571
28572         (Method::Emit, Constructor::Emit): Ditto.
28573
28574         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28575         to be ignoring earlier.
28576
28577 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28578
28579         * attribute.cs (AttributeSection::Define): Implement to do the business
28580         of constructing a CustomAttributeBuilder.
28581
28582         (Attribute): New trivial class. Increases readability of code.  
28583
28584         * cs-parser.jay : Update accordingly.
28585
28586         (positional_argument_list, named_argument_list, named_argument): New rules
28587
28588         (attribute_arguments): Use the above so that we are more correct.
28589
28590 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28591
28592         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28593         to perform all checks for a method with a params parameter.
28594
28595         (Invocation::OverloadResolve): Update to use the above method and therefore
28596         cope correctly with params method invocations.
28597
28598         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28599         params too.
28600
28601         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28602         constructors in our parent too because we can't afford to miss out on 
28603         protected ones ;-)
28604
28605         * attribute.cs (AttributeSection): New name for the class Attribute
28606
28607         Other trivial changes to improve readability.
28608
28609         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28610         use the new class names.
28611
28612 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28613
28614         * class.cs (Method::Define): Complete definition for params types too
28615
28616         (Indexer::Define): Ditto.
28617
28618         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28619         Cope everywhere with a request for info about the array parameter.
28620
28621 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28622
28623         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28624
28625         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28626         local_variable_type to extract the string corresponding to the type.
28627
28628         (local_variable_type): Fixup the action to use the new helper method.
28629
28630         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28631         go.
28632
28633         * expression.cs : Clean out code which uses the above.
28634
28635 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28636
28637         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28638         and bale out if necessary by returning a false.
28639
28640         (RegisterProperty): Ditto.
28641
28642         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28643         and print out appropriate error messages.
28644
28645         * interface.cs (everywhere): Ditto.
28646
28647         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28648         location to constructor.
28649
28650         * class.cs (Property, Event, Indexer): Update accordingly.
28651
28652         * ../errors/cs111.cs : Added.
28653
28654         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28655         of a method, as laid down by the spec.
28656
28657         (Invocation::OverloadResolve): Use the above method.
28658
28659 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28660
28661         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28662         now take a TypeContainer and a Parameters object.
28663
28664         (ParameterData): Modify return type of ParameterModifier method to be 
28665         Parameter.Modifier and not a string.
28666
28667         (ReflectionParameters, InternalParameters): Update accordingly.
28668
28669         * expression.cs (Argument::GetParameterModifier): Same here.
28670
28671         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28672         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28673         symbol in it at all so maybe this is only for now.
28674
28675 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28676
28677         * support.cs (InternalParameters): Constructor now takes an extra argument 
28678         which is the actual Parameters class.
28679
28680         (ParameterDesc): Update to provide info on ref/out modifiers.
28681
28682         * class.cs (everywhere): Update call to InternalParameters to pass in
28683         the second argument too.
28684
28685         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28686         to return the modifier info [ref/out etc]
28687
28688         (InternalParameters, ReflectionParameters): Implement the above.
28689
28690         * expression.cs (Argument::ParameterModifier): Similar function to return
28691         info about the argument's modifiers.
28692
28693         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28694         too.
28695
28696         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28697         a new SetFormalParameters object which we pass to InternalParameters.
28698
28699 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28700
28701         * expression.cs (NewArray): Merge into the ArrayCreation class.
28702
28703 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28704
28705         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28706         NewUserdefinedArray into one as there wasn't much of a use in having
28707         two separate ones.
28708
28709         * expression.cs (Argument): Change field's name to ArgType from Type.
28710
28711         (Type): New readonly property which returns the proper type, taking into 
28712         account ref/out modifiers.
28713
28714         (everywhere): Adjust code accordingly for the above.
28715
28716         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28717         whether we are emitting for a ref or out parameter.
28718
28719         * expression.cs (Argument::Emit): Use the above field to set the state.
28720
28721         (LocalVariableReference::Emit): Update to honour the flag and emit the
28722         right stuff.
28723
28724         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28725
28726         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28727
28728         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28729
28730         (ReflectionParameters, InternalParameters): Implement the above method.
28731
28732         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28733         reporting errors.
28734
28735         (Invocation::FullMethodDesc): Ditto. 
28736
28737 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28738
28739         * cs-parser.jay: Add extra production for the second form of array
28740         creation. 
28741
28742         * expression.cs (ArrayCreation): Update to reflect the above
28743         change. 
28744
28745         * Small changes to prepare for Array initialization.
28746
28747 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28748
28749         * typemanager.cs (ImplementsInterface): interface might be null;
28750         Deal with this problem;
28751
28752         Also, we do store negative hits on the cache (null values), so use
28753         this instead of calling t.GetInterfaces on the type everytime.
28754
28755 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28756
28757         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28758
28759         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28760         split functionality out into different classes.
28761
28762         (New::FormArrayType): Move into NewBuiltinArray.
28763
28764         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28765         quite useless.
28766
28767         (NewBuiltinArray): New class to handle creation of built-in arrays.
28768
28769         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28770         account creation of one-dimensional arrays.
28771
28772         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28773
28774         (NewUserdefinedArray::DoResolve): Implement.
28775
28776         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28777
28778         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28779         we maintain inside the TypeManager. This is necessary to perform lookups on the
28780         module builder.
28781
28782         (LookupType): Update to perform GetType on the module builders too.     
28783
28784         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28785
28786         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28787
28788 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28789
28790         * expression.cs (New::DoResolve): Implement guts of array creation.
28791
28792         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28793
28794 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28795
28796         * expression.cs: Fix bug I introduced lsat night that broke
28797         Delegates. 
28798
28799         (Expression.Resolve): Report a 246 error (can not resolve name)
28800         if we find a SimpleName in the stream.
28801
28802         (Expression.ResolveLValue): Ditto.
28803
28804         (Expression.ResolveWithSimpleName): This function is a variant of
28805         ResolveName, this one allows SimpleNames to be returned without a
28806         warning.  The only consumer of SimpleNames is MemberAccess
28807
28808 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28809
28810         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28811         might arrive here.  I have my doubts that this is correct.
28812
28813         * statement.cs (Lock): Implement lock statement.
28814
28815         * cs-parser.jay: Small fixes to support `lock' and `using'
28816
28817         * cs-tokenizer.cs: Remove extra space
28818
28819         * driver.cs: New flag --checked, allows to turn on integer math
28820         checking. 
28821
28822         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28823         Threading.Monitor.Exit 
28824
28825 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28826
28827         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28828         Expression Class to be IndexerAccess.
28829
28830         Notice that Indexer::DoResolve sets the eclass to Value.
28831
28832 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28833
28834         * class.cs (TypeContainer::Emit): Emit code for indexers.
28835
28836         * assign.cs (IAssignMethod): New interface implemented by Indexers
28837         and Properties for handling assignment.
28838
28839         (Assign::Emit): Simplify and reuse code. 
28840
28841         * expression.cs (IndexerAccess, PropertyExpr): Implement
28842         IAssignMethod, clean up old code. 
28843
28844 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28845
28846         * typemanager.cs (ImplementsInterface): New method to determine if a type
28847         implements a given interface. Provides a nice cache too.
28848
28849         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28850         method.
28851
28852         (ConvertReferenceExplicit): Ditto.
28853
28854         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28855         various methods, with correct names etc.
28856
28857         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28858         Operator.UnaryNegation.
28859
28860         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28861         we have a unary plus or minus operator.
28862
28863         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28864         UnaryMinus.
28865
28866         * everywhere : update accordingly.
28867
28868         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28869         respectively.
28870
28871         * class.cs (Method::Define): For the case where we are implementing a method
28872         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28873         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28874
28875 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28876
28877         * interface.cs (FindMembers): Implement to work around S.R.E
28878         lameness.
28879
28880         * typemanager.cs (IsInterfaceType): Implement.
28881
28882         (FindMembers): Update to handle interface types too.
28883
28884         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28885         use IsAssignableFrom as that is not correct - it doesn't work.
28886
28887         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28888         and accordingly override EmitStatement.
28889
28890         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28891         using the correct logic :-)
28892
28893 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28894
28895         * ../errors/cs-11.cs : Add to demonstrate error -11 
28896
28897 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28898
28899         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28900         then pass this as a hint to ResolveLValue.
28901
28902         * expression.cs (FieldExpr): Add Location information
28903
28904         (FieldExpr::LValueResolve): Report assignment to readonly
28905         variable. 
28906
28907         (Expression::ExprClassFromMemberInfo): Pass location information.
28908
28909         (Expression::ResolveLValue): Add new method that resolves an
28910         LValue. 
28911
28912         (Expression::DoResolveLValue): Default invocation calls
28913         DoResolve. 
28914
28915         (Indexers): New class used to keep track of indexers in a given
28916         Type. 
28917
28918         (IStackStore): Renamed from LValue, as it did not really describe
28919         what this did.  Also ResolveLValue is gone from this interface and
28920         now is part of Expression.
28921
28922         (ElementAccess): Depending on the element access type
28923
28924         * typemanager.cs: Add `indexer_name_type' as a Core type
28925         (System.Runtime.CompilerServices.IndexerNameAttribute)
28926
28927         * statement.cs (Goto): Take a location.
28928
28929 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28930
28931         * delegate.cs (Delegate::VerifyDelegate): New method to verify
28932         if two delegates are compatible.
28933
28934         (NewDelegate::DoResolve): Update to take care of the case when
28935         we instantiate a delegate from another delegate.
28936
28937         * typemanager.cs (FindMembers): Don't even try to look up members
28938         of Delegate types for now.
28939
28940 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28941
28942         * delegate.cs (NewDelegate): New class to take care of delegate
28943         instantiation.
28944
28945         * expression.cs (New): Split the delegate related code out into 
28946         the NewDelegate class.
28947
28948         * delegate.cs (DelegateInvocation): New class to handle delegate 
28949         invocation.
28950
28951         * expression.cs (Invocation): Split out delegate related code into
28952         the DelegateInvocation class.
28953
28954 2001-10-17  Ravi Pratap  <ravi@ximian.com>
28955
28956         * expression.cs (New::DoResolve): Implement delegate creation fully
28957         and according to the spec.
28958
28959         (New::DoEmit): Update to handle delegates differently.
28960
28961         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28962         because of which we were printing out arguments in reverse order !
28963
28964         * delegate.cs (VerifyMethod): Implement to check if the given method
28965         matches the delegate.
28966
28967         (FullDelegateDesc): Implement.
28968
28969         (VerifyApplicability): Implement.
28970
28971         * expression.cs (Invocation::DoResolve): Update to accordingly handle
28972         delegate invocations too.
28973
28974         (Invocation::Emit): Ditto.
28975
28976         * ../errors/cs1593.cs : Added.
28977
28978         * ../errors/cs1594.cs : Added.
28979
28980         * delegate.cs (InstanceExpression, TargetMethod): New properties.
28981
28982 2001-10-16  Ravi Pratap  <ravi@ximian.com>
28983
28984         * typemanager.cs (intptr_type): Core type for System.IntPtr
28985
28986         (InitCoreTypes): Update for the same.
28987
28988         (iasyncresult_type, asynccallback_type): Ditto.
28989
28990         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28991         correct.
28992
28993         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28994         too.
28995
28996         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28997         the builders for the 4 members of a delegate type :-)
28998
28999         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29000         type.
29001
29002         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29003
29004         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29005
29006 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29007
29008         * statement.cs (Break::Emit): Implement.   
29009         (Continue::Emit): Implement.
29010
29011         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29012         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29013         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29014         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29015         end loop
29016
29017         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29018         properties that track the label for the current loop (begin of the
29019         loop and end of the loop).
29020
29021 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29022
29023         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29024         use of emitting anything at all.
29025
29026         * class.cs, rootcontext.cs : Get rid of calls to the same.
29027
29028         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29029
29030         (Populate): Define the constructor correctly and set the implementation
29031         attributes.
29032
29033         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29034         have been defined.
29035
29036         (AddDelegateType): Implement.
29037
29038         (IsDelegateType): Implement helper method.
29039
29040         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29041
29042         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29043         and accordingly handle it.
29044
29045         * delegate.cs (Populate): Take TypeContainer argument.
29046         Implement bits to define the Invoke method. However, I still haven't figured out
29047         how to take care of the native int bit :-(
29048
29049         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29050         Qualify the name of the delegate, not its return type !
29051
29052         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29053         conversion.
29054
29055         (StandardConversionExists): Checking for array types turns out to be recursive.
29056
29057         (ConvertReferenceExplicit): Implement array conversion.
29058
29059         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29060
29061 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29062
29063         * cs-parser.jay (delegate_declaration): Store the fully qualified
29064         name as it is a type declaration.
29065
29066         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29067         readonly.
29068
29069         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29070         as TypeContainer::DefineType.
29071
29072         (Populate): Method in which all the definition of the various methods (Invoke)
29073         etc is done.
29074
29075         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29076         see.
29077
29078         (CloseDelegate): Finally creates the delegate.
29079
29080         * class.cs (TypeContainer::DefineType): Update to define delegates.
29081         (Populate, Emit and CloseType): Do the same thing here too.
29082
29083         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29084         delegates in all these operations.
29085
29086 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29087
29088         * expression.cs: LocalTemporary: a new expression used to
29089         reference a temporary that has been created.
29090
29091         * assign.cs: Handle PropertyAccess back here, so that we can
29092         provide the proper semantic access to properties.
29093
29094         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29095         a few more explicit conversions. 
29096
29097         * modifiers.cs: `NEW' modifier maps to HideBySig.
29098
29099         * expression.cs (PropertyExpr): Make this into an
29100         ExpressionStatement, and support the EmitStatement code path. 
29101
29102         Perform get/set error checking, clean up the interface.
29103
29104         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29105         them into toplevel access objects.
29106
29107 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29108
29109         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29110         SRE.
29111
29112         * typemanager.cs: Keep track here of our PropertyBuilders again to
29113         work around lameness in SRE.
29114
29115 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29116
29117         * expression.cs (LValue::LValueResolve): New method in the
29118         interface, used to perform a second resolution pass for LValues. 
29119
29120         (This::DoResolve): Catch the use of this in static methods.
29121
29122         (This::LValueResolve): Implement.
29123
29124         (This::Store): Remove warning, assigning to `this' in structures
29125         is 
29126
29127         (Invocation::Emit): Deal with invocation of
29128         methods on value types.  We need to pass the address to structure
29129         methods rather than the object itself.  (The equivalent code to
29130         emit "this" for structures leaves the entire structure on the
29131         stack instead of a pointer to it). 
29132
29133         (ParameterReference::DoResolve): Compute the real index for the
29134         argument based on whether the method takes or not a `this' pointer
29135         (ie, the method is static).
29136
29137         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29138         value types returned from functions when we need to invoke a
29139         method on the sturcture.
29140
29141
29142 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29143
29144         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29145         defining the type in the Modulebuilder or Typebuilder. This is to take
29146         care of nested types which need to be defined on the TypeBuilder using
29147         DefineNestedMethod.
29148
29149         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29150         methods in RootContext, only ported to be part of TypeContainer.
29151
29152         (TypeContainer::GetInterfaceOrClass): Ditto.
29153
29154         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29155
29156         * interface.cs (Interface::DefineInterface): New method. Does exactly
29157         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29158         too.
29159
29160         (Interface::GetInterfaces): Move from RootContext here and port.
29161
29162         (Interface::GetInterfaceByName): Same here.
29163
29164         * rootcontext.cs (ResolveTree): Re-write.
29165
29166         (PopulateTypes): Re-write.
29167
29168         * class.cs (TypeContainer::Populate): Populate nested types too.
29169         (TypeContainer::Emit): Emit nested members too.
29170
29171         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29172         instead just use the name argument passed in as it is already fully
29173         qualified.
29174
29175         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29176         to TypeContainer mapping to see if a type is user-defined.
29177
29178         * class.cs (TypeContainer::CloseType): Implement. 
29179
29180         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29181         the default constructor.
29182
29183         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29184         twice.
29185
29186         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29187
29188         * interface.cs (CloseType): Create the type here.
29189
29190         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29191         the hierarchy.
29192
29193         Remove all the methods which are now in TypeContainer.
29194
29195 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29196
29197         * delegate.cs (Define): Re-write bits to define the delegate
29198         correctly.
29199
29200 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29201
29202         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29203
29204         * expression.cs (ImplicitReferenceConversion): handle null as well
29205         as a source to convert to any reference type.
29206
29207         * statement.cs (Return): Perform any implicit conversions to
29208         expected return type.  
29209
29210         Validate use of return statement.  
29211
29212         * codegen.cs (EmitContext): Pass the expected return type here.
29213
29214         * class.cs (Method, Constructor, Property): Pass expected return
29215         type to EmitContext.
29216
29217 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29218
29219         * expression.cs: Make DoResolve take an EmitContext instead of a
29220         TypeContainer.
29221
29222         Replaced `l' and `location' for `loc', for consistency.
29223
29224         (Error, Warning): Remove unneeded Tc argument.
29225
29226         * assign.cs, literal.cs, constant.cs: Update to new calling
29227         convention. 
29228
29229         * codegen.cs: EmitContext now contains a flag indicating whether
29230         code is being generated in a static method or not.
29231
29232         * cs-parser.jay: DecomposeQI, new function that replaces the old
29233         QualifiedIdentifier.  Now we always decompose the assembled
29234         strings from qualified_identifier productions into a group of
29235         memberaccesses.
29236
29237 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29238
29239         * rootcontext.cs: Deal with field-less struct types correctly now
29240         by passing the size option to Define Type.
29241
29242         * class.cs: Removed hack that created one static field. 
29243
29244 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29245
29246         * statement.cs: Moved most of the code generation here. 
29247
29248 2001-10-09  Ravi Pratap  <ravi@ximian.com>
29249
29250         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29251         seem very right.
29252
29253         (ElementAccess): Remove useless bits for now - keep checks as the spec
29254         says.
29255
29256 2001-10-08  Ravi Pratap  <ravi@ximian.com>
29257
29258         * expression.cs (ElementAccess::DoResolve): Remove my crap code
29259         and start performing checks according to the spec.
29260
29261 2001-10-07  Ravi Pratap  <ravi@ximian.com>
29262
29263         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29264         rank_specifiers instead.
29265
29266         (rank_specifiers): Change the order in which the rank specifiers are stored
29267
29268         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29269
29270         * expression.cs (ElementAccess): Implement the LValue interface too.
29271
29272 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29273
29274         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29275         except that user defined conversions are not included.
29276
29277         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29278         perform the conversion of the return type, if necessary.
29279
29280         (New::DoResolve): Check whether we are creating an array or an object
29281         and accordingly do the needful.
29282
29283         (New::Emit): Same here.
29284
29285         (New::DoResolve): Implement guts of array creation.
29286
29287         (New::FormLookupType): Helper function.
29288
29289 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29290
29291         * codegen.cs: Removed most of the code generation here, and move the
29292         corresponding code generation bits to the statement classes. 
29293
29294         Added support for try/catch/finalize and throw.
29295
29296         * cs-parser.jay: Added support for try/catch/finalize.
29297
29298         * class.cs: Catch static methods having the flags override,
29299         virtual or abstract.
29300
29301         * expression.cs (UserCast): This user cast was not really doing
29302         what it was supposed to do.  Which is to be born in fully resolved
29303         state.  Parts of the resolution were being performed at Emit time! 
29304
29305         Fixed this code.
29306
29307 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29308
29309         * expression.cs: Implicity convert the result from UserCast.
29310
29311 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29312
29313         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29314         prevented it from working correctly. 
29315
29316         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29317         merely ConvertImplicit.
29318
29319 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29320
29321         * typemanager.cs: Make the LookupTypeContainer function static,
29322         and not per-instance.  
29323
29324         * class.cs: Make static FindMembers (the one that takes a Type
29325         argument). 
29326
29327         * codegen.cs: Add EmitForeach here.
29328
29329         * cs-parser.jay: Make foreach a toplevel object instead of the
29330         inline expansion, as we need to perform semantic analysis on it. 
29331
29332 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29333
29334         * expression.cs (Expression::ImplicitUserConversion): Rename to
29335         UserDefinedConversion.
29336
29337         (Expression::UserDefinedConversion): Take an extra argument specifying 
29338         whether we look for explicit user conversions too.
29339
29340         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29341
29342         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29343
29344         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29345         with the appropriate arguments.
29346
29347         * cs-parser.jay (cast_expression): Record location too.
29348
29349         * expression.cs (Cast): Record location info.
29350
29351         (Expression::ConvertExplicit): Take location argument.
29352
29353         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29354         to determine if we are doing explicit conversions.
29355
29356         (UserCast::Emit): Update accordingly.
29357
29358         (Expression::ConvertExplicit): Report an error if everything fails.
29359
29360         * ../errors/cs0030.cs : Add.
29361
29362 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29363
29364         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29365         virtual and newslot bits. 
29366
29367         * class.cs (TypeContainer::RegisterRequiredImplementations):
29368         Record methods we need.
29369
29370         (TypeContainer::MakeKey): Helper function to make keys for
29371         MethodBases, since the Methodbase key is useless.
29372
29373         (TypeContainer::Populate): Call RegisterRequiredImplementations
29374         before defining the methods.   
29375
29376         Create a mapping for method_builders_to_methods ahead of time
29377         instead of inside a tight loop.
29378
29379         (::RequireMethods):  Accept an object as the data to set into the
29380         hashtable so we can report interface vs abstract method mismatch.
29381
29382 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29383
29384         * report.cs: Make all of it static.
29385
29386         * rootcontext.cs: Drop object_type and value_type computations, as
29387         we have those in the TypeManager anyways.
29388
29389         Drop report instance variable too, now it is a global.
29390
29391         * driver.cs: Use try/catch on command line handling.
29392
29393         Add --probe option to debug the error reporting system with a test
29394         suite. 
29395
29396         * report.cs: Add support for exiting program when a probe
29397         condition is reached.
29398
29399 2001-10-03  Ravi Pratap  <ravi@ximian.com>
29400
29401         * expression.cs (Binary::DoNumericPromotions): Fix the case when
29402         we do a forcible conversion regardless of type, to check if 
29403         ForceConversion returns a null.
29404
29405         (Binary::error19): Use location to report error.
29406
29407         (Unary::error23): Use location here too.
29408
29409         * ../errors/cs0019.cs : Check in.
29410
29411         * ../errors/cs0023.cs : Check in.
29412
29413         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29414         case of a non-null MethodInfo object with a length of 0 !
29415
29416         (Binary::ResolveOperator): Flag error if overload resolution fails to find
29417         an applicable member - according to the spec :-)
29418         Also fix logic to find members in base types.
29419
29420         (Unary::ResolveOperator): Same here.
29421
29422         (Unary::report23): Change name to error23 and make first argument a TypeContainer
29423         as I was getting thoroughly confused between this and error19 :-)
29424
29425         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29426         (::FindMostEncompassedType): Implement.
29427         (::FindMostEncompassingType): Implement.
29428         (::StandardConversionExists): Implement.
29429
29430         (UserImplicitCast): Re-vamp. We now need info about most specific
29431         source and target types so that we can do the necessary conversions.
29432
29433         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29434         mathematical union with no duplicates.
29435
29436 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29437
29438         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29439         in order from base classes to child classes, so that we can in
29440         child classes look up in our parent for method names and
29441         attributes (required for handling abstract, virtual, new, override
29442         constructs: we need to instrospect our base class, and if we dont
29443         populate the classes in order, the introspection might be
29444         incorrect.  For example, a method could query its parent before
29445         the parent has any methods and would determine that the parent has
29446         no abstract methods (while it could have had them)).
29447
29448         (RootContext::CreateType): Record the order in which we define the
29449         classes.
29450
29451 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
29452
29453         * class.cs (TypeContainer::Populate): Also method definitions can
29454         fail now, keep track of this.
29455
29456         (TypeContainer::FindMembers): Implement support for
29457         DeclaredOnly/noDeclaredOnly flag.
29458
29459         (Constructor::Emit) Return the ConstructorBuilder.
29460
29461         (Method::Emit) Return the MethodBuilder. 
29462         Check for abstract or virtual methods to be public.
29463
29464         * rootcontext.cs (RootContext::CreateType): Register all the
29465         abstract methods required for the class to be complete and the
29466         interface methods that must be implemented. 
29467
29468         * cs-parser.jay: Report error 501 (method requires body if it is
29469         not marked abstract or extern).
29470
29471         * expression.cs (TypeOf::Emit): Implement.
29472
29473         * typemanager.cs: runtime_handle_type, new global type.
29474
29475         * class.cs (Property::Emit): Generate code for properties.
29476
29477 2001-10-02  Ravi Pratap  <ravi@ximian.com>
29478
29479         * expression.cs (Unary::ResolveOperator): Find operators on base type
29480         too - we now conform exactly to the spec.
29481
29482         (Binary::ResolveOperator): Same here.
29483
29484         * class.cs (Operator::Define): Fix minor quirk in the tests.
29485
29486         * ../errors/cs0215.cs : Added.
29487
29488         * ../errors/cs0556.cs : Added.
29489
29490         * ../errors/cs0555.cs : Added.
29491
29492 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29493
29494         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29495         single integer which is really efficient
29496
29497 2001-10-01  Ravi Pratap  <ravi@ximian.com>
29498
29499         *  expression.cs (Expression::ImplicitUserConversion): Use location
29500         even in the case when we are examining True operators.
29501  
29502         * class.cs (Operator::Define): Perform extensive checks to conform
29503         with the rules for operator overloading in the spec.
29504
29505         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29506         some of the other conversions mentioned in the spec.
29507
29508         * typemanager.cs (array_type): New static member for the System.Array built-in
29509         type.
29510
29511         (cloneable_interface): For System.ICloneable interface.
29512
29513         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29514         we start resolving the tree and populating types.
29515
29516         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29517  
29518 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29519
29520         * expression.cs (Expression::ExprClassFromMemberInfo,
29521         Expression::Literalize): Create literal expressions from
29522         FieldInfos which are literals.
29523
29524         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29525         type casts, because they were wrong.  The test suite in tests
29526         caught these ones.
29527
29528         (ImplicitNumericConversion): ushort to ulong requires a widening
29529         cast. 
29530
29531         Int32 constant to long requires widening cast as well.
29532
29533         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29534         for integers because the type on the stack is not i4.
29535
29536 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29537
29538         * expression.cs (report118): require location argument. 
29539
29540         * parameter.cs: Do not dereference potential null value.
29541
29542         * class.cs: Catch methods that lack the `new' keyword when
29543         overriding a name.  Report warnings when `new' is used without
29544         anything being there to override.
29545
29546         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29547
29548         * class.cs: Only add constructor to hashtable if it is non-null
29549         (as now constructors can fail on define).
29550
29551         (TypeManager, Class, Struct): Take location arguments.
29552
29553         Catch field instance initialization in structs as errors.
29554
29555         accepting_filter: a new filter for FindMembers that is static so
29556         that we dont create an instance per invocation.
29557
29558         (Constructor::Define): Catch errors where a struct constructor is
29559         parameterless 
29560
29561         * cs-parser.jay: Pass location information for various new
29562         constructs. 
29563
29564         * delegate.cs (Delegate): take a location argument.
29565
29566         * driver.cs: Do not call EmitCode if there were problesm in the
29567         Definition of the types, as many Builders wont be there. 
29568
29569         * decl.cs (Decl::Decl): Require a location argument.
29570
29571         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29572         into integers, and find the most appropiate integer for it.
29573
29574         * literal.cs: Implement ULongLiteral.
29575
29576         * rootcontext.cs: Provide better information about the location of
29577         failure when CreateType fails.
29578
29579 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29580
29581         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29582         as well.
29583
29584         * expression.cs (Binary::CheckShiftArguments): Add missing type
29585         computation.
29586         (Binary::ResolveOperator): Add type to the logical and and logical
29587         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29588         before.
29589
29590         (Binary::DoNumericPromotions): In the case where either argument
29591         is ulong (and most signed types combined with ulong cause an
29592         error) perform implicit integer constant conversions as well.
29593
29594 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29595
29596         * expression.cs (UserImplicitCast): Method should always be
29597         non-null. 
29598         (Invocation::BetterConversion): Simplified test for IntLiteral.
29599
29600         (Expression::ImplicitNumericConversion): Split this routine out.
29601         Put the code that performs implicit constant integer conversions
29602         here. 
29603
29604         (Expression::Resolve): Become a wrapper around DoResolve so we can
29605         check eclass and type being set after resolve.
29606
29607         (Invocation::Badness): Remove this dead function
29608
29609         (Binary::ResolveOperator): Do not compute the expensive argumnets
29610         unless we have a union for it.
29611
29612         (Probe::Emit): Is needs to do an isinst and then
29613         compare against null.
29614
29615         (::CanConvert): Added Location argument.  If the Location argument
29616         is null (Location.Null), then we do not report errors.  This is
29617         used by the `probe' mechanism of the Explicit conversion.  We do
29618         not want to generate an error for something that the user
29619         explicitly requested to be casted.  But the pipeline for an
29620         explicit cast first tests for potential implicit casts.
29621
29622         So for now, if the Location is null, it means `Probe only' to
29623         avoid adding another argument.   Might have to revise this
29624         strategy later.
29625
29626         (ClassCast): New class used to type cast objects into arbitrary
29627         classes (used in Explicit Reference Conversions).
29628
29629         Implement `as' as well.
29630
29631         Reverted all the patches from Ravi below: they were broken:
29632
29633                 * The use of `level' as a mechanism to stop recursive
29634                   invocations is wrong.  That was there just to catch the
29635                   bug with a strack trace but not as a way of addressing
29636                   the problem.
29637
29638                   To fix the problem we have to *understand* what is going
29639                   on and the interactions and come up with a plan, not
29640                   just get things going.
29641
29642                 * The use of the type conversion cache that I proposed
29643                   last night had an open topic: How does this work across
29644                   protection domains.  A user defined conversion might not
29645                   be public in the location where we are applying the
29646                   conversion, a different conversion might be selected
29647                   (ie, private A->B (better) but public B->A (worse),
29648                   inside A, A->B applies, but outside it, B->A will
29649                   apply).
29650
29651                 * On top of that (ie, even if the above is solved),
29652                   conversions in a cache need to be abstract.  Ie, `To
29653                   convert from an Int to a Short use an OpcodeCast', not
29654                   `To convert from an Int to a Short use the OpcodeCast on
29655                   the variable 5' (which is what this patch was doing).
29656
29657 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29658
29659         * expression.cs (Invocation::ConversionExists): Re-write to use
29660         the conversion cache
29661
29662         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29663         cache all conversions done, not just user-defined ones.
29664
29665         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29666         to determine if a conversion exists instead of acutually trying to 
29667         perform the conversion. It's faster too.
29668
29669         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29670         and only then attempt the implicit conversion.
29671
29672 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29673
29674         * expression.cs (ConvertImplicit): Use a cache for conversions
29675         already found. Check level of recursion and bail out if necessary.
29676
29677 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29678
29679         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29680         Export standard methods that we expect for string operations.
29681
29682         * statement.cs (Block::UsageWarning): Track usage of variables and
29683         report the errors for not used variables.
29684
29685         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29686         operator. 
29687
29688 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29689
29690         * codegen.cs: remove unnneded code 
29691
29692         * expression.cs: Removed BuiltinTypeAccess class
29693
29694         Fix the order in which implicit conversions are
29695         done.  
29696
29697         The previous fixed dropped support for boxed conversions (adding a
29698         test to the test suite now)
29699
29700         (UserImplicitCast::CanConvert): Remove test for source being null,
29701         that code is broken.  We should not feed a null to begin with, if
29702         we do, then we should track the bug where the problem originates
29703         and not try to cover it up here.
29704
29705         Return a resolved expression of type UserImplicitCast on success
29706         rather than true/false.  Ravi: this is what I was talking about,
29707         the pattern is to use a static method as a "constructor" for
29708         objects. 
29709
29710         Also, do not create arguments until the very last minute,
29711         otherwise we always create the arguments even for lookups that
29712         will never be performed. 
29713
29714         (UserImplicitCast::Resolve): Eliminate, objects of type
29715         UserImplicitCast are born in a fully resolved state. 
29716
29717         * typemanager.cs (InitCoreTypes): Init also value_type
29718         (System.ValueType). 
29719
29720         * expression.cs (Cast::Resolve): First resolve the child expression.
29721
29722         (LValue): Add new method AddressOf to be used by
29723         the `&' operator.  
29724
29725         Change the argument of Store to take an EmitContext instead of an
29726         ILGenerator, because things like FieldExpr need to be able to call
29727         their children expression to generate the instance code. 
29728
29729         (Expression::Error, Expression::Warning): Sugar functions for
29730         reporting errors.
29731
29732         (Expression::MemberLookup): Accept a TypeContainer instead of a
29733         Report as the first argument.
29734
29735         (Expression::ResolvePrimary): Killed.  I still want to improve
29736         this as currently the code is just not right.
29737
29738         (Expression::ResolveMemberAccess): Simplify, but it is still
29739         wrong. 
29740
29741         (Unary::Resolve): Catch errors in AddressOf operators.
29742
29743         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29744         index to a byte for the short-version, or the compiler will choose
29745         the wrong Emit call, which generates the wrong data.
29746
29747         (ParameterReference::Emit, ::Store): same.
29748
29749         (FieldExpr::AddressOf): Implement.
29750
29751         * typemanager.cs: TypeManager: made public variable instead of
29752         property.
29753
29754         * driver.cs: document --fatal.
29755
29756         * report.cs (ErrorMessage, WarningMessage): new names for the old
29757         Error and Warning classes.
29758
29759         * cs-parser.jay (member_access): Turn built-in access to types
29760         into a normal simplename
29761
29762 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29763
29764         * expression.cs (Invocation::BetterConversion): Fix to cope
29765         with q being null, since this was introducing a bug.
29766
29767         * expression.cs (ConvertImplicit): Do built-in conversions first.
29768
29769 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29770
29771         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29772
29773 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29774
29775         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29776         I had introduced long ago (what's new ?).
29777
29778         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29779         the work of all the checking. 
29780         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29781         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29782
29783         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29784         that is the right way. 
29785
29786         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29787         overloading resolution. Use everywhere instead of cutting and pasting code.
29788
29789         (Binary::ResolveOperator): Use MakeUnionSet.
29790
29791         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29792         we have to convert to bool types. Not complete yet.
29793
29794 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29795
29796         * typemanager.cs (TypeManager::CSharpName): support ushort.
29797
29798         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29799         to provide an expression that performsn an implicit constant int
29800         conversion (section 6.1.6).
29801         (Expression::ConvertImplicitRequired): Reworked to include
29802         implicit constant expression conversions.
29803
29804         (Expression::ConvertNumericExplicit): Finished.
29805
29806         (Invocation::Emit): If InstanceExpression is null, then it means
29807         that we perform a call on this.
29808
29809 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29810
29811         * expression.cs (Unary::Emit): Remove some dead code.
29812         (Probe): Implement Resolve and Emit for `is'.
29813         (Expression::ConvertImplicitRequired): Attempt to do constant
29814         expression conversions here.  Maybe should be moved to
29815         ConvertImplicit, but I am not sure.
29816         (Expression::ImplicitLongConstantConversionPossible,
29817         Expression::ImplicitIntConstantConversionPossible): New functions
29818         that tell whether is it possible to apply an implicit constant
29819         expression conversion.
29820
29821         (ConvertNumericExplicit): Started work on explicit numeric
29822         conversions.
29823
29824         * cs-parser.jay: Update operator constants.
29825
29826         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29827         (Parameters::GetSignature): Hook up VerifyArgs here.
29828         (Parameters::VerifyArgs): Verifies that no two arguments have the
29829         same name. 
29830
29831         * class.cs (Operator): Update the operator names to reflect the
29832         ones that the spec expects (as we are just stringizing the
29833         operator names).
29834
29835         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29836         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29837         previous usage did only work for our methods.
29838         (Expression::ConvertImplicit): Handle decimal implicit numeric
29839         conversions as well.
29840         (Expression::InternalTypeConstructor): Used to invoke constructors
29841         on internal types for default promotions.
29842
29843         (Unary::Emit): Implement special handling for the pre/post
29844         increment/decrement for overloaded operators, as they need to have
29845         the same semantics as the other operators.
29846
29847         (Binary::ResolveOperator): ditto.
29848         (Invocation::ConversionExists): ditto.
29849         (UserImplicitCast::Resolve): ditto.
29850
29851 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29852
29853         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29854         operator, return after emitting body. Regression tests pass again !
29855
29856         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29857         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29858         (Invocation::OverloadResolve): Ditto.
29859         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29860
29861         * everywhere : update calls to the above methods accordingly.
29862
29863 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29864
29865         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29866
29867         * expression.cs (ExpressionStatement): New base class used for
29868         expressions that can appear in statements, so that we can provide
29869         an alternate path to generate expression that do not leave a value
29870         on the stack.
29871
29872         (Expression::Emit, and all the derivatives): We no longer return
29873         whether a value is left on the stack or not.  Every expression
29874         after being emitted leaves a single value on the stack.
29875
29876         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29877         facilties of ExpressionStatement if possible.
29878
29879         * cs-parser.jay: Update statement_expression.
29880
29881 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29882
29883         * driver.cs: Change the wording of message
29884
29885 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29886
29887         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29888         the type of the expression to the return type of the method if
29889         we have an overloaded operator match ! The regression tests pass again !
29890         (Unary::ResolveOperator): Ditto.
29891
29892         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29893         to find "op_Implicit", not "implicit" ;-)
29894         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29895         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29896
29897         * everywhere : Correct calls to the above accordingly.
29898
29899         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29900         (ConvertImplicit): Do user-defined conversion if it exists.
29901
29902 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29903
29904         * assign.cs: track location.
29905         (Resolve): Use implicit conversions on assignment.
29906
29907         * literal.cs: Oops.  Not good, Emit of short access values should
29908         pass (Bytes) or the wrong argument will be selected.
29909
29910         * expression.cs (Unary::Emit): Emit code for -expr.
29911
29912         (Unary::ResolveOperator): Handle `Substract' for non-constants
29913         (substract from zero from the non-constants).
29914         Deal with Doubles as well. 
29915
29916         (Expression::ConvertImplicitRequired): New routine that reports an
29917         error if no implicit conversion exists. 
29918
29919         (Invocation::OverloadResolve): Store the converted implicit
29920         expressions if we make them
29921
29922 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29923
29924         * class.cs (ConstructorInitializer): Take a Location argument.
29925         (ConstructorBaseInitializer): Same here.
29926         (ConstructorThisInitializer): Same here.
29927
29928         * cs-parser.jay : Update all calls accordingly.
29929
29930         * expression.cs (Unary, Binary, New): Take location argument.
29931         Update accordingly everywhere.
29932
29933         * cs-parser.jay : Update all calls to the above to take a location
29934         argument.
29935
29936         * class.cs : Ditto.
29937
29938 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29939
29940         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29941         (Invocation::BetterConversion): Same here
29942         (Invocation::ConversionExists): Ditto.
29943
29944         (Invocation::ConversionExists): Implement.
29945
29946 2001-09-22  Ravi Pratap  <ravi@ximian.com>
29947
29948         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29949         Also take an additional TypeContainer argument.
29950
29951         * All over : Pass in TypeContainer as argument to OverloadResolve.
29952
29953         * typemanager.cs (CSharpName): Update to check for the string type and return
29954         that too.
29955
29956         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29957         a given method.
29958
29959 2001-09-21  Ravi Pratap  <ravi@ximian.com>
29960
29961         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29962         (Invocation::BetterFunction): Implement.
29963         (Invocation::BetterConversion): Implement.
29964         (Invocation::ConversionExists): Skeleton, no implementation yet.
29965
29966         Okay, things work fine !
29967
29968 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
29969
29970         * typemanager.cs: declare and load enum_type, delegate_type and
29971         void_type. 
29972
29973         * expression.cs (Expression::Emit): Now emit returns a value that
29974         tells whether a value is left on the stack or not.  This strategy
29975         might be reveted tomorrow with a mechanism that would address
29976         multiple assignments.
29977         (Expression::report118): Utility routine to report mismatches on
29978         the ExprClass.
29979
29980         (Unary::Report23): Report impossible type/operator combination
29981         utility function.
29982
29983         (Unary::IsIncrementableNumber): Whether the type can be
29984         incremented or decremented with add.
29985         (Unary::ResolveOperator): Also allow enumerations to be bitwise
29986         complemented. 
29987         (Unary::ResolveOperator): Implement ++, !, ~,
29988
29989         (Invocation::Emit): Deal with new Emit convetion.
29990
29991         * All Expression derivatives: Updated their Emit method to return
29992         whether they leave values on the stack or not.
29993
29994         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29995         stack for expressions that are statements. 
29996
29997 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29998
29999         * expression.cs (LValue): New interface.  Must be implemented by
30000         LValue objects.
30001         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30002         LValue interface.
30003
30004         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30005         interface for generating code, simplifies the code.
30006
30007 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30008
30009         * expression.cs (everywhere): Comment out return statements in ::Resolve
30010         methods to avoid the warnings.
30011
30012 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30013
30014         * driver.cs (parse): Report error 2001 if we can not open the
30015         source file.
30016
30017         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30018         not resolve it.
30019
30020         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30021         object. 
30022
30023         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30024         otherwise nested blocks end up with the same index.
30025
30026         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30027
30028         * expression.cs:  Instead of having FIXMEs in the Resolve
30029         functions, throw exceptions so it is obvious that we are facing a
30030         bug. 
30031
30032         * cs-parser.jay (invocation_expression): Pass Location information.
30033
30034         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30035         Use a basename for those routines because .NET does not like paths
30036         on them. 
30037
30038         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30039         already defined.
30040
30041 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30042
30043         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30044         are loading the correct data types (throws an exception if not).
30045         (TypeManager::InitCoreTypes): Use CoreLookupType
30046
30047         * expression.cs (Unary::ResolveOperator): return the child
30048         expression for expressions which are just +expr.
30049         (Unary::ResolveOperator): Return negative literals for -LITERAL
30050         expressions (otherwise they are Unary {Literal}).
30051         (Invocation::Badness): Take into account `Implicit constant
30052         expression conversions'.
30053
30054         * literal.cs (LongLiteral): Implement long literal class.
30055         (IntLiteral): export the `Value' of the intliteral. 
30056
30057 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30058
30059         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30060
30061         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30062         instead of 'Operator'
30063
30064         * expression.cs (Binary::ResolveOperator): Update accordingly.
30065         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30066         and 'Minus'
30067
30068         * cs-parser.jay (unary_expression): Update to use the new names.
30069
30070         * gen-treedump.cs (GetUnary): Same here.
30071
30072         * expression.cs (Unary::Resolve): Implement.
30073         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30074         operators are found instead of making noise ;-)
30075         (Unary::ResolveOperator): New method to do precisely the same thing which
30076         Binary::ResolveOperator does for Binary expressions.
30077         (Unary.method, .Arguments): Add.
30078         (Unary::OperName): Implement.   
30079         (Unary::ForceConversion): Copy and Paste !
30080
30081         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30082         a unary operator.
30083
30084         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30085         for the inbuilt operators. Only overloading works for now ;-)
30086
30087 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30088
30089         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30090         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30091
30092         * expression.cs (This::Emit): Implement. 
30093         (This::Resolve): Implement.
30094         (TypeOf:Resolve): Implement.
30095         (Expression::ResolveSimpleName): Add an implicit this to instance
30096         field references. 
30097         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30098         Bind instance variable to Field expressions.
30099         (FieldExpr::Instance): New field used to track the expression that
30100         represents the object instance.
30101         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30102         binding 
30103         (FieldExpr::Emit): Implement.
30104
30105         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30106         the last instruction contains a return opcode to avoid generating
30107         the last `ret' instruction (this generates correct code, and it is
30108         nice to pass the peverify output).
30109
30110         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30111         initializer for static and instance variables.
30112         (Constructor::Emit): Allow initializer to be null in the case of
30113         static constructors.  Only emit initializer for instance
30114         constructors. 
30115
30116         (TypeContainer::FindMembers): Return a null array if there are no
30117         matches.
30118
30119         Also fix the code for the MemberTypes.Method branch, as it was not
30120         scanning that for operators (or tried to access null variables before).
30121
30122         * assign.cs (Assign::Emit): Handle instance and static fields. 
30123
30124         * TODO: Updated.
30125
30126         * driver.cs: Stop compilation if there are parse errors.
30127
30128         * cs-parser.jay (constructor_declaration): Provide default base
30129         initializer for non-static constructors.
30130         (constructor_declarator): Do not provide a default base
30131         initializers if none was specified.
30132         Catch the fact that constructors should not have parameters.
30133
30134         * class.cs: Do not emit parent class initializers for static
30135         constructors, that should be flagged as an error.
30136
30137 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30138
30139         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30140         Move back code into TypeContainer::Populate.
30141
30142 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30143
30144         * class.cs (TypeContainer::AddConstructor): Fix the check to
30145         compare against Name, not Basename. 
30146         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30147
30148         * cs-parser.jay : Update accordingly.
30149
30150         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30151         for methods, don't forget to look into the operators too.
30152         (RegisterMethodBuilder): Helper method to take care of this for
30153         methods, constructors and operators.
30154         (Operator::Define): Completely revamp.
30155         (Operator.OperatorMethod, MethodName): New fields.
30156         (TypeContainer::Populate): Move the registering of builders into
30157         RegisterMethodBuilder.
30158         (Operator::Emit): Re-write.
30159
30160         * expression.cs (Binary::Emit): Comment out code path to emit method
30161         invocation stuff for the case when we have a user defined operator. I am
30162         just not able to get it right !
30163
30164 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30165
30166         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30167         argument. 
30168
30169         (Expression::MemberLookup): Provide a version that allows to
30170         specify the MemberTypes and BindingFlags. 
30171
30172         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30173         so it was not fetching variable information from outer blocks.
30174
30175         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30176         Beforefieldinit as it was buggy.
30177
30178         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30179         that Ravi put here.  
30180
30181         * class.cs (Constructor::Emit): Only emit if block is not null.
30182         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30183         deal with this by semantically definining it as if the user had
30184         done it.
30185
30186         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30187         constructors as we now "emit" them at a higher level.
30188
30189         (TypeContainer::DefineDefaultConstructor): Used to define the
30190         default constructors if none was provided.
30191
30192         (ConstructorInitializer): Add methods Resolve and Emit. 
30193
30194         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30195
30196 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30197
30198         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30199         the default constructor builder with our hashtable for methodbuilders
30200         to methodcores.
30201
30202         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30203         and argument_count is 0 in which case we have a match.
30204         (Binary::ResolveOperator): More null checking and miscellaneous coding
30205         style cleanup.
30206
30207 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30208
30209         * rootcontext.cs (IsNameSpace): Compare against null.
30210
30211         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30212
30213         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30214         and Unary::Operator.
30215
30216         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30217         accordingly.
30218
30219         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30220         we have overloaded operators.
30221         (Binary::ResolveOperator): Implement the part which does the operator overload
30222         resolution.
30223
30224         * class.cs (Operator::Emit): Implement.
30225         (TypeContainer::Emit): Emit the operators we have too.
30226
30227         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30228         the case when we have a user-defined operator.
30229
30230 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30231
30232         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30233
30234 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30235
30236         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30237         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30238         (Constructor::Emit): Implement.
30239         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30240         if we have no work to do. 
30241         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
30242         Emit method.
30243
30244         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30245         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30246
30247         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30248         of parent.parent.
30249
30250 2001-09-15  Ravi Pratap  <ravi@ximian.com>
30251
30252         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30253         in the source.
30254         (Tree::RecordNamespace): Method to do what the name says ;-)
30255         (Tree::Namespaces): Property to get at the namespaces hashtable.
30256
30257         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
30258         keep track.
30259
30260         * rootcontext.cs (IsNamespace): Fixed it :-)
30261
30262 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30263
30264         * class.cs (TypeContainer::FindMembers): Add support for
30265         constructors. 
30266         (MethodCore): New class that encapsulates both the shared aspects
30267         of a Constructor and a Method.  
30268         (Method, Constructor): Factored pieces into MethodCore.
30269
30270         * driver.cs: Added --fatal which makes errors throw exceptions.
30271         Load System assembly as well as part of the standard library.
30272
30273         * report.cs: Allow throwing exceptions on errors for debugging.
30274
30275         * modifiers.cs: Do not use `parent', instead use the real type
30276         container to evaluate permission settings.
30277
30278         * class.cs: Put Ravi's patch back in.  He is right, and we will
30279         have to cope with the
30280
30281 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30282
30283         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30284         FamORAssem, not FamANDAssem.
30285
30286 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30287
30288         * driver.cs: Added --parse option that only parses its input files
30289         and terminates.
30290
30291         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30292         incorrect.  IsTopLevel is not used to tell whether an object is
30293         root_types or not (that can be achieved by testing this ==
30294         root_types).  But to see if this is a top-level *class* (not
30295         necessarly our "toplevel" container). 
30296
30297 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30298
30299         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30300         parent instead of a direct call to GetType.
30301
30302 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30303
30304         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30305         Modifiers.TypeAttr. This should just be a call to that method.
30306
30307         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30308         object so that we can determine if we are top-level or not.
30309
30310         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30311         TypeContainer too.
30312
30313         * enum.cs (Enum::Define): Ditto.
30314
30315         * modifiers.cs (FieldAttr): Re-write.
30316
30317         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30318         (TypeContainer::HaveStaticConstructor): New property to provide access
30319         to precisely that info.
30320
30321         * modifiers.cs (MethodAttr): Re-write.
30322         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30323
30324         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30325         of top-level types as claimed.
30326
30327 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30328
30329         * expression.cs (MemberLookup): Fruitless attempt to lookup
30330         constructors.  Maybe I need to emit default constructors?  That
30331         might be it (currently .NET emits this for me automatically).
30332         (Invocation::OverloadResolve): Cope with Arguments == null.
30333         (Invocation::EmitArguments): new function, shared by the new
30334         constructor and us.
30335         (Invocation::Emit): Handle static and instance methods.  Emit
30336         proper call instruction for virtual or non-virtual invocations.
30337         (New::Emit): Implement.
30338         (New::Resolve): Implement.
30339         (MemberAccess:Resolve): Implement.
30340         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30341         to track instances.
30342         (FieldExpr::Resolve): Set type.
30343
30344         * support.cs: Handle empty arguments.
30345                 
30346         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30347         SimpleLookup): Auxiliary routines to help parse a qualifier
30348         identifier.  
30349
30350         Update qualifier_identifier rule.
30351
30352         * codegen.cs: Removed debugging messages.
30353
30354         * class.cs: Make this a global thing, this acts just as a "key" to
30355         objects that we might have around.
30356
30357         (Populate): Only initialize method_builders_to_methods once.
30358
30359         * expression.cs (PropertyExpr): Initialize type from the
30360         PropertyType. 
30361
30362         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30363         Resolve pattern.  Attempt to implicitly convert value to boolean.
30364         Emit code.
30365
30366         * expression.cs: Set the type for the int32/int32 argument case.
30367         (Binary::ResolveOperator): Set the return type to boolean for
30368         comparission operators
30369
30370         * typemanager.cs: Remove debugging print code.
30371
30372         (Invocation::Resolve): resolve type.
30373
30374         * class.cs: Allocate a MemberInfo of the correct size, as the code
30375         elsewhere depends on the test to reflect the correct contents.
30376
30377         (Method::) Keep track of parameters, due to System.Reflection holes
30378
30379         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30380         mapping here.
30381
30382         (TypeContainer::FindMembers): Use ArrayList and then copy an array
30383         of the exact size and return that.
30384
30385         (Class::LookupMethodByBuilder): New function that maps
30386         MethodBuilders to its methods.  Required to locate the information
30387         on methods because System.Reflection bit us again.
30388
30389         * support.cs: New file, contains an interface ParameterData and
30390         two implementations: ReflectionParameters and InternalParameters
30391         used to access Parameter information.  We will need to grow this
30392         as required.
30393
30394         * expression.cs (Invocation::GetParameterData): implement a cache
30395         and a wrapper around the ParameterData creation for methods. 
30396         (Invocation::OverloadResolve): Use new code.
30397
30398 2001-09-13  Ravi Pratap  <ravi@ximian.com>
30399
30400         * class.cs (TypeContainer::EmitField): Remove and move into 
30401         (Field::Define): here and modify accordingly.
30402         (Field.FieldBuilder): New member.
30403         (TypeContainer::Populate): Update accordingly.
30404         (TypeContainer::FindMembers): Implement.
30405
30406 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30407
30408         * statement.cs: (VariableInfo::VariableType): New field to be
30409         initialized with the full type once it is resolved. 
30410
30411 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
30412
30413         * parameter.cs (GetParameterInfo): Use a type cache to compute
30414         things only once, and to reuse this information
30415
30416         * expression.cs (LocalVariableReference::Emit): Implement.
30417         (OpcodeCast::Emit): fix.
30418
30419         (ParameterReference::Resolve): Implement.
30420         (ParameterReference::Emit): Implement.
30421
30422         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30423         that are expressions need to stay as Expressions.
30424
30425         * typemanager.cs (CSharpName): Returns the C# name of a type if
30426         possible. 
30427
30428         * expression.cs (Expression::ConvertImplicit): New function that
30429         implements implicit type conversions.
30430
30431         (Expression::ImplicitReferenceConversion): Implements implicit
30432         reference conversions.
30433
30434         (EmptyCast): New type for transparent casts.
30435
30436         (OpcodeCast): New type for casts of types that are performed with
30437         a sequence of bytecodes.
30438
30439         (BoxedCast): New type used for casting value types into reference
30440         types.  Emits a box opcode.
30441
30442         (Binary::DoNumericPromotions): Implements numeric promotions of
30443         and computation of the Binary::Type.
30444
30445         (Binary::EmitBranchable): Optimization.
30446
30447         (Binary::Emit): Implement code emission for expressions.
30448
30449         * typemanager.cs (TypeManager): Added two new core types: sbyte
30450         and byte.
30451
30452 2001-09-12  Ravi Pratap  <ravi@ximian.com>
30453
30454         * class.cs (TypeContainer::FindMembers): Method which does exactly
30455         what Type.FindMembers does, only we don't have to use reflection. No
30456         implementation yet.
30457
30458         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30459         typecontainer objects as we need to get at them.
30460         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30461
30462         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30463         typecontainer object.
30464
30465         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30466         of just a Report object.
30467
30468 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30469
30470         * class.cs (Event::Define): Go back to using the prefixes "add_" and
30471         "remove_"
30472         (TypeContainer::Populate): Now define the delegates of the type too.
30473         (TypeContainer.Delegates): Property to access the list of delegates defined
30474         in the type.
30475
30476         * delegates.cs (Delegate::Define): Implement partially.
30477
30478         * modifiers.cs (TypeAttr): Handle more flags.
30479
30480 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30481
30482         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30483         and not <=
30484         (Operator::Define): Re-write logic to get types by using the LookupType method
30485         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30486         (Indexer::Define): Ditto.
30487         (Event::Define): Ditto.
30488         (Property::Define): Ditto.
30489
30490 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30491
30492         * class.cs (TypeContainer::Populate): Now define operators too. 
30493         (TypeContainer.Operators): New property to access the list of operators
30494         in a type.
30495         (Operator.OperatorMethodBuilder): New member to hold the method builder
30496         for the operator we are defining.
30497         (Operator::Define): Implement.
30498
30499 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30500
30501         * class.cs (Event::Define): Make the prefixes of the accessor methods
30502         addOn_ and removeOn_ 
30503
30504         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30505         of the location being passed in too. Ideally, this should go later since all
30506         error reporting should be done through the Report object.
30507
30508         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30509         (Populate): Iterate thru the indexers we have and define them too.
30510         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30511         for the get and set accessors.
30512         (Indexer::Define): Implement.
30513
30514 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30515
30516         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30517         my previous implementation, did not work.
30518
30519         * typemanager.cs: Add a couple of missing types (the longs).
30520
30521         * literal.cs: Use TypeManager.bool_type instead of getting it.
30522
30523         * expression.cs (EventExpr): New kind of expressions.
30524         (Expressio::ExprClassFromMemberInfo): finish
30525
30526 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30527
30528         * assign.cs: Emit stores to static fields differently.
30529
30530 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30531
30532         * Merge in changes and adjust code to tackle conflicts. Backed out my
30533         code in Assign::Resolve ;-) 
30534
30535 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30536
30537         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30538         instead Report.Error and also pass in the location.
30539         (CSharpParser::Lexer): New readonly property to return the reference
30540         to the Tokenizer object.
30541         (declare_local_variables): Use Report.Error with location instead of plain 
30542         old error.
30543         (CheckDef): Ditto.
30544
30545         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30546         (Operator.CheckBinaryOperator): Ditto.
30547
30548         * cs-parser.jay (operator_declarator): Update accordingly.
30549
30550         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30551         (CheckBinaryOperator): Same here.
30552
30553         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30554         on the name without any prefixes of namespace names etc. This is because we
30555         already might have something already fully qualified like 
30556         'System.Console.WriteLine'
30557
30558         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30559
30560 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30561
30562         * cs-tokenizer.cs (location): Return a string which also contains
30563         the file name.
30564
30565         * expression.cs (ElementAccess): New class for expressions of the
30566         type 'element access.'
30567         (BaseAccess): New class for expressions of the type 'base access.'
30568         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30569         respectively.
30570
30571         * cs-parser.jay (element_access): Implement action.
30572         (base_access): Implement actions.
30573         (checked_expression, unchecked_expression): Implement.
30574
30575         * cs-parser.jay (local_variable_type): Correct and implement.
30576         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30577
30578         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30579
30580         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30581         name and the specifiers.
30582
30583         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30584
30585         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30586         making them all public ;-)
30587
30588         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30589         class anyways.
30590
30591 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30592
30593         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30594         PropertyExprs.
30595         (FieldExpr, PropertyExprs): New resolved expressions.
30596         (SimpleName::MemberStaticCheck): Perform static checks for access
30597         to non-static fields on static methods. Maybe this should be
30598         generalized for MemberAccesses. 
30599         (SimpleName::ResolveSimpleName): More work on simple name
30600         resolution. 
30601
30602         * cs-parser.jay (primary_expression/qualified_identifier): track
30603         the parameter index.
30604
30605         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30606         (EmitContext::EmitBoolExpression): Chain to expression generation
30607         instead of temporary hack.
30608         (::EmitStatementExpression): Put generic expression code generation.
30609
30610         * assign.cs (Assign::Emit): Implement variable assignments to
30611         local variables, parameters and fields.
30612
30613 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30614
30615         * statement.cs (Block::GetVariableInfo): New method, returns the
30616         VariableInfo for a variable name in a block.
30617         (Block::GetVariableType): Implement in terms of GetVariableInfo
30618
30619         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30620         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30621
30622 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30623
30624         * cs-parser.jay (operator_declaration): Continue on my quest : update
30625         to take attributes argument.
30626         (event_declaration): Ditto.
30627         (enum_declaration): Ditto.
30628         (indexer_declaration): Ditto.
30629
30630         * class.cs (Operator::Operator): Update constructor accordingly.
30631         (Event::Event): Ditto.
30632
30633         * delegate.cs (Delegate::Delegate): Same here.
30634
30635         * enum.cs (Enum::Enum): Same here.
30636
30637 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30638
30639         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30640
30641         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30642
30643         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30644         being passed around as an arraylist.
30645         (Attributes::AddAttribute): Method to add attribute sections.
30646
30647         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30648         (struct_declaration): Update accordingly.
30649         (constant_declaration): Update.
30650         (field_declaration): Update.
30651         (method_header): Update.
30652         (fixed_parameter): Update.
30653         (parameter_array): Ditto.
30654         (property_declaration): Ditto.
30655         (destructor_declaration): Ditto.
30656
30657         * class.cs (Struct::Struct): Update constructors accordingly.
30658         (Class::Class): Ditto.
30659         (Field::Field): Ditto.
30660         (Method::Method): Ditto.
30661         (Property::Property): Ditto.
30662         (TypeContainer::OptAttribute): update property's return type.
30663
30664         * interface.cs (Interface.opt_attributes): New member.
30665         (Interface::Interface): Update to take the extra Attributes argument.
30666
30667         * parameter.cs (Parameter::Parameter): Ditto.
30668
30669         * constant.cs (Constant::Constant): Ditto.
30670
30671         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30672         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30673         the attributes as a parameter.
30674         (InterfaceProperty): Update constructor call.
30675         (InterfaceEvent): Ditto.
30676         (InterfaceMethod): Ditto.
30677         (InterfaceIndexer): Ditto.
30678
30679         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30680         pass the attributes too.
30681         (interface_event_declaration): Ditto.
30682         (interface_property_declaration): Ditto.
30683         (interface_method_declaration): Ditto.
30684         (interface_declaration): Ditto.
30685
30686 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30687
30688         * class.cs (Method::Define): Track the "static Main" definition to
30689         create an entry point. 
30690
30691         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30692         EntryPoint if we find it. 
30693
30694         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30695         (EmitContext::ig): Make this variable public.
30696
30697         * driver.cs: Make the default output file be the first file name
30698         with the .exe extension.  
30699
30700         Detect empty compilations
30701
30702         Handle various kinds of output targets.  Handle --target and
30703         rename -t to --dumper.
30704
30705         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30706         methods inherited from Expression return now an Expression.  This
30707         will is used during the tree rewriting as we resolve them during
30708         semantic analysis.
30709
30710         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30711         the spec.  Missing entirely is the information about
30712         accessability of elements of it.
30713
30714         (Expression::ExprClassFromMemberInfo): New constructor for
30715         Expressions that creates a fully initialized Expression based on
30716         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30717         a Type.
30718
30719         (Invocation::Resolve): Begin implementing resolution of invocations.
30720
30721         * literal.cs (StringLiteral):  Implement Emit.
30722
30723 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30724
30725         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30726         member.
30727
30728 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30729
30730         * cs-parser.jay (attribute_arguments): Implement actions.
30731         (attribute): Fix bug in production. Implement action.
30732         (attribute_list): Implement.
30733         (attribute_target): Implement.
30734         (attribute_target_specifier, opt_target_specifier): Implement
30735         (CheckAttributeTarget): New method to check if the attribute target
30736         is valid.
30737         (attribute_section): Implement.
30738         (opt_attributes): Implement.
30739
30740         * attribute.cs : New file to handle attributes.
30741         (Attribute): Class to hold attribute info.
30742
30743         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30744         (attribute_section): Modify production to use 2 different rules to 
30745         achieve the same thing. 1 s/r conflict down !
30746         Clean out commented, useless, non-reducing dimension_separator rules.
30747
30748         * class.cs (TypeContainer.attributes): New member to hold list
30749         of attributes for a type.
30750         (Struct::Struct): Modify to take one more argument, the attribute list.
30751         (Class::Class): Ditto.
30752         (Field::Field): Ditto.
30753         (Method::Method): Ditto.
30754         (Property::Property): Ditto.
30755
30756         * cs-parser.jay (struct_declaration): Update constructor call to
30757         pass in the attributes too.
30758         (class_declaration): Ditto.
30759         (constant_declaration): Ditto.
30760         (field_declaration): Ditto.
30761         (method_header): Ditto.
30762         (fixed_parameter): Ditto.
30763         (parameter_array): Ditto.
30764         (property_declaration): Ditto.
30765
30766         * constant.cs (Constant::Constant): Update constructor similarly.
30767         Use System.Collections.
30768
30769         * parameter.cs (Parameter::Parameter): Update as above.
30770
30771 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30772
30773         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30774         (TypeContainer.delegates): New member to hold list of delegates.
30775
30776         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30777         this time as I seem to be on crack ;-)
30778
30779 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30780
30781         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30782         tell whether an identifier represents a namespace.
30783
30784         * expression.cs (NamespaceExpr): A namespace expression, used only
30785         temporarly during expression resolution.
30786         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30787         utility functions to resolve names on expressions.
30788
30789 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30790
30791         * codegen.cs: Add hook for StatementExpressions. 
30792
30793         * class.cs: Fix inverted test for static flag in methods.
30794
30795 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30796
30797         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30798         to make it coincide with MS' number.
30799         (Operator::CheckBinaryOperator): Ditto.
30800
30801         * ../errors/errors.txt : Remove error numbers added earlier.
30802
30803         * ../errors/cs1019.cs : Test case for error # 1019
30804
30805         * ../errros/cs1020.cs : Test case for error # 1020
30806
30807         * cs-parser.jay : Clean out commented cruft.
30808         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30809         used anywhere - non-reducing rule.
30810         (namespace_declarations): Non-reducing rule - comment out.
30811
30812         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30813         with TypeContainer::AddEnum.
30814
30815         * delegate.cs : New file for delegate handling classes.
30816         (Delegate): Class for declaring delegates.
30817
30818         * makefile : Update.
30819
30820         * cs-parser.jay (delegate_declaration): Implement.
30821
30822 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30823
30824         * class.cs (Event::Define): Implement.
30825         (Event.EventBuilder): New member.
30826
30827         * class.cs (TypeContainer::Populate): Update to define all enums and events
30828         we have.
30829         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30830         readonly fields for all these cases ?
30831
30832 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30833
30834         * class.cs (Property): Revamp to use the convention of making fields readonly.
30835         Accordingly modify code elsewhere.
30836
30837         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30838         the Define method of the Property class.
30839
30840         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30841         trivial bug.
30842         (TypeContainer::Populate): Update to define all the properties we have. Also
30843         define all enumerations.
30844
30845         * enum.cs (Define): Implement.
30846
30847 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30848
30849         * cs-parser.jay (overloadable_operator): The semantic value is an
30850         enum of the Operator class.
30851         (operator_declarator): Implement actions.
30852         (operator_declaration): Implement.
30853
30854         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30855         validity of definitions.
30856         (Operator::CheckBinaryOperator): Static method to check for binary operators
30857         (TypeContainer::AddOperator): New method to add an operator to a type.
30858
30859         * cs-parser.jay (indexer_declaration): Added line to actually call the
30860         AddIndexer method so it gets added ;-)
30861
30862         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30863         already taken care of by the MS compiler ?  
30864
30865 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30866
30867         * class.cs (Operator): New class for operator declarations.
30868         (Operator::OpType): Enum for the various operators.
30869
30870 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30871
30872         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30873         ostensibly handle this in semantic analysis.
30874
30875         * cs-parser.jay (general_catch_clause): Comment out
30876         (specific_catch_clauses, specific_catch_clause): Ditto.
30877         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30878         (catch_args, opt_catch_args): New productions.
30879         (catch_clause): Rewrite to use the new productions above
30880         (catch_clauses): Modify accordingly.
30881         (opt_catch_clauses): New production to use in try_statement
30882         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30883         and re-write the code in the actions to extract the specific and
30884         general catch clauses by being a little smart ;-)
30885
30886         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30887         Hooray, try and catch statements parse fine !
30888
30889 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30890
30891         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30892         string from the hashtable of variables.
30893
30894         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30895         I end up making that mistake ;-)
30896         (catch_clauses): Fixed gross error which made Key and Value of the 
30897         DictionaryEntry the same : $1 !!
30898
30899 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30900
30901         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30902
30903         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30904         when the add and remove accessors are specified. 
30905
30906 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30907
30908         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30909         information about indexer_declarator.
30910         (indexer_declarator): Implement actions.
30911         (parsing_indexer): New local boolean used to keep track of whether
30912         we are parsing indexers or properties. This is necessary because 
30913         implicit_parameters come into picture even for the get accessor in the 
30914         case of an indexer.
30915         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30916
30917         * class.cs (Indexer): New class for indexer declarations.
30918         (TypeContainer::AddIndexer): New method to add an indexer to a type.
30919         (TypeContainer::indexers): New member to hold list of indexers for the
30920         type.
30921
30922 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30923
30924         * cs-parser.jay (add_accessor_declaration): Implement action.
30925         (remove_accessor_declaration): Implement action.
30926         (event_accessors_declaration): Implement
30927         (variable_declarators): swap statements for first rule - trivial.
30928
30929         * class.cs (Event): New class to hold information about event
30930         declarations.
30931         (TypeContainer::AddEvent): New method to add an event to a type
30932         (TypeContainer::events): New member to hold list of events.
30933
30934         * cs-parser.jay (event_declaration): Implement actions.
30935
30936 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30937
30938         * cs-parser.jay (dim_separators): Implement. Make it a string
30939         concatenating all the commas together, just as they appear.
30940         (opt_dim_separators): Modify accordingly
30941         (rank_specifiers): Update accordingly. Basically do the same
30942         thing - instead, collect the brackets here.
30943         (opt_rank_sepcifiers): Modify accordingly.
30944         (array_type): Modify to actually return the complete type string
30945         instead of ignoring the rank_specifiers.
30946         (expression_list): Implement to collect the expressions
30947         (variable_initializer): Implement. We make it a list of expressions
30948         essentially so that we can handle the array_initializer case neatly too.
30949         (variable_initializer_list): Implement.
30950         (array_initializer): Make it a list of variable_initializers
30951         (opt_array_initializer): Modify accordingly.
30952
30953         * expression.cs (New::NType): Add enumeration to help us
30954         keep track of whether we have an object/delegate creation
30955         or an array creation.
30956         (New:NewType, New::Rank, New::Indices, New::Initializers): New
30957         members to hold data about array creation.
30958         (New:New): Modify to update NewType
30959         (New:New): New Overloaded contructor for the array creation
30960         case.
30961
30962         * cs-parser.jay (array_creation_expression): Implement to call
30963         the overloaded New constructor.
30964
30965 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
30966
30967         * class.cs (TypeContainer::Constructors): Return member
30968         constructors instead of returning null.
30969
30970 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
30971
30972         * typemanager.cs (InitCoreTypes): Initialize the various core
30973         types after we have populated the type manager with the user
30974         defined types (this distinction will be important later while
30975         compiling corlib.dll)
30976
30977         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30978         on Expression Classification.  Now all expressions have a method
30979         `Resolve' and a method `Emit'.
30980
30981         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30982         generation from working.     Also add some temporary debugging
30983         code. 
30984
30985 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
30986
30987         * codegen.cs: Lots of code generation pieces.  This is only the
30988         beginning, will continue tomorrow with more touches of polish.  We
30989         handle the fundamentals of if, while, do, for, return.  Others are
30990         trickier and I need to start working on invocations soon.
30991
30992         * gen-treedump.cs: Bug fix, use s.Increment here instead of
30993         s.InitStatement. 
30994
30995         * codegen.cs (EmitContext): New struct, used during code
30996         emission to keep a context.   Most of the code generation will be
30997         here. 
30998
30999         * cs-parser.jay: Add embedded blocks to the list of statements of
31000         this block.  So code generation proceeds in a top down fashion.
31001
31002 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31003
31004         * statement.cs: Add support for multiple child blocks.
31005
31006 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31007
31008         * codegen.cs (EmitCode): New function, will emit the code for a
31009         Block of code given a TypeContainer and its ILGenerator. 
31010
31011         * statement.cs (Block): Standard public readonly optimization.
31012         (Block::Block constructors): Link children. 
31013         (Block::Child): Child Linker.
31014         (Block::EmitVariables): Emits IL variable declarations.
31015
31016         * class.cs: Drop support for MethodGroups here, delay until
31017         Semantic Analysis.
31018         (Method::): Applied the same simplification that I did before, and
31019         move from Properties to public readonly fields.
31020         (Method::ParameterTypes): Returns the parameter types for the
31021         function, and implements a cache that will be useful later when I
31022         do error checking and the semantic analysis on the methods is
31023         performed.
31024         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31025         and made a method, optional argument tells whether this is a class
31026         or a structure to apply the `has-this' bit.
31027         (Method::GetCallingConvention): Implement, returns the calling
31028         convention. 
31029         (Method::Define): Defines the type, a second pass is performed
31030         later to populate the methods.
31031
31032         (Constructor::ParameterTypes): implement a cache similar to the
31033         one on Method::ParameterTypes, useful later when we do semantic
31034         analysis. 
31035
31036         (TypeContainer::EmitMethod):  New method.  Emits methods.
31037
31038         * expression.cs: Removed MethodGroup class from here.
31039
31040         * parameter.cs (Parameters::GetCallingConvention): new method.
31041
31042 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31043
31044         * class.cs (TypeContainer::Populate): Drop RootContext from the
31045         argument. 
31046
31047         (Constructor::CallingConvention): Returns the calling convention.
31048         (Constructor::ParameterTypes): Returns the constructor parameter
31049         types. 
31050
31051         (TypeContainer::AddConstructor): Keep track of default constructor
31052         and the default static constructor.
31053
31054         (Constructor::) Another class that starts using `public readonly'
31055         instead of properties. 
31056
31057         (Constructor::IsDefault): Whether this is a default constructor. 
31058
31059         (Field::) use readonly public fields instead of properties also.
31060
31061         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31062         track of static constructors;  If none is used, turn on
31063         BeforeFieldInit in the TypeAttributes. 
31064
31065         * cs-parser.jay (opt_argument_list): now the return can be null
31066         for the cases where there are no arguments. 
31067
31068         (constructor_declarator): If there is no implicit `base' or
31069         `this', then invoke the default parent constructor. 
31070
31071         * modifiers.cs (MethodAttr): New static function maps a set of
31072         modifiers flags into a MethodAttributes enum
31073         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31074         MethodAttr, TypeAttr to represent the various mappings where the
31075         modifiers are used.
31076         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31077
31078 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31079
31080         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31081         method arguments.
31082
31083         * interface.cs (PopulateIndexer): Implemented the code generator
31084         for interface indexers.
31085
31086 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31087
31088         * interface.cs (InterfaceMemberBase): Now we track the new status
31089         here.  
31090
31091         (PopulateProperty): Implement property population.  Woohoo!  Got
31092         Methods and Properties going today. 
31093
31094         Removed all the properties for interfaces, and replaced them with
31095         `public readonly' fields. 
31096
31097 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31098
31099         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31100         initialize their hashtables/arraylists only when they are needed
31101         instead of doing this always.
31102
31103         * parameter.cs: Handle refs and out parameters.
31104
31105         * cs-parser.jay: Use an ArrayList to construct the arguments
31106         instead of the ParameterCollection, and then cast that to a
31107         Parameter[] array.
31108
31109         * parameter.cs: Drop the use of ParameterCollection and use
31110         instead arrays of Parameters.
31111
31112         (GetParameterInfo): Use the Type, not the Name when resolving
31113         types. 
31114
31115 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31116
31117         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31118         and instead use public readonly fields.
31119
31120         * class.cs: Put back walking code for type containers.
31121
31122 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31123
31124         * class.cs (MakeConstant): Code to define constants.
31125
31126         * rootcontext.cs (LookupType): New function.  Used to locate types 
31127
31128
31129 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31130
31131         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31132         this System.Reflection code is.  Kudos to Microsoft
31133
31134         * typemanager.cs: Implement a type cache and avoid loading all
31135         types at boot time.  Wrap in LookupType the internals.  This made
31136         the compiler so much faster.  Wow.  I rule!
31137
31138         * driver.cs: Make sure we always load mscorlib first (for
31139         debugging purposes, nothing really important).
31140
31141         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31142         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31143
31144         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31145         on namespaces that have been imported using the `using' keyword.
31146
31147         * class.cs (TypeContainer::TypeAttr): Virtualize.
31148         (Class::TypeAttr): Return attributes suitable for this bad boy.
31149         (Struct::TypeAttr): ditto.
31150         Handle nested classes.
31151         (TypeContainer::) Remove all the type visiting code, it is now
31152         replaced with the rootcontext.cs code
31153
31154         * rootcontext.cs (GetClassBases): Added support for structs. 
31155
31156 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31157
31158         * interface.cs, statement.cs, class.cs, parameter.cs,
31159         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31160         Drop use of TypeRefs, and use strings instead.
31161
31162 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31163
31164         * rootcontext.cs: 
31165
31166         * class.cs (Struct::Struct): set the SEALED flags after
31167         checking the modifiers.
31168         (TypeContainer::TypeAttr): new property, returns the
31169         TypeAttributes for a class.  
31170
31171         * cs-parser.jay (type_list): Oops, list production was creating a
31172         new list of base types.
31173
31174         * rootcontext.cs (StdLib): New property.
31175         (GetInterfaceTypeByName): returns an interface by type name, and
31176         encapsulates error handling here.
31177         (GetInterfaces): simplified.
31178         (ResolveTree): Encapsulated all the tree resolution here.
31179         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31180         types. 
31181
31182         * driver.cs: Add support for --nostdlib, to avoid loading the
31183         default assemblies.
31184         (Main): Do not put tree resolution here. 
31185
31186         * rootcontext.cs: Beginning of the class resolution.
31187
31188 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31189
31190         * rootcontext.cs: Provide better error reporting. 
31191
31192         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31193
31194         * rootcontext.cs (CreateInterface): Handle the case where there
31195         are no parent interfaces.
31196
31197         (CloseTypes): Routine to flush types at the end.
31198         (CreateInterface): Track types.
31199         (GetInterfaces): Returns an array of Types from the list of
31200         defined interfaces.
31201
31202         * typemanager.c (AddUserType): Mechanism to track user types (puts
31203         the type on the global type hash, and allows us to close it at the
31204         end). 
31205
31206 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31207
31208         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31209         RecordInterface instead.
31210
31211         * cs-parser.jay: Updated to reflect changes above.
31212
31213         * decl.cs (Definition): Keep track of the TypeBuilder type that
31214         represents this type here.  Not sure we will use it in the long
31215         run, but wont hurt for now.
31216
31217         * driver.cs: Smaller changes to accomodate the new code.
31218
31219         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31220         when done. 
31221
31222         * rootcontext.cs (CreateInterface):  New method, used to create
31223         the System.TypeBuilder type for interfaces.
31224         (ResolveInterfaces): new entry point to resolve the interface
31225         hierarchy. 
31226         (CodeGen): Property, used to keep track of the code generator.
31227
31228 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31229
31230         * cs-parser.jay: Add a second production for delegate_declaration
31231         with `VOID'.
31232
31233         (enum_body): Put an opt_comma here instead of putting it on
31234         enum_body or enum_member_declarations so we can handle trailing
31235         commas on enumeration members.  Gets rid of a shift/reduce.
31236
31237         (type_list): Need a COMMA in the middle.
31238
31239         (indexer_declaration): Tell tokenizer to recognize get/set
31240
31241         * Remove old targets.
31242
31243         * Re-add the parser target.
31244
31245 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31246
31247         * cs-parser.jay: Add precendence rules for a number of operators
31248         ot reduce the number of shift/reduce conflicts in the grammar.
31249
31250 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31251
31252         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31253         and put it here.
31254
31255         Get rid of old crufty code.
31256
31257         * rootcontext.cs: Use this to keep track of the parsed
31258         representation and the defined types available to the program. 
31259
31260         * gen-treedump.cs: adjust for new convention.
31261
31262         * type.cs: Split out the type manager, and the assembly builder
31263         from here. 
31264
31265         * typemanager.cs: the type manager will live here now.
31266
31267         * cil-codegen.cs: And the code generator here. 
31268
31269 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31270
31271         * makefile: Fixed up for easy making.
31272
31273 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31274
31275         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31276         the 
31277
31278         (unary_expression): Expand pre_increment_expression and
31279         post_decrement_expression to reduce a shift/reduce.
31280
31281 2001-07-11  Simon Cozens
31282
31283         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31284
31285         Improve allow_keyword_as_indent name.
31286
31287 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31288
31289         * Adjustments for Beta2. 
31290
31291 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31292
31293         * decl.cs: Added `Define' abstract method.
31294         (InTransit): new property, used to catch recursive definitions. 
31295
31296         * interface.cs: Implement `Define'. 
31297
31298         * modifiers.cs: Map Modifiers.constants to
31299         System.Reflection.TypeAttribute flags.
31300
31301         * class.cs: Keep track of types and user-defined types.
31302         (BuilderInit): New method for creating an assembly
31303         (ResolveType): New function to launch the resolution process, only
31304         used by interfaces for now.
31305
31306         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31307         that are inserted into the name space. 
31308
31309 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31310
31311         * ARGH.  I have screwed up my tree so many times due to the use of
31312         rsync rather than using CVS.  Going to fix this at once. 
31313
31314         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31315         load types.
31316
31317 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31318
31319         * Experiment successful: Use System.Type rather that our own
31320         version of Type.  
31321
31322 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31323
31324         * cs-parser.jay: Removed nsAliases from here.
31325
31326         Use new namespaces, handle `using XXX;' 
31327
31328         * namespace.cs: Reimplemented namespace handling, use a recursive
31329         definition of the class.  Now we can keep track of using clauses
31330         and catch invalid using clauses.
31331
31332 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31333
31334         * gen-treedump.cs: Adapted for all the renaming.
31335
31336         * expression.cs (Expression): this class now has a Type property
31337         which returns an expression Type.
31338
31339         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31340         `Type', as this has a different meaning now in the base
31341
31342 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31343
31344         * interface.cs, class.cs: Removed from all the sources the
31345         references to signature computation, as we can not do method
31346         signature computation during the parsing time, as we are not
31347         trying to solve at that point distinguishing:
31348
31349         class X {
31350                 void a (Blah x) {}
31351                 void a (NS.Blah x) {}
31352         }
31353
31354         Which depending on the context might be valid or not, as we do not
31355         know if Blah is the same thing as NS.Blah at that point.
31356
31357         * Redid everything so the code uses TypeRefs now instead of
31358         Types.  TypeRefs are just temporary type placeholders, that need
31359         to be resolved.  They initially have a pointer to a string and the
31360         current scope in which they are used.  This is used later by the
31361         compiler to resolve the reference to an actual Type. 
31362
31363         * DeclSpace is no longer a CIR.Type, and neither are
31364         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31365         are all DeclSpaces, but no Types. 
31366
31367         * type.cs (TypeRefManager): This implements the TypeRef manager,
31368         which keeps track of all the types that need to be resolved after
31369         the parsing has finished. 
31370
31371 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31372
31373         * ARGH.  We are going to have to store `foreach' as a class rather
31374         than resolving it, as we need to verify error 1579 after name
31375         resolution.   *OR* we could keep a flag that says `This request to
31376         IEnumerator comes from a foreach statement' which we can then use
31377         to generate the error.
31378
31379 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31380
31381         * class.cs (TypeContainer.AddMethod): we now add methods to the
31382         MethodGroup instead of the method hashtable.  
31383
31384         * expression.cs: Add MethodGroup abstraction, which gets us one
31385         step closer to the specification in the way we handle method
31386         declarations.  
31387
31388         * cs-parser.jay (primary_expression): qualified_identifier now
31389         tried to match up an identifier to a local variable reference or
31390         to a parameter reference.
31391
31392         current_local_parameters is now a parser global variable that
31393         points to the current parameters for the block, used during name
31394         lookup.
31395
31396         (property_declaration): Now creates an implicit `value' argument to
31397         the set accessor.
31398
31399 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
31400
31401         * parameter.cs: Do not use `param' arguments as part of the
31402         signature, per the spec.
31403
31404 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
31405
31406         * decl.cs: Base class for classes, structs and interfaces.  This
31407         is the "Declaration Space" 
31408
31409         * cs-parser.jay: Use CheckDef for checking declaration errors
31410         instead of having one on each function.
31411
31412         * class.cs: Factor out some code for handling error handling in
31413         accordance to the "Declarations" section in the "Basic Concepts"
31414         chapter in the ECMA C# spec.
31415
31416         * interface.cs: Make all interface member classes derive from
31417         InterfaceMemberBase.
31418
31419 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
31420
31421         * Many things: all interfaces are parsed and generated in
31422         gen-treedump.  Support for member variables, constructors,
31423         destructors, properties, constants is there.
31424
31425         Beginning of the IL backend, but very little done, just there for
31426         testing purposes. 
31427
31428 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
31429
31430         * cs-parser.jay: Fix labeled statement.
31431
31432         * cs-tokenizer.cs (escape): Escape " and ' always.
31433         ref_line, ref_name: keep track of the line/filename as instructed
31434         by #line by the compiler.
31435         Parse #line.
31436
31437 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
31438
31439         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31440         to match the values in System.CodeDOM.
31441
31442         Divid renamed to Divide.
31443
31444         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31445         statements. 
31446         (Statements.set): remove.
31447
31448         * System.CodeDOM/CodeCatchClause.cs: always have a valid
31449         statements. 
31450
31451         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31452         falseStatements always have valid values. 
31453
31454         * cs-parser.jay: Use System.CodeDOM now.
31455