2008-12-30 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-12-30  Marek Safar  <marek.safar@gmail.com>
2
3         * expression.cs (As): Mutate all type arguments.
4
5 2008-12-29  Marek Safar  <marek.safar@gmail.com>
6
7         A fix for bug #462622
8         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
9         context.
10
11 2008-12-29  Marek Safar  <marek.safar@gmail.com>
12
13         A fix for bug #450782
14         * ecore.cs: Consider more variables of form V.I to be fixed.
15
16 2008-12-18  Marek Safar  <marek.safar@gmail.com>
17
18         A fix for bug #457087
19         * generic.cs: Don't crash when constraint comes from type
20         declaration.
21
22 2008-12-03  Marek Safar  <marek.safar@gmail.com>
23
24         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
25         to be imported from any assembly.
26
27 2008-11-25  Marek Safar  <marek.safar@gmail.com>
28
29         A fix for bug #447027
30         * anonymous.cs (HoistedVariable): Cache also outer access to deal
31         with context variables stored as expression instances.
32
33 2008-11-17  Marek Safar  <marek.safar@gmail.com>
34
35         A fix for bug #445303
36         * location.cs (IsConditionalDefined): Handle undefined global
37         defines.
38
39 2008-11-17  Marek Safar  <marek.safar@gmail.com>
40
41         A fix for bug #444678
42         * expression.cs (TryReduceConstant): Always create new constant
43         instance.
44
45 2008-11-17  Marek Safar  <marek.safar@gmail.com>
46
47         A fix for bug #444673
48         * ecore.cs: Ignore open generic types when used as generic type
49         instance fields.
50
51 2008-11-13  Marek Safar  <marek.safar@gmail.com>
52
53         A fix for bug #444271
54         * anonymous.cs: Rescan parent storeys when best candidate was
55         undone.
56
57 2008-11-10  Marek Safar  <marek.safar@gmail.com>
58
59         A fix for bug #442610
60         * anonymous.cs (MutateConstructor): More SRE hacking.
61
62 2008-11-10  Marek Safar  <marek.safar@gmail.com>
63
64         A fix for bug #442579
65         * ecore.cs: Also initialize expanded form of a method with 1 params
66         parameter.
67
68 2008-11-06  Marek Safar  <marek.safar@gmail.com>
69
70         * expression.cs (UnaryMutator): Do early l-side check.
71
72 2008-11-05  Miguel de Icaza  <miguel@novell.com>
73
74         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
75         Init, otherwise we would crash later on when checking for friend
76         assemblies. 
77
78         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
79         Otherwise we never get any meaningful information as to what
80         failed. 
81
82 2008-11-05  Marek Safar  <marek.safar@gmail.com>
83
84         A fix for bug #436318
85         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
86
87 2008-11-05  Miguel de Icaza  <miguel@novell.com>
88
89         * namespace.cs: Turns out that it was a really bad idea to hide
90         the errors for namespaces not found here in eval mode.    
91
92         * eval.cs: When we process using clauses, only enter those into
93         the list of valid using clauses after they have been validated.   
94
95         The above change gives the proper semantics: it does not
96         senselessly report the same errors with broken using statements by
97         never storing them in the first place when they are invalid.
98
99 2008-11-05  Marek Safar  <marek.safar@gmail.com>
100
101         A fix for bug #421839
102         * cs-parser.jay: Remove expression from coalesce rule to force lower
103         priority than the assignment operator.
104
105 2008-11-05  Marek Safar  <marek.safar@gmail.com>
106
107         A fix for bug #437875
108         * nullable.cs: Compile correctly method group operand used with null
109         coalescing operator.
110
111 2008-11-04  Marek Safar  <marek.safar@gmail.com>
112
113         A fix for bug #434589
114         * expression.cs (Binary): Ignore lifted conversions when at least
115         one operand is of reference type.
116
117 2008-11-04  Marek Safar  <marek.safar@gmail.com>
118
119         * cs-parser.jay: Better syntax error report.
120
121 2008-11-03  Marek Safar  <marek.safar@gmail.com>
122
123         A fix for bug #436792
124         * cs-parser.jay: Use GetLocation to access location.
125
126 2008-11-03  Marek Safar  <marek.safar@gmail.com>
127
128         A fix for bug #440774
129         * cs-parser.jay: Also set current_array_type when parsing local
130         variables types.
131
132 2008-11-03  Marek Safar  <marek.safar@gmail.com>
133
134         A fix for bug #440785
135         * expression.cs (As): Don't resolve self modifing expression
136         multiple times.
137
138 2008-11-03  Marek Safar  <marek.safar@gmail.com>
139
140         A fix for bug #439447
141         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
142
143 2008-11-03  Marek Safar  <marek.safar@gmail.com>
144
145         A fix for bug #437571
146         * cs-parser.jay: Fixes internal error for invalid expression
147         statements.
148
149 2008-10-17  Marek Safar  <marek.safar@gmail.com>
150
151         * ecore.cs: Resolve correctly ambiguous params delegate methods.
152
153 2008-10-17  Marek Safar  <marek.safar@gmail.com>
154
155         * generic.cs, anonymous.cs: Simplified GetDeclarations.
156
157 2008-10-17  Marek Safar  <marek.safar@gmail.com>
158
159         * cs-tokenizer.cs: More precise cast parsing.
160
161 2008-10-16  Martin Baulig  <martin@ximian.com>
162
163         * anonymous.cs (AnonymousMethodStorey): Put back the
164         `hoisted_locals' hashtable and use it in EmitType().
165
166 2008-10-15  Marek Safar  <marek.safar@gmail.com>
167
168         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
169         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
170         ~5MB for corlib.
171
172 2008-10-14  Marek Safar  <marek.safar@gmail.com>
173
174         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
175
176 2008-10-14  Marek Safar  <marek.safar@gmail.com>
177
178         * statement.cs: Mutate scope initializers.
179
180 2008-10-14  Marek Safar  <marek.safar@gmail.com>
181
182         * expression.cs: Use typeless value for This constant.
183         
184         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
185
186 2008-10-14  Marek Safar  <marek.safar@gmail.com>
187
188         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
189         tokenizer.
190
191 2008-10-13  Marek Safar  <marek.safar@gmail.com>
192
193         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
194         type to type cast.
195
196 2008-10-13  Marek Safar  <marek.safar@gmail.com>
197
198         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
199         parser and tokenizer. Fixes many ambiguities including #433258.
200
201 2008-10-10  Marek Safar  <marek.safar@gmail.com>
202
203         * cs-parser.jay: Fixed missing accessor recovery.
204
205 2008-10-10  Marek Safar  <marek.safar@gmail.com>
206
207         A fix for bug #433701
208         * expression.cs: Better error message.
209
210 2008-10-10  Marek Safar  <marek.safar@gmail.com>
211
212         * cs-parser.jay, expression.cs: Start reporting real parser errors.
213         
214         * Makefile: Disabled unused debug symbols.
215
216         Also fixes: #320556, #321097, #321656, #321876, #351316
217
218 2008-10-09  Miguel de Icaza  <miguel@novell.com>
219
220         * eval.cs: rename "<interactive>" to "{interactive}", to work
221         around a requirement in the compiler that this be a valid
222         filename, and in Windows it is not (433886).
223
224 2008-10-09  Marek Safar  <marek.safar@gmail.com>
225
226         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
227
228 2008-10-08  Marek Safar  <marek.safar@gmail.com>
229
230         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
231         cs-parser.jay: Generic type declaration and type arguments cleanup.
232
233 2008-10-05  Marek Safar  <marek.safar@gmail.com>
234
235         * cs-parser.jay: Allow parsing weird array creation construct.
236
237 2008-10-05  Marek Safar  <marek.safar@gmail.com>
238
239         * cs-parser.jay: Conflicts reduction.
240
241 2008-10-04  Marek Safar  <marek.safar@gmail.com>
242
243         * cs-parser.jay: Conflicts reduction.
244
245 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
246
247         Fix #398325
248         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
249         property.  Add a 'count' hint about the use of the shared vector.
250         Ensure that we don't leak out dirty bits.
251         (UsageVector.MergeChild): Throw away information about variables
252         in child vectors.
253         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
254
255 2008-10-03  Marek Safar  <marek.safar@gmail.com>
256
257         A fix for bug #431746
258         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
259         parameters when iterator is created.
260
261 2008-10-03  Marek Safar  <marek.safar@gmail.com>
262
263         A fix for bug #431827
264         * expression.cs: Fixed right based pointer arithmetic operations
265         emit.
266
267 2008-10-03  Marek Safar  <marek.safar@gmail.com>
268
269         A fix for bug #353779
270         * assign.cs, expression.cs: Fixed compound assignment conversions.
271
272 2008-10-02  Marek Safar  <marek.safar@gmail.com>
273
274         A fix for bug #375262
275         * statement.cs: Refactor ArrayForeach to be usable with string
276         indexer. Optimized single dimentional arrays foreach.
277
278 2008-10-02  Marek Safar  <marek.safar@gmail.com>
279
280         A fix for bug #431255
281         * anonymous.cs, expression.cs: Removed broken optimization.
282
283 2008-10-01  Marek Safar  <marek.safar@gmail.com>
284
285         * anonymous.cs: Use full type parameters of parent generic
286         containers. Removed unnecessary AddParentStoreyReference call.
287
288 2008-10-01  Marek Safar  <marek.safar@gmail.com>
289
290         A fix for bug #324702
291         * class.cs: Use better shorter names for explicit interface member
292         implementations.
293
294         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
295
296 2008-10-01  Marek Safar  <marek.safar@gmail.com>
297         
298         * expression.cs: Use new interface to check fixed expression.
299
300 2008-10-01  Marek Safar  <marek.safar@gmail.com>
301
302         A fix for bug #421101
303         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
304         interface to check for fixed fixed-buffers.
305
306 2008-10-01  Marek Safar  <marek.safar@gmail.com>
307
308         A fix for bug #429264
309         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
310         
311         * delegate.cs: Removed unnecessary casts.
312
313 2008-09-30  Marek Safar  <marek.safar@gmail.com>
314
315         A fix for bug #352151
316         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
317         class.cs: Fixed already defined explicit interface members check.
318
319 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
320
321         cs-tokenizer.cs: Fix typo.
322
323 2008-09-28  Miguel de Icaza  <miguel@novell.com>
324
325         * eval.cs (InteractiveBase): The quit command now just sets a
326         flag, instead of calling Environment.Exit(), it is milder on
327         embedded hosts. 
328
329         CompiledMethod is now in Mono.CSharp, not nested inside
330         the Evaluator, it was inconvenient to use.
331
332 2008-09-27  Miguel de Icaza  <miguel@novell.com>
333
334         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
335         code to be invoked without having to reparse.
336
337 2008-09-27  Miguel de Icaza  <miguel@novell.com>
338
339         * ecore.cs: The recent changes to FieldExpr broke this as well.
340         Fixes LINQ queries in the interactive shell.
341
342         * Multiple files: indentation fixing for the Mono coding
343         guidelines for the switch statement.
344
345         * eval.cs: Make the Evaluator API thread safe.
346
347 2008-09-26  Marek Safar  <marek.safar@gmail.com>
348
349         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
350         constructor parsing.
351
352 2008-09-26  Marek Safar  <marek.safar@gmail.com>
353
354         A fix for bug #325326
355         * statement.cs: Check possible mistaken empty statement using
356         explicit blocks only.
357
358 2008-09-25  Miguel de Icaza  <miguel@novell.com>
359
360         * eval.cs (LoadAssembly, ReferenceAssembly): Call
361         RootNamespace.ComputeNamespaces to update the internal list of
362         namespaces, this is no longer done for us.
363
364         (InteractiveBase): Use the Evaluator APIs instead of calling into
365         Driver directly
366
367 2008-09-25  Marek Safar  <marek.safar@gmail.com>
368
369         A fix for bug #429264
370         * expression.cs: Missing mutator for access to multidimensional
371         arrays.
372
373 2008-09-25  Marek Safar  <marek.safar@gmail.com>
374
375         * class.cs, statement: Emit DebuggerHidden attribute for iterator
376         entry wrapper.
377         
378         * driver.cs: Missing input argument check.
379
380 2008-09-25  Marek Safar  <marek.safar@gmail.com>
381
382         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
383         expression.cs, statement.cs, rootcontext.cs, class.cs, 
384         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
385         DefineMembers.
386
387 2008-09-24  Miguel de Icaza  <miguel@novell.com>
388
389         * ecore.cs (FieldExpr): Only initialize eclass when we return a
390         fully constructed FieldExpr, fixes the regression introduced in
391         the last commit.
392         
393         * ecore.cs, expression.cs: Plug back the eclass initialization as
394         otherwise it regresses `csharp'. 
395
396 2008-09-24  Marek Safar  <marek.safar@gmail.com>
397
398         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
399         ecore.cs, attribute.cs: Moved obsolete method checks from emit
400         phase to resolve phase. It resolves problems with expression trees
401         and fixes bugs #323796, #325156.
402
403 2008-09-23  Marek Safar  <marek.safar@gmail.com>
404
405         * codegen.cs: Report better error when symbol writer is missing.
406
407 2008-09-23  Marek Safar  <marek.safar@gmail.com>
408
409         * codegen.cs: Set .NET symbol writer.
410         
411         * decl.cs: Guard against null generic arguments.
412         
413         * report.cs: Don't report exactly same additional details.
414
415 2008-09-22  Marek Safar  <marek.safar@gmail.com>
416
417         A fix for bug #324917
418         * cs-parser.jay: Add missing multidimensional non-expression type
419         ranks.
420         
421 2008-09-22  Marek Safar  <marek.safar@gmail.com>
422
423         A fix for bug #428191
424         * anonymous.cs: Create an outer generic fields also for non-storey
425         anonymous methods.
426
427 2008-09-22  Marek Safar  <marek.safar@gmail.com>
428
429         A fix for bug #378294
430         * class.cs: Make fixed size buffers gmcs feature only.
431
432 2008-09-22  Marek Safar  <marek.safar@gmail.com>
433
434         A fix for bug #355622, #324993
435         * assign.cs, const.cs, class.cs: Create new EmitContext for each
436         field initializer.
437
438 2008-09-19  Marek Safar  <marek.safar@gmail.com>
439
440         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
441         error reporting.
442
443 2008-09-19  Marek Safar  <marek.safar@gmail.com>
444
445         A fix for bug #416110
446         * generic.cs: Struct constraint results in default ctor and
447         ValueType base type constraint to be set.
448
449 2008-09-19  Marek Safar  <marek.safar@gmail.com>
450
451         A fix for bug #423791
452         * generic.cs: Fixed params output type type-inference.
453
454 2008-09-19  Marek Safar  <marek.safar@gmail.com>
455
456         * cs-parser.jay, expression.cs: Fixed few expression crashes.
457         
458 2008-09-19  Marek Safar  <marek.safar@gmail.com>
459
460         * cs-tokenizer.cs: Don't break on extra partial modifier.
461
462 2008-09-19  Marek Safar  <marek.safar@gmail.com>
463
464         A fix for bug #427592
465         * generic.cs: Use common parameter resolve method.
466
467 2008-09-18  Marek Safar  <marek.safar@gmail.com>
468
469         A fix for bug #414758
470         * expression.cs, ecore.cs: Fixed crash when accessing non-static
471         property.
472
473 2008-09-18  Marek Safar  <marek.safar@gmail.com>
474
475         * driver.cs, namespace.cs: Read types and namespaces after all
476         requested assemblies are loaded, fixes issues with System.Core
477         auto-reference, and #419888.
478
479 2008-09-18  Marek Safar  <marek.safar@gmail.com>
480
481         A fix for bug #417705
482         * cs-parser.jay: Fixed as/is operator expression split.
483
484 2008-09-18  Marek Safar  <marek.safar@gmail.com>
485
486         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
487         Fixed expression tree representation of empty new expression and
488         new initializer expression.
489
490 2008-09-18  Miguel de Icaza  <miguel@novell.com>
491
492         * eval.cs: Remove warning, keep reference to driver around.
493
494         * Hide fields that do not need to be public.
495
496 2008-09-17  Marek Safar  <marek.safar@gmail.com>
497
498         A fix for bug #426385
499         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
500         conversion for array elements.
501
502 2008-09-17  Marek Safar  <marek.safar@gmail.com>
503
504         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
505         void parsing conflicts.
506
507 2008-09-15  Marek Safar  <marek.safar@gmail.com>
508
509         A fix for bug #425601
510         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
511         System.Core only when there is no custom ExtensionAttribute
512         implementation.
513
514 2008-09-15  Miguel de Icaza  <miguel@novell.com>
515
516         * namespace.cs: Do not report CS0246 (name
517
518 2008-09-12  Marek Safar  <marek.safar@gmail.com>
519
520         A fix for bug #425669
521         * generic.cs: Don't cache generic static anonymous method 
522         containers.
523
524 2008-09-12  Marek Safar  <marek.safar@gmail.com>
525
526         * generic.cs, class.cs, delegate.cs: Check recursive inherited
527         conflicting constraints.
528
529 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
530
531         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
532         mcs too.
533
534 2008-09-12  Marek Safar  <marek.safar@gmail.com>
535
536         * literal.cs, convert.cs, expression.cs, statement.cs: More null
537         to null pointer conversion fixes.
538
539 2008-09-11  Marek Safar  <marek.safar@gmail.com>
540
541         * cs-parser.jay, expression.cs: An implicitly typed local variable
542         declarator cannot use an array initializer.
543
544 2008-09-11  Marek Safar  <marek.safar@gmail.com>
545
546         * cs-parser.jay: Reduced number of printed tokens, add sorting.
547
548 2008-09-11  Marek Safar  <marek.safar@gmail.com>
549
550         * generic.cs (InflatedConstraints): Don't crash when constraints
551         are different.
552         
553         * cs-parser.jay: const_declarator is a block.
554
555         * constant.cs: Check for not allowed NaN conversions.
556
557 2008-09-10  Miguel de Icaza  <miguel@novell.com>
558
559         * driver.cs: Drop --shell argument, the compiler is no longer a
560         REPL. 
561
562         * eval.cs: Move most of the code that deals with evaluation into
563         this file and document the public API from repl.cs
564
565         * repl.cs: Remove from here.
566         
567 2008-09-10  Marek Safar  <marek.safar@gmail.com>
568
569         A fix for bug #424684
570         * generic.cs: Generic class constraints must come first.
571
572 2008-09-09  Miguel de Icaza  <miguel@novell.com>
573
574         * cs-parser.jay: Improve error reporting for syntax errors in
575         statements and expressions, we now report the expected tokens
576         instead of reporting the useless "; expected".
577
578         Drop the strings from the token declaration, it turns out that
579         they did not do what I thought they did.  Instead they were adding
580         two sets of tokens to the tables.
581
582 2008-09-09  Marek Safar  <marek.safar@gmail.com>
583
584         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
585         delegate.cs: Share special type check.
586
587 2008-09-09  Marek Safar  <marek.safar@gmail.com>
588
589         A fix for bug #423981
590         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
591
592 2008-09-09  Marek Safar  <marek.safar@gmail.com>
593
594         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
595         ConvertImplicitly.
596
597 2008-09-09  Marek Safar  <marek.safar@gmail.com>
598
599         A fix for bugs: #324750, #335946
600         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
601         lookup rule to determine ?-based tokens.
602
603 2008-09-08  Miguel de Icaza  <miguel@novell.com>
604
605         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
606         expressions (like event adding or removing) end up here, so we
607         need to treat those as statements.
608
609         Add LoadAssembly method.
610
611 2008-09-04  Miguel de Icaza  <miguel@novell.com>
612
613         * repl.cs: Add Time method.
614
615 2008-09-05  Marek Safar  <marek.safar@gmail.com>
616
617         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
618
619 2008-09-05  Miguel de Icaza  <miguel@novell.com>
620
621         * repl.cs: Add workaround for old compilers.
622
623 2008-09-04  Jb Evain  <jbevain@novell.com>
624
625         * repl.cs (PrettyPrint): pretty print everything that
626         implements IDictionary, as well as IEnumerables. Also,
627         add a quit helper property.
628
629 2008-09-04  Marek Safar  <marek.safar@gmail.com>
630
631         * constant.cs: Better error reporting for decimal literals.
632         
633         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
634         field attributes.
635         
636 2008-09-04  Marek Safar  <marek.safar@gmail.com>
637                         Miguel de Icaza  <miguel@novell.com>
638
639         A fix for bug #422951
640         * assign.cs (Assign.DoResolve): Perform the type conversions
641         checks before we attempt to initialize `New' initializers. 
642
643 2008-09-04  Marek Safar  <marek.safar@gmail.com>
644
645         A fix for bug #422853
646         * delegate.cs (DelegateCreation): Add special handling for
647         EmptyExpression.Null instance expression which is just another
648         hack for undecided member instance exression.
649
650 2008-09-04  Marek Safar  <marek.safar@gmail.com>
651
652         * expression.cs, ecore.cs: Emit full expression tree for reduced
653         binary expressions.
654
655 2008-09-04  Marek Safar  <marek.safar@gmail.com>
656
657         * expression.cs (This): Guard against multi-resolving.
658         
659         * ecore.cs, statement.cs (Throw): Simplified.
660         
661         * flowanalysis.cs: Also verify event fields.
662
663 2008-09-04  Miguel de Icaza  <miguel@novell.com>
664
665         * assign.cs (Assign.DoResolve): Perform the type conversions
666         checks before we attempt to initialize `New' initializers. 
667
668         * repl.cs (PrettyPrint): Add Hashtable prettyprint
669
670         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
671         public. 
672
673         * repl.cs: Update help.
674
675 2008-09-03  Miguel de Icaza  <miguel@novell.com>
676
677         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
678         handling of the default config handling, including the special
679         treatment of System.Core assembly. 
680
681         Fixes the REPL processing for LINQ.
682
683 2008-09-03  Marek Safar  <marek.safar@gmail.com>
684
685         A fix for bug #422507
686         * expression.cs (UnboxCast): Add missing child expression mutator.
687
688 2008-09-03  Marek Safar  <marek.safar@gmail.com>
689
690         * driver.cs: Don't self reference System.Core assembly.
691
692 2008-09-03  Marek Safar  <marek.safar@gmail.com>
693
694         A fix for bug #422507
695         * expression.cs (StringConcat): Add missing type mutator.
696
697 2008-09-03  Marek Safar  <marek.safar@gmail.com>
698
699         * generic.cs (TypeInferenceContext): Follow equality rule for
700         constructed type lower bound type inference.
701
702 2008-09-02  Miguel de Icaza  <miguel@novell.com>
703
704         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
705         <dblank@cs.brynmawr.edu> which updates the cursor position on
706         refresh.
707         
708 2008-09-02  Marek Safar  <marek.safar@gmail.com>
709
710         A fix for bug #367145
711         * driver.cs: Fixed import of extension methods when using -noconfig
712         option.
713
714 2008-09-02  Marek Safar  <marek.safar@gmail.com>
715
716         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
717         version from non-generic implementation instead.
718
719 2008-09-01  Marek Safar  <marek.safar@gmail.com>
720
721         A fix for bug #418908
722         * class.cs: Use AddScopeStatement for field initializers.
723
724 2008-09-01  Marek Safar  <marek.safar@gmail.com>
725
726         A fix for bug #415385
727         * ecore.cs, convert.cs: Do method group conversion for equal group types.
728
729 2008-09-01  Marek Safar  <marek.safar@gmail.com>
730
731         A fix for bug #421736
732         * iterators.cs: Don't crash on unreachable iterators.
733
734 2008-09-01  Marek Safar  <marek.safar@gmail.com>
735
736         A fix for bug #421628
737         * parameter.cs, attribute.cs: Clone also parameter attributes.
738
739 2008-08-30  Miguel de Icaza  <miguel@novell.com>
740
741         * namespace.cs (LookupType): In EvalMode, try to replace
742         the TypeBuilder from our cache with a Type as Reflection.Emit does
743         not  like to mix code from older assemblies emitted and new
744         assemblies emitted. 
745
746         This sounds like a serious Mono bug that prevents multiple
747         assemblies to be generated and consumed at the same time.
748
749         * cs-parser.jay (push_current_class): Do not make interactive
750         classes internal or private, make them public as we currently
751         generate each new class in a new assembly.   
752
753 2008-08-29  Miguel de Icaza  <miguel@novell.com>
754
755         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
756         remove types that are entered into the global namespace during
757         parsing so that we can remove them on failure.
758  
759         * cs-parser.jay: Parsing: we now keep track of types that are
760         entered into global variables and queue those in case the parsing
761         or resolution fail.
762  
763         This happens in a few situations: during partial-input, we invoke
764         the parser repeatedly for example with the string "class X", this
765         would cause X to be registed, and we need to remove this
766         registration so that another parse attempt later with say "class X {"
767         would actually work.
768  
769         Additionally, if there is an error in the resolution phase, for
770         example: "class X : NonExistant {}" th
771         
772         * cs-parser.jay: Be more precise with the errors being raised,
773         instead of flagging all exceptions during parsing to be attributed
774         to the parsing process, distinguish those from errors happening in
775         the actions and hint that using -v would produce the actual
776         exception. 
777
778         * repl.cs: Do not load all compiler references on each reset,
779         doing the partial reset takes care of this.
780         
781 2008-08-28  Miguel de Icaza  <miguel@novell.com>
782
783         * repl.cs: Add support for loading all the files from
784         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
785         as shell libraries.
786
787         Introduce a micro-parser that is able to deambiguate on its input
788         whether we are dealing with a compilation unit (namespace, class,
789         interface, struct, delegate) declaration or a statement.   This
790         allows both declarations and statements to be entered. 
791
792         Set history size by default to 300 lines.
793
794         Instead of distinguishing based on the parser.InteractiveResult,
795         have only two cases: statements were parsed, or a compilation unit
796         was.   Always pull the Using statement additions from the
797         compilation unit parse.
798         
799         * cs-tokenizer.cs: Rename tokens to better describe their intent
800         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
801         
802         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
803         EvalMode is used to trigger the lookup of global variables while
804         StatementMode is used turn variable declarations into static
805         fields.
806
807         * getline.cs: Allow history size to be set.
808         
809 2008-08-29  Marek Safar  <marek.safar@gmail.com>
810
811         A fix for bug #360755
812         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
813
814 2008-08-29  Marek Safar  <marek.safar@gmail.com>
815
816         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
817         
818         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
819         member name, it is too confusing
820         
821         * decl.cs, class.cs: Don't report unused fields with attached attribute.
822         
823         * rootcontext.cs: Finally default to warning level 4.
824
825 2008-08-28  Marek Safar  <marek.safar@gmail.com>
826
827         * class.cs (CheckBase): Ignore overloaded operators.
828
829 2008-08-28  Marek Safar  <marek.safar@gmail.com>
830
831         A fix for bug #420830
832         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
833
834 2008-08-28  Marek Safar  <marek.safar@gmail.com>
835
836         A fix for bug #420832
837         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
838
839 2008-08-28  Marek Safar  <marek.safar@gmail.com>
840
841         A fix for bug #420386
842         * nullables.cs: Fixed logic of nullable user comparison operators involving
843         null values.
844
845 2008-08-28  Marek Safar  <marek.safar@gmail.com>
846         
847         * attribute (IsClsCompliant): Use FALSE value for pointer types.
848
849 2008-08-27  Miguel de Icaza  <miguel@novell.com>
850
851         * repl.cs: Add support for aborting the running code with C-c. 
852
853 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
854
855         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
856
857 2008-08-27  Miguel de Icaza  <miguel@novell.com>
858
859         * cs-parser.jay (interactive_statement_list): A new set of rules
860         for hosting statements that uses the "interactive_" prefix.   
861
862         * repl.cs: Add support for parsing `using' as a statement or as a
863         directive.  Deambiguating before passing this to the parser.
864
865         We need to distinguish statement_expressions that occur at the
866         toplevel vs those that occur embedded into expressions.
867
868         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
869         that fixes the cursor key handling, and a history bug.
870         
871 2008-08-26  Miguel de Icaza  <miguel@novell.com>
872
873         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
874         limitations in Console, instead the 2.0 bootstrap libraries now
875         include the Console bits.
876
877         Also, remove the use of Nullables from getline.cs
878
879         ------------
880         
881         Interactive support for the C# compiler.   Use gmcs --shell to
882         enter a read-eval-print loop shell.
883
884         Docs: http://www.mono-project.com/CsharpRepl
885         
886         * sources: include repl.cs here and getline.cs for gmcs.exe,
887         everything else is getline.cs impaired.
888
889         * Makefile: when bootstrapping pass a special flag
890         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
891         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
892         This distinguishes those two cases.
893
894         * repl.cs: Support for a read-eval-print loop.   Will be soon
895         refactored into eval support and then REPL on top of it.
896
897         * ecore.cs: If a simplename lookup fails, before erroring out,
898         if we are in EvalMode to resolve the name to a declaration in the
899         Eval-land.    
900
901         This means that variable declarations that happened in previous
902         classes (as repl puts every statement in a separate class) are
903         made visible in this way.
904
905         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
906         triggered an error due to the end of file being reached.   This is
907         used to do multi-line input, and notify the caller that the user
908         needs to provide more text before a successful parse.
909
910         Add new grammar rules after the INTERACTIVE_PARSER token is seen
911         to drive the evaluation with a custom wrapper. 
912
913         * driver.cs: Add support for --shell, and refactor some code to be
914         reused from repl.cs
915         
916         * namespace.cs: Add support for serializing the contents of the
917         namespaces and reloading them.  
918
919         * getline.cs: A managed implementation of ReadLine under
920         X11/Apache2 license terms.  Easy to embed in other applications as
921         well.
922
923         * namespace.cs: Add some functions to save and restore the
924         namespace state.
925
926         * rootcontext.cs: New public field.
927
928         * cs-tokenizer.cs: Add support for one of the possible characters
929         we introduce into the token stream.  
930
931         This patch does not affect the regular tokenization process, the
932         only performance hit would happen if there is an invalid character
933         on the input string.
934
935         * support.cs: Move isatty helper routine here.
936
937         * codegen.cs: Small cleanup, and add a mechanism to initialize the
938         code generator for in-memory assemblies.
939
940 2008-08-26  Marek Safar  <marek.safar@gmail.com>
941
942         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
943         parameter cannot be always used as a type.
944
945 2008-08-21  Marek Safar  <marek.safar@gmail.com>
946
947         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
948
949 2008-08-21  Marek Safar  <marek.safar@gmail.com>
950
951         * convert.cs: Implement explicit array to IList<T> conversion.
952
953 2008-08-20  Marek Safar  <marek.safar@gmail.com>
954
955         A fix for bug #362740
956         * cs-tokenizer.cs: Handle UTF-16 surrogates.
957
958 2008-08-20  Marek Safar  <marek.safar@gmail.com>
959         
960         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
961         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
962         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
963         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
964         handling to use just one type of infrastructure and deal with generics
965         more effectivelly.
966
967 2008-07-23  Martin Baulig  <martin@ximian.com>
968
969         *** Merged this from trunk revision 108527 ***
970
971         * statement.cs
972         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
973         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
974         scope variable.
975
976 2008-08-15  Marek Safar  <marek.safar@gmail.com>
977         
978         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
979         error checks.
980
981 2008-08-15  Marek Safar  <marek.safar@gmail.com>
982         
983         * delegate.cs: Fixed compiler crash when creating delegate using partial
984         method.
985         
986         * typemanager.cs: MulticastDelegate is not a delegate.
987
988 2008-08-14  Marek Safar  <marek.safar@gmail.com>
989         
990         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
991         checks.
992
993 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
994
995         * cs-parser.jay (type): Allow 'var' in mcs too.
996         (local_variable_type): Likewise.
997
998 2008-08-14  Marek Safar  <marek.safar@gmail.com>
999         
1000         * driver.cs: Removed broken -noconfig variants.
1001
1002 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1003         
1004         A fix for bug #417078
1005         * expression.cs: Emit correctly left side pointer operators.
1006
1007 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1008
1009         * generic.cs, lambda.cs: Inflate method generic arguments only.
1010
1011 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1012
1013         * class.cs: Fixed struct layout check regression.
1014
1015 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1016
1017         * cs-parser.jay, enum.cs: Simplified enum parsing.
1018         
1019         * decl.cs: Check all type parameters conflicts.
1020         
1021         * expression.cs, statement.cs, attribute.cs: More expression checks.
1022
1023 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1024
1025         * generic.cs: Add type inference types restriction.
1026         
1027         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1028         anonymous.cs, expression.cs: Allocate less accessor parameters.
1029
1030 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1031
1032         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1033         classes.
1034
1035 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1036
1037         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1038
1039 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1040
1041         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1042         Also fixes #362146 and #381592.
1043
1044 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1045
1046         * ecore.cs: Reduced constant cannot be used as an attribute value.
1047         
1048         * cs-parser.jay: Base expression has to be a type.
1049         
1050         * expression.cs (Conditional): Uses ReducedExpression.
1051
1052 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1053
1054         A fix for bug #376826
1055         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1056         address of hoisted local variable or parameter cannot be taken.
1057
1058 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1059
1060         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1061         anonymous method inside checked/unchecked expression.
1062
1063 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1064
1065         * typemanager.cs (IsEqual): Guard against null.
1066         
1067         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1068         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1069         routine. Fixed few misleading conversion errors.
1070
1071 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1072
1073         * class.cs: Consider generics when checking cycles in struct layout.
1074
1075 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1076
1077         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1078
1079 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1080
1081         A fix for bug #414165
1082         * anonymous.cs: Use same anonymous implementation method for all anonymous
1083         method emits.
1084
1085 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1086
1087         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1088         constraints.
1089
1090 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1091
1092         * cs-parser.jay: Typeof argument has to be a type expression.
1093         
1094         * namespace.cs: Check alias and namespace definitions collisions.
1095         
1096         * class.cs, pending.cs: Moved explicit interface accessor implementation
1097         check.
1098         
1099         * delegate.cs, expression.cs: Verify special name invocations.
1100         
1101 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1102
1103         * cs-parser.jay: Don't choke on empty generic type arguments.
1104         
1105         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1106         
1107         * expression.cs, ecore.cs: Minor expressions bugs.
1108
1109 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1110
1111         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1112         and added more error handling.
1113         
1114         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1115         
1116         *  modifiers.cs, enum.cs: Fixed.
1117
1118 2008-07-31  Jb Evain  <jbevain@novell.com>
1119
1120         * driver.cs: remove -pkg ability of smcs.
1121
1122 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1123
1124         * statement.cs (Switch): Correctly set empty default target for single
1125         blocks.
1126
1127 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1128
1129         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1130         string switch statement implementation to use string dictionary which
1131         significantly (2-8x) improves performance of generated code.
1132
1133 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1134
1135         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1136         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1137         
1138 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1139
1140         A fix for bug #412595
1141         * typemanager.cs, convert.cs, expression.cs: Some types are never
1142         convertible to each other.
1143
1144 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1145
1146         * nullable.cs (CreateNullConstant): An error messages update.
1147
1148 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1149
1150         A fix for bug #412595
1151         * cfold.cs: Don't cast undefined bool constant.
1152
1153 2008-07-29  Martin Baulig  <martin@ximian.com>
1154
1155         * symbolwriter.cs
1156         (SymbolWriter.Reset): New public static method.
1157
1158         * driver.cs
1159         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1160
1161 2008-07-28  Marek Safar  <marek.safar@gmail.com>
1162
1163         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1164         
1165         * expression.cs (ElementAccess): Exact size allocation.
1166
1167 2008-07-26  Marek Safar  <marek.safar@gmail.com>
1168
1169         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1170
1171 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1172
1173         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1174         
1175         * class.cs: Removed $PRIVATE$ field hack which caused problems during
1176         flow analysis.
1177
1178 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1179
1180         A fix for bug #412217
1181         * assign.cs: Mutate also assignment type.
1182
1183 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1184
1185         A fix for bug #323644
1186         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1187         indexers.
1188
1189 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1190
1191         A fix for bug #412134
1192         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1193         non-enumerable operands when overloading equality or bitwise operators.
1194
1195 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1196
1197         * anonymous.cs: Cache closed generic anonymous method delegates.
1198
1199 2008-07-24  Marek Safar  <marek.safar@gmail.com>
1200
1201         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
1202         anonymous.cs, statement.cs: Always emit anonymous method as static method
1203         when is instance free. Use nesting for nested anynomous methods blocks.
1204         
1205 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1206
1207         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1208         types.
1209
1210 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1211
1212         * expression.cs: Removed MakeSimpleCall.
1213
1214 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1215
1216         A fix for bug #323012
1217         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1218         Base method implementing interface has to be public.
1219
1220 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1221
1222         * cs-parser.jay: Don't break on missing argument.
1223
1224 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1225
1226         A fix for bug #320993
1227         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1228           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1229
1230 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1231
1232         A fix for bug #320748
1233         * convert.cs: Implicit user operators cannot convert to interfaces
1234
1235 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1236
1237         A fix for bug #312686
1238         * driver.cs: Ignore empty assembly references.
1239
1240 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1241
1242         A fix for bug #387040
1243         * ecore.cs: Skip constrains check for an explicit implementation.
1244
1245 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1246
1247         A fix for bug #409045
1248         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1249           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1250           identifiers are file specific unless passed as input arguments.
1251
1252 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1253
1254          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1255          to emit UnmanagedMarshal data under 2.0 profile.
1256
1257 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1258
1259         A fix for bug #410369
1260         * parameter.cs: Clone correctly ParamsParameter.
1261
1262 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1263
1264         * expression.cs (Argument): Always report type for type based expressions
1265         errors.
1266
1267 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1268
1269         A fix for bug #410666
1270         * anonymous.cs: Correctly initialize generic storey reference.
1271
1272 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1273
1274         * convert.cs: Don't box same type arguments.
1275
1276 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1277
1278         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1279         Finished missing generic type mutators.
1280
1281 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1282
1283         * iterators.cs, statement.cs: Finished statements CloneTo.
1284
1285 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1286
1287         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1288         
1289         * expression.cs: Emit optimized default value expressions in expression tree
1290         array initializer.
1291
1292 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1293
1294         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1295
1296 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1297
1298         A fix for bug #367536
1299         * cs-parser.jay: Check static constructor of generic types for an access
1300         modifier.
1301
1302 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1303
1304         A fix for bug #353800
1305         * lambda.cs: Emit ret for contextual statements.
1306         
1307         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1308         up emitting redundant ret for all anonymous methods with return.
1309
1310 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1311
1312         A fix for bug #365188
1313         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1314         create anonymous method storey in unreachable block.
1315
1316 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1317
1318         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1319         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1320         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1321         statement.cs: Fixed relevant defects found by Gendarme.
1322
1323 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1324
1325         A fix for bug #325291
1326         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1327         statement.cs: Replaced IAnonymousHost with top level block flag.
1328
1329 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1330
1331         * cs-parser.jay: Clean up unused open_parens.
1332
1333 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1334
1335         * ecore.cs: Custom error message for a range variable assignment.
1336
1337 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1338
1339         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1340         load.
1341
1342 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1343
1344         * literal.cs: Null literal is of object type.
1345
1346 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1347
1348         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1349         expression of nullable equality comparison.
1350
1351 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1352
1353         * expression.cs(PointerArithmetic): Removed redundant assignment.
1354
1355 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1356
1357         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1358
1359 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1360
1361         A fix for bug #408361
1362         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1363         they are replaced by GetMethod.
1364
1365 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1366
1367         A fix for bug #408721 by jeremie.laval@gmail.com
1368         * expression.cs (Indirection): Implemented CloneTo.
1369
1370 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1371
1372         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1373         assert check.
1374
1375 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1376
1377         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1378
1379 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1380
1381         * linq.cs: Reset tranparent parameter counter in probing mode.
1382
1383 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1384
1385         * anonymous.cs: Mutate anonymous method type.
1386
1387 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1388
1389         * ecore.cs, anonymous.cs: Mutate field expressions.
1390
1391 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1392
1393         A fix for bug #369670
1394         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1395
1396 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1397
1398         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1399
1400 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1401
1402         Fix bug #314902
1403         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1404         only one '>', and finds a '>>', abort the generic lookahead.
1405
1406 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1407
1408         A fix for bug #319902
1409         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1410
1411 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1412
1413         A fix for bug #406371
1414         * statement.cs: Moved EmitSymbolInfo to Block.
1415
1416 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1417
1418         * ecore.cs: Report better error for extension method overload failures.
1419
1420 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1421
1422         * expression.cs (Is): No need to box reference values.
1423
1424 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1425
1426         * class.cs: Use event resolve context when initializing CreateEmitContext.
1427
1428 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1429
1430         A fix for bug #394436
1431         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1432         method used inside expression trees. Added more LINQ to expression tree
1433         conversions.
1434
1435 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1436
1437         A fix for bug #378189, #370577
1438         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1439         from expression.
1440
1441 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1442
1443         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1444         hierarchically.
1445
1446 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1447
1448         A fix for bug #406702
1449         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1450
1451 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1452
1453         A fix for bug #406648
1454         * cs-parser.jay: Report nullable use in mcs for some cases.
1455
1456 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1457
1458         * ecore.cs: Improved argument mismatch error messages.
1459
1460 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1461
1462         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1463
1464 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1465
1466         * expression.cs (TypeOf): Mutate type argument.
1467
1468 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1469
1470         * class.cs: Report missing partial modifier for correct type.
1471
1472 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1473
1474         * ecore.cs, expression.cs (VariableReference): Variable property is 
1475         protected.
1476
1477 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1478
1479         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1480         
1481 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1482
1483         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1484         method delegates.
1485
1486 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1487
1488         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1489         anonymous method storey to an instance method when only "this" is hoisted.
1490
1491 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1492
1493         A fix for bug #321615
1494         * expression.cs: Pointer comparisons use unsigned operator.
1495
1496 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1497
1498         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1499
1500 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1501
1502         A fix for bug #404905
1503         * class.cs: Always initialize local unsafe variables.
1504
1505 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1506
1507         A fix for bug #396987
1508         * expression.cs (NewInitialize): Clear local temporary variable for next run
1509
1510 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1511
1512         A fix for bug #401020
1513         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1514
1515 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1516
1517         A fix for bug #398319
1518         * cs-parser.jay: Implemented undocumented base access expression inside
1519         anonymous types.
1520
1521 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1522
1523         A fix for bug #404227
1524         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1525
1526 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1527
1528         A fix for bug #404227
1529         * convert.cs: Fixed explicit array to interface cast.
1530
1531 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1532
1533         A fix for bug #403894
1534         * delegate.cs: Mutate DelegateInvocation type.
1535
1536 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1537
1538         A fix for bug #379348
1539         * delegate.cs: Box a load of generic parameters.
1540
1541 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1542
1543         * expression.cs: Add an array creation arguments mutate.
1544
1545 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1546
1547         A fix for bug #386068
1548         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1549         parameter.
1550
1551 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1552
1553         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1554         CloneTo.
1555
1556 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1557
1558         A fix for bug #403518
1559         * delegate.cs: Type correctly anonymous method new invocation.
1560
1561 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1562
1563         A fix for bug #394826
1564         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1565         calls.
1566
1567 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1568
1569         A fix for bug #394826
1570         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1571         needed.
1572
1573 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1574
1575         * class.cs: Clone indexer parameters for localized capturing.
1576
1577 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1578
1579         A fix for bug #402379
1580         * expression.cs: Don't crash when an object initializer resolve fails.
1581
1582 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1583
1584         A fix for bug #402888
1585         * expression.cs: Mutate conditional expression.
1586
1587 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1588
1589         A fix for bug #401012
1590         * class.cs: Keep StructLayout in shared container.
1591
1592 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1593
1594         A fix for bug #400438
1595         * decl.cs, class.cs: Only properties can be automatically implemented.
1596
1597 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1598
1599         * statement.cs (ChangeToIterator): Copy also labels.
1600
1601 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1602
1603         * ecore.cs: Pass type argument details to parent extension method.
1604
1605 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1606
1607         A fix for bug #375966
1608         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1609
1610 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1611
1612         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1613
1614 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1615
1616         A fix for bug #394347
1617         * anonymous.cs: Cache compatible delegates as compatibility check produces
1618         a new method every time.
1619
1620 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1621
1622         * anonymous.cs: Propagate storey reference for single references.
1623
1624 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1625
1626         A fix for bug #387615
1627         * assign.cs, expression.cs: Correctly clone compound assignment.
1628
1629 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1630
1631         A fix for bug #359611, #359604
1632         * anonymous.cs: Mutate all types of hoisted parameters.
1633
1634 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1635
1636         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1637         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1638         expression.cs, codegen.cs, statement.cs
1639         
1640         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1641         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1642         
1643         ** Anonymous methods, lambda expressions rewrite **
1644         
1645         Anonymous expressions are now resolved when an explicit block is resolved 
1646         and they don't require any registration procedure anymore. Further,
1647         anonymous methods are defined when explicit block is emitted which allows
1648         better control of whole process and opens possibilities for more
1649         optimizations as well as alternative to reverse whole process.
1650         
1651         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1652         process consistent and to correctly emit hoisted generic methods when they
1653         have at least 1 hoisted variable.
1654         
1655 2008-06-17  Martin Baulig  <martin@ximian.com>
1656
1657         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1658         iterator method.
1659         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1660         virtual property; check it in Emit().
1661         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1662         an iterator.
1663         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1664         an iterator.
1665         (Indexer.Define): Likewise.
1666
1667 2008-06-17  Marek Safar  <marek.safar@gmail.com>
1668
1669         * convert.cs: Don't use IsInterface on type arguments.
1670         
1671         * delegate.cs: DelegateInvocation uses MethodInfo.
1672         
1673         * parameter.cs: Removed IsTypeParameter.
1674         
1675         * generic-mcs.cs: More missing stuff.
1676
1677 2008-06-16  Martin Baulig  <martin@ximian.com>
1678
1679         * modifiers.cs
1680         (Modifiers.DEBUGGER_HIDDEN): New public const.
1681
1682         * typemanager.cs
1683         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1684
1685         * class.cs
1686         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1687         (AbstractPropertyEventMethod): Likewise.
1688         (Constructor.Emit): Likewise.
1689         (SourceMethod.SetCompilerGenerated): Removed.
1690
1691         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1692         on MoveNext().
1693
1694         * anonymous.cs
1695         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1696         if we're an `IteratorHost'.
1697         (AnonymousMethodMethod..ctor): Don't set
1698         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1699         not on the method.
1700
1701 2008-06-16  Marek Safar  <marek.safar@gmail.com>
1702
1703         * statement.cs: Clean-up foreach statements.
1704
1705 2008-06-12  Marek Safar  <marek.safar@gmail.com>
1706
1707         * class.cs: Stop using public method which should not exist
1708         (MethodBuilder.SetGenericMethodSignature).
1709
1710 2008-06-11  Martin Baulig  <martin@ximian.com>
1711
1712         * location.cs
1713         (Location.LookupFile): Add `CompilationUnit' argument; when given
1714         a relative file name, make it relative to the directory the .cs
1715         file is located in instead of using the current directory.
1716
1717 2008-06-11  Martin Baulig  <martin@ximian.com>
1718
1719         * class.cs
1720         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1721         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1722         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1723         (SourceMethod.SetCompilerGenerated): Likewise.
1724
1725 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1726
1727         * codegen.cs, driver: Only write symbol file when it's asked for.
1728
1729 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1730
1731         * codegen.cs: Don't use assembly writer error handling for symbol writer.
1732
1733 2008-06-10  Martin Baulig  <martin@ximian.com>
1734
1735         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1736
1737 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1738
1739         A fix for bug #316290
1740         * expression.cs: Include decimal operators in predefined table.
1741         
1742         * parameters.cs: More readonlyness.
1743
1744 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1745
1746         A fix for bug #397213
1747         * cs-parser.jay: One more missing current_local_parameters reset.
1748
1749 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1750
1751         A fix for bug #396633
1752         * class.cs: Host backing field in partial container.
1753
1754 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1755
1756         A fix for bug #397068
1757         * expression.cs: Check both operand types when predefined operator is used.
1758
1759 2008-06-05  Martin Baulig  <martin@ximian.com>
1760
1761         Merged the `debugger-kahalo' branch.
1762
1763         * class.cs
1764         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1765         we're an iterator method.
1766         (SourceMethod): Reflect latest symbol writer changes;
1767         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1768         now `start_row' and `end_row'.
1769         (Constructor.Emit): Fix the logic whether to emit symbol information.
1770
1771         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1772         generated methods.
1773
1774         * location.cs
1775         (CompilationUnit): New public class; derives from `SourceFile'.
1776         (SourceFileEntry.DefineSymbolInfo): New public method.
1777         (SourceFileEntry.SetChecksum): New public method.
1778         (Location): Encode hidden line numbers by using `column == 255';
1779         the .ctor now accepts `column == -1' to mark a hidden line number.
1780         (Location.Hidden): New public property.
1781         (Location.CheckPoint): Add `CompilationUnit'.
1782         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1783         (Location.Push): Add `CompilationUnit compile_unit' argument.
1784         (Location.CompilationUnit): New public property.
1785
1786         * statement.cs
1787         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1788
1789         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1790
1791         * driver.cs: `SourceFile' -> `CompilationUnit'.
1792
1793         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1794
1795         * namespace.cs: `SourceFile' -> `CompilationUnit'.
1796
1797         * cs-tokenizer.cs: Add support for `#pragma checksum' and
1798         `#line hidden'.
1799
1800         * symbolwriter.cs
1801         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1802         new symbol writer API to also pass the file.
1803
1804 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1805
1806         * statement.cs: Emit catch variable assignment using variable expression.
1807         
1808 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1809
1810         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1811         with other variable types.
1812
1813 2008-06-04  Marek Safar  <marek.safar@gmail.com>
1814
1815         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1816         GetLength method emit, it breaks resolve rules.
1817         
1818 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
1819             Marek Safar  <marek.safar@gmail.com>
1820                         
1821         A fix for bug #395542
1822         * cs-parser.jay: The trailing comma is allowed in anonymous type member
1823         declaration.
1824         
1825 2008-06-02  Marek Safar  <marek.safar@gmail.com>
1826
1827         A fix for bug #395287
1828         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1829
1830 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1831
1832         A fix for bug #395845
1833         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1834         non-nullable parameter type.
1835         
1836 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1837
1838         * class.cs: Handle contructor initializer as a statement in top-level block.
1839
1840 2008-05-30  Marek Safar  <marek.safar@gmail.com>
1841
1842         * attribute.cs: Don't mix old and new corlib types when emitting corlib
1843         security attributes.
1844
1845 2008-05-24  Marek Safar  <marek.safar@gmail.com>
1846
1847         * ecore.cs, expression.cs: Small IVariable refactoring.
1848
1849 2008-05-22  Marek Safar  <marek.safar@gmail.com>
1850
1851         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1852
1853 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1854
1855         * cs-parser.jay: Removed redundant catch type check.
1856
1857 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1858
1859         A fix for bug #390372
1860         * nullable.cs: Set correct return type.
1861
1862 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1863
1864         A fix for bug #391062
1865         * typemanager.cs: Fixed crash when comparing null types.
1866
1867 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1868
1869         A fix for bug #391871
1870         * cs-parser.jay: Better error handling for invalid catch type.
1871
1872 2008-05-20  Marek Safar  <marek.safar@gmail.com>
1873
1874         A fix for bug #392155
1875         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1876
1877 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1878
1879         A fix for bug #390666
1880         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1881         expressions.
1882
1883 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1884
1885         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1886         in getter.
1887
1888 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1889
1890         A fix for bug #389625
1891         * delegate.cs, generic.cs: Some progress on method group return type
1892         inference.
1893
1894 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1895
1896         A fix for bug #378419
1897         * namespace.cs: Inspect also parent namespaces not only namespace entries.
1898
1899 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1900
1901         * class.cs (Constructor): Added IsCompilerGenerated.
1902
1903 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1904
1905         * expression.cs: Enum binary operators can accept non-enum operand only when
1906         is implicitly convertible to underlying type.
1907
1908 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1909
1910         A fix for bug #389272
1911         * support.cs: Workaround System.InvalidOperationException for enums.
1912
1913 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1914
1915         A fix for bug #389073
1916         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1917
1918 2008-05-10  Marek Safar  <marek.safar@gmail.com>
1919
1920         * driver.cs: Split Parse.
1921         
1922         * location.cs (LookupFile): Uses string.Empty.
1923
1924 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1925
1926         * expression.cs, parameter.cs: Small ParameterReference clean up.
1927
1928 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1929
1930         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1931         hack. Fixes #387502.
1932
1933 2008-05-06  Martin Baulig  <martin@ximian.com>
1934
1935         * class.cs (Constructor.Emit): Fix the logic whether to emit
1936         symbol information.
1937
1938 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
1939
1940         Fix #385503
1941         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1942         InvalidOperationException when the iterator is before the start or
1943         after the end.
1944
1945 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1946
1947         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1948         when left is nullable type.
1949
1950 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1951
1952         A fix for bug #386628
1953         * expression.cs (LocalVariableReference): Continue in resolving when
1954         variable is not assigned.
1955
1956 2008-05-05  Marek Safar  <marek.safar@gmail.com>
1957
1958         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1959         nullable operations.
1960
1961 2008-05-04  Marek Safar  <marek.safar@gmail.com>
1962
1963         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1964         it saves many redundant temporary variables for nullable operations.
1965
1966 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1967
1968         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1969         
1970         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1971         method.
1972         
1973         * nullable.cs: Constant coalescing operator optimizations.
1974
1975 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1976
1977         * constant.cs: Use unsigned conversion for values which are unsigned only.
1978
1979 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1980
1981         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
1982         coalescing operator as it should be.
1983
1984 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1985
1986         A fix for bug #371016
1987         * expression.cs: All predefined delegate operators require implicit method
1988         group conversion.
1989         
1990 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1991
1992         * constant.cs: Emit long constant as uint when fits the range.
1993         
1994         * convert.cs, expression.cs: Fixed few unsafe conversions.
1995
1996 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1997
1998         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1999
2000 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2001
2002         Fix #385758
2003         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2004         'expr'.
2005         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2006
2007 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2008
2009         * constant.cs, literal.cs: IsLiteral property for error reporting.
2010         
2011         * ecore.cs, expression.cs: Implemented Property expression.
2012
2013 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2014
2015         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2016         
2017         * nullable.cs: Implemented nullable coalescing null operator.
2018
2019         * ecore.cs, expression.cs: Expression trees work.
2020
2021 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2022
2023         * ecore.cs: CreateExpressionTree is finally abstract.
2024
2025         * expression.cs, linq.cs: Updated.
2026
2027 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2028
2029         * expression.cs, ecore.cs: Block base access expression inside expression
2030         tree.
2031
2032 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2033
2034         A fix for bug #385058
2035         * expression.cs: User-defined operator implementations always take
2036         precedence over predefined operator implementations.
2037
2038 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2039
2040         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2041         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2042         expression tree conversions.
2043         
2044 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2045
2046         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2047         operators method details to Operator class.
2048
2049 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2050
2051         * anonymous.cs: Pass unsafe flags to anonymous container.
2052         
2053         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2054         inside expression tree.
2055
2056 2008-04-29  Martin Baulig  <martin@ximian.com>
2057
2058         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2059         (Tokenizer.PopPosition): Also restore the `line'.
2060
2061 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2062
2063         * delegate.cs: Implemented Invoke expression.
2064
2065 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2066
2067         * expression.cs: Fixed equality reference comparison regression.
2068
2069 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2070
2071         * ecore.cs: Clean up EmptyCast hack.
2072         
2073         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2074         using correct conversion rules. Also fixes #383993.
2075
2076 2008-04-28  Martin Baulig  <martin@ximian.com>
2077
2078         * class.cs (Constructor.Emit): Don't emit debugging information
2079         for generated default .ctor's.
2080
2081 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2082
2083         * convert.cs: Empty-cast ushort to int conversion.
2084
2085 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2086
2087         A fix for bug #384191
2088         * ecore.cs, expression.cs: Fixed expression cloning.
2089
2090 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2091
2092         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2093
2094 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2095
2096         Fix #381559, test-638.cs, test-639.cs
2097         * assign.cs (CompoundAssign.Helper): New wrapper.
2098         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2099         access.
2100         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2101         Pass unconverted expressions to the params array creation expression.
2102         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2103         (PropertyExpr.EmitAssign): Likewise.
2104         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2105         element if it is of kind CompoundAssign.Helper.
2106         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2107         first before anything else.
2108         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2109         (ArrayAccess.LoadArrayAndArguments): Simplify.
2110
2111 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2112
2113         * expression.cs: Fixed cloning of typeof(void).
2114
2115 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
2116
2117         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2118         (Assign.Emit): Likewise.  Move it to ...
2119         (CompoundAssign.DoResolve): ... here and ...
2120         (CompoundAssign.Emit): ... here.
2121         (EventAddOrRemove): New helper to handle += and -= on events, and
2122         avoid the use of BinaryDelegates.
2123         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2124         (EventExpr.EmitAddOrRemove): Improve.
2125         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2126
2127         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2128         create VarExprs for 'foo.bar.var'.
2129         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2130         is a highly inappropriate name for its functionality.
2131
2132 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2133
2134         Simplify handling of multiple assignments
2135         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
2136         inheritable-only.
2137         (SimpleAssign): New.  Class to be used for normal assignments.
2138         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2139         * expression.cs, parameter.cs, statement.cs: Likewise.
2140
2141 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2142
2143         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2144         for incompatible underlying types, more to come, uff.
2145
2146 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2147
2148         Fix gtest-388.cs
2149         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2150         Handle 'leave_copy'.
2151
2152 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2153
2154         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2155
2156 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
2157
2158         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
2159         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2160         * statement.cs (While, Do, For): Allow test to have side effects.
2161         (For.DoEmit): Always emit InitStatement.
2162
2163         Fix test-635.cs
2164         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2165         Always create SideEffectConstant.
2166         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2167         of type EnumConstant.
2168
2169         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2170         Handle 'right' being SideEffectConstant of type 'bool'.
2171
2172         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2173         Use left.EmitBranchable instead of open coding it, so as to
2174         improve optimization opportunities.
2175
2176         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2177
2178         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2179         assumptions.
2180         (Expression.EmitSideEffect): Document.
2181
2182 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2183
2184         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2185
2186 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2187
2188         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2189
2190 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2191
2192         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2193         conversion to expression tree.
2194
2195 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2196
2197         * ecore.cs: Removed unused expression.
2198
2199 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2200
2201         * expression.cs: Implemented NegateChecked and New expressions.
2202
2203 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2204
2205         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2206
2207 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
2208
2209         Fix #351102
2210         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2211         needing final 'ret' instruction.
2212
2213 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2214
2215         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2216
2217 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2218
2219         * expression.cs: Emit ldnull and not null expression as an instance argument
2220          of static method expression calls.
2221
2222 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2223
2224         A fix for bug #378200
2225         * expression.cs: Fixed crash when creating parameterless expression tree
2226         method call.
2227
2228 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2229
2230         A fix for bug #375297
2231         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2232         method.
2233
2234 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2235
2236         A fix for bug #377596
2237         * decl.cs, class.cs: Emit delegate type argument attributes.
2238
2239 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2240
2241         A fix for bug #365314
2242         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2243         
2244 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2245
2246         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2247         only.
2248
2249 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2250
2251         * generic.cs (TypeParameter): Removed redundant location.
2252
2253 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2254
2255         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2256         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2257         FullNamedExpression in all declaration type expression, statements will come
2258         later.
2259
2260 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2261
2262         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2263         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2264
2265 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2266
2267         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2268         code.
2269
2270 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2271
2272         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2273         constraints.
2274
2275 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2276
2277         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2278         name expressions.
2279         Also fixes #340463.
2280
2281 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2282
2283         Hook up 'EmitSideEffect'
2284         * constant.cs (Constant.EmitSideEffect): New.
2285         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2286         (SideEffectConstant.EmitSideEffect): New.
2287         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2288         unconditional branch in EmitBranchable.
2289         (FieldExpr.EmitBranchable): New.
2290         * expression.cs (Unary.EmitSideEffect): New.
2291         (Binary.EmitSideEffect): New.
2292         (VariableReference.EmitSideEffect): New.  Do nothing.
2293
2294 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2295
2296         Introduce 'EmitSideEffect'
2297         * ecore.cs (Expression.EmitSideEffect): New.
2298         (TypeCast): Rename from EmptyCast.
2299         (EmptyCast): New.
2300         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2301         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2302         * convert.cs, nullable.cs: Update to changes.
2303
2304 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2305
2306         * class.cs, cs-parser.jay: Early check for base types expression.
2307
2308 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2309
2310         * decl.cs (MemberName): Declare PrettyName as obsolete.
2311
2312 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2313
2314         * namespace.cs: Use MemberName comparison.
2315
2316 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2317
2318         Fix build break
2319         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2320         FullName.
2321         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2322         (MemberName.FullyQualifiedName): New.  Provides the functionality
2323         that users assume FullName would have.
2324         * ecore.cs, namespace.cs: Update to changes.
2325
2326         * statement.cs (Using.assign): Make into ExpressionStatement.
2327         (Using.EmitPreTryBody): Simplify.
2328
2329 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2330
2331         * report.cs: ColorFormat is protected.
2332         
2333         * rootcontext.cs: Unused fields clean-up.
2334         
2335         * namespace.cs: Made UsingEntry name private.
2336
2337 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2338
2339         * cs-tokenizer.cs, location.cs: Removed unused field.
2340
2341 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2342             Raja R Harinath  <harinath@hurrynot.org>
2343
2344         Fix #379822
2345         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2346         (SideEffectConstant.side_effect): Rename from 'right'.
2347         (SideEffectConstant..ctor): Normalize 'side_effect'.
2348         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2349         value of this constant.
2350         * cfold.cs: Update to changes.
2351
2352 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2353
2354         * cs-paser.jay: Removed unused variable.
2355         
2356         * driver.cs: Made Compile instance method.
2357
2358 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2359
2360         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2361
2362 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2363
2364         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2365
2366 2008-04-13  Jb Evain  <jbevain@novell.com>
2367
2368         * namespace.cs: update the System.Core fullname for 2.1
2369         * driver.cs: update the list of required assemblies for 2.1.
2370         Merged from the Moonlight 2 branch.
2371
2372 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2373
2374         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2375         types and user defined operators. User operators arguments has to be checked
2376         for null value before invocation, which also means no operator is called
2377         when any argument is not convertible to unwrapped nullable type.
2378         
2379 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2380
2381         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2382         of Unary expressions to follow operator overloading rules precisely.
2383         Also fixes #321794, #323794
2384         
2385 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2386
2387         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2388         expression.
2389         
2390 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2391
2392         * expression.cs, ecore.cs: Implemented MemberInit expression.
2393         
2394 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2395
2396         Fix mono/tests/exception4.cs
2397         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2398         ec.NeedReturnLabel () rather emitting a 'nop'.
2399
2400         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2401         simple heuristic.
2402         (TryCatch.SomeCodeFollows): Likewise.
2403         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2404         for 'break', 'continue' and 'return' statements inside a try.
2405         We're fairly sure that the generated IL stream will have more
2406         instructions textually following the try.
2407         (FlowBranchingTryCatch): Likewise.
2408
2409         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2410         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2411         overrides.
2412
2413         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2414         wrapper -- forward everything to CollectionForeach.
2415         (CollectionForeach.NonDisposableWrapper): New.
2416         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2417         instead of a pop + branch to end.
2418
2419 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2420
2421         A fix for bug #377485
2422         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2423         Propagate location for extension method groups. Report conversion failure at
2424         right place.
2425
2426 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2427
2428         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2429         ListInit and Field expressions.
2430
2431 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2432
2433         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2434         Since $PC is always -1 inside the body of MoveNext, the fault
2435         handler is a no-op.
2436         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2437         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2438         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2439
2440         The denouement!  Fix #324708
2441         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2442         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2443         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2444         'finally' inside the finally clause.
2445
2446         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2447         inside an iterator.  Don't emit the body of the 'finally' inside
2448         the finally clause yet.
2449
2450         Use the ResumableStatement infrastructure for MoveNext ()
2451         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2452         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2453         'old_resume_points'.  Move dispatcher upfront.
2454         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2455         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2456         in an enumerator.  This encodes the main fix in this patch series
2457         -- we can only jump into the first instruction of a try from the
2458         outside, but we want to emit try/finally regions in iterators and
2459         resume in the middle of them.
2460
2461 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2462
2463         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2464         of NeedReturnLabel here.
2465
2466         Introduce a common point for emitting try/finally to IL
2467         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2468         features of the various subclasses, which are now driven by ...
2469         (ExceptionStatement.EmitPreTryBody): ... this and ...
2470         (ExceptionStatement.EmitTryBody): ... this and the original
2471         EmitFinallyBody.
2472         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2473         Remove DoEmit and update to follow above protocol.
2474
2475         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2476         of the dispatcher are the same, skip emitting the 'switch'.
2477         * iterator.cs (Iterator.EmitDispose): Update to changes.
2478
2479         Clean up handling of 'using' statement
2480         * statement.cs (UsingTemporary): New.  Carved out of ...
2481         (Using): ... this.  Simplify drastically.  Handle exactly
2482         one variable.
2483         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2484         or Using as appropriate.  If there are multiple variable declared,
2485         create nested Using statements.
2486         (resource_acquisition): Kill.
2487
2488         * statement.cs (ExceptionStatement.EmitForDispose): Use
2489         EmitFinallyBody, not EmitFinally.
2490
2491         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2492         * iterator.cs: Update to changes.
2493
2494         Start using the ResumableStatement infrastructure
2495         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2496         (ResumableStatement.EmitForDispose): New.
2497         (ExceptionStatement): Override them.
2498         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2499         EmitForDispose to create the body of the Dispose method.  Don't
2500         use OldResumePoint.
2501
2502         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2503         * statement.cs (Toplevel.AddResumePoint): ... here.
2504         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2505         * flowanalysis.cs (FlowBranchingIterator): New.
2506         * codegen.cs (EmitContext): Update to changes.
2507
2508         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2509         (Iterator.old_resume_points): Rename from 'resume_points'.
2510         (Iterator.MoveNextStatement): Remove unused class.
2511
2512         New infrastructure for try/finally in iterators (still unused)
2513         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2514         (FlowBranchingToplevel.AddResumePoint): Hook into
2515         ToplevelBlock.AddResumePoint.
2516         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2517         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2518         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2519         resume points and assign program-counter values.
2520         (ExceptionBlock.AddResumePoint): Collect resume points for
2521         de-muxer at the top of try block.
2522         * iterators.cs (Yield.CheckContext): Simplify.
2523         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2524
2525 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2526
2527         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2528         argument to an ExitStatement.
2529         (FlowBranchingException): Refactor saved origins code.
2530         * statement.cs (ExitStatement): Update to cahges.
2531         * iterator.cs (YieldBreak): Likewise.
2532
2533         * statement.cs (ResumableStatement): New.  Common base class for
2534         YieldReturn and ExceptionStatement.
2535         (ExitStatement): New.  Common base class for Return and YieldBreak.
2536         (Return): Update to changes.
2537         * iterator.cs (YieldBreak): Likewise.
2538         * lambda.cs (ContextualReturn): Likewise.
2539
2540         Fix #377028
2541         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2542         emit a meaningful error message.
2543
2544         Fix #324765, #319508
2545         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2546         (VariableInfo.SetAssigned): Set it.
2547         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2548         determine if CS0219 or CS0168 is appropriate.  Don't use
2549         flow-analysis information.
2550         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2551         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2552         (EmitContext.EndFlowBranching): ... this.
2553
2554 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2555
2556         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2557
2558 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2559
2560         A fix for bug #376508
2561         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2562         ImplicitConversionExists.
2563
2564 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2565
2566         * expression.cs (Binary): Added remaining binary operators to expression
2567         tree builder.
2568
2569         * nullable.cs: Optimize shift with null argument.
2570
2571 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2572
2573         Fix minor IL regression
2574         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2575         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2576         * cs-parser.jay (try_statement): Update to changes.
2577
2578         * statement.cs (TryFinally.need_exc_block): Delete.
2579         (TryFinally): Update to changes.
2580
2581         Now all ExceptionStatements are unconditional
2582         * statement.cs (CollectionForeach.DisposableWrapper): New.
2583         Extract out the try/finally code into a new wrapper.
2584         (CollectionForeach.Resolve): Use it to simplify the code.
2585
2586 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2587
2588         Start at simplifying ExceptionStatement semantics a bit
2589         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2590         * cs-parser.jay (try_statement): Update to changes.
2591         (opt_catch_clauses): Remove.
2592         * flowanalysis.cs: Update to changes.
2593         (FlowBranching.BranchingType.TryCatch): New.
2594         (FlowBranchingTryCatch): New.
2595
2596         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2597         (FlowBranching.CreateBranching): Update to changes.
2598         (FlowBranchingBlock.AddSibling): Add sanity check.
2599         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2600         Update to changes.
2601
2602         * iterators.cs (Iterator.MarkFinally): Remove.
2603         * statement.cs (ExceptionStatement): Update to changes.
2604
2605         Add support for skipping over finally blocks at runtime.  First
2606         in a series to fix #324708
2607         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2608         (Iterator.EmitMoveNext): Initialize it.
2609         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2610         branch over the body of the 'finally' clause.
2611
2612 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2613
2614         Avoid lopsided use of Foo/DoFoo names
2615         * statement.cs (ExpressionStatement.EmitFinallyBody):
2616         Rename from EmitFinally.
2617         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2618         * iterator.cs: Update to changes.
2619
2620 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2621
2622         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2623         based on UserOperatorCall. More binary nullable operators clean up.
2624
2625 2008-04-02  Martin Baulig  <martin@ximian.com>
2626
2627         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2628
2629 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2630
2631         * nullable.cs: Merge user and empty conversions when lifting expression
2632         trees.
2633         
2634         * expression.cs (StringConcat): Implemented expression tree representation.
2635
2636 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2637
2638         * nullable.cs: When lifting null literal and a user operator exists, no call 
2639         is made.
2640         
2641 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2642
2643         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2644         null.
2645
2646 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2647
2648         * nullable.cs, expression.cs: Use namespace instead heavily nested
2649         monster abstract class.
2650
2651 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2652
2653         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2654         lifting of null literal and user operators. Clean up of some temporary
2655         nullable hacks.
2656
2657 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
2658
2659         Fix #368224, test-629.cs
2660         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2661         if it crossed an unwind-protect boundary.
2662         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2663         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2664         inside an unwind-protected region.
2665         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2666         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
2667         'leave' instead of a 'br' if unwind-protected.
2668         (Iterator.EmitYieldBreak): Likewise.
2669
2670 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
2671
2672         * driver.cs: Only define versioninfo resources if no win32 resource
2673         file was specified.
2674
2675 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2676
2677         A fix for bug #372375
2678         * convert.cs: Fixed boxing of nullable types.
2679
2680 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2681
2682         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2683         type.
2684
2685 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2686
2687         A fix for bug #374619
2688         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2689         
2690 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2691
2692         * lambda.cs: Check return type only for invocation.
2693         
2694 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2695
2696         A fix for bug #374214
2697         * ecore.cs: Correctly report argument type mismatch.
2698
2699 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2700
2701         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2702         and not rely on broken IsEnum.
2703
2704 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2705
2706         * nullable.cs: New file, extracted from generic.cs.
2707         
2708         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2709
2710 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2711
2712         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2713         predefined comparison operators and null literals.
2714         
2715         * report.cs: New warning ID.
2716         
2717 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2718
2719         A fix for bug #370577
2720         * lambda.cs: Check return type too.
2721
2722 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2723
2724         A fix for bug #372846
2725         * class.cs: Automatic properties can be declared as unsafe.
2726
2727 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2728
2729         * location.cs: Use string based concatenation.
2730         
2731         * expression.cs: LiftedBinaryOperator is gmcs only.
2732         
2733 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2734
2735         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2736         conversions rules and expression trees.
2737
2738 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2739
2740         * delegate.cs: Use extension method source as delegate target.
2741
2742 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2743
2744         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2745         binary operations to be purely based on binary operations and optimized
2746         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2747         and other ET refactoring.
2748         
2749         * typemanager.cs: Fixed warning.
2750         
2751 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2752
2753         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2754         
2755         * symbolwriter.cs: Fixed.
2756
2757 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2758
2759         * anonymous.cs, driver.cs: Reset anonymous types counters.
2760
2761 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2762
2763         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2764         
2765         * class.cs: Use fullname for all type member definitions.
2766         
2767 2008-02-19  Martin Baulig  <martin@ximian.com>
2768
2769         * class.cs
2770         (IMethodData.EmitExtraSymbolInfo): New interface method.
2771         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2772         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2773         interface method here as an empty public virtual method.
2774
2775         * anonymous.cs
2776         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2777         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2778         CodeGen.SymbolWriter.SetRealMethodName().       
2779
2780 2008-02-18  Martin Baulig  <martin@ximian.com>
2781
2782         * anonymous.cs
2783         (ScopeInfo.EmitType): Override this and emit debugging
2784         information for captured variables.
2785         (RootScopeInfo.EmitType): Override this and emit symbol
2786         information for a captured `this'.
2787
2788 2008-02-15  Martin Baulig  <martin@ximian.com>
2789
2790         * iterators.cs: Emit debugging info.
2791
2792         * codegen.cs
2793         (EmitContext.Flags): Add `OmitDebuggingInfo'.
2794         (EmitContext.OmitDebuggingInfo): New public property.
2795
2796         * statement.cs
2797         (While): Override Emit() and don't emit symbol info there; do it
2798         inside DoEmit() instead.
2799         (Block.Emit): Omit symbol information while emitting the scope
2800         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
2801         block logic.
2802         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2803         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2804         .ctor to make `IsIterator' work.
2805
2806 2008-03-14  Martin Baulig  <martin@ximian.com>
2807
2808         * symbolwriter.cs: Added the new symbol writer function from the
2809         debugger's `terrania' branch; temporarily enclose them inside
2810         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2811         my vacations.
2812
2813 2008-03-14  Martin Baulig  <martin@ximian.com>
2814
2815         * symbolwriter.cs
2816         (SymbolWriter): Make this a public static class.
2817
2818         * codegen.cs
2819         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2820         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2821
2822 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2823
2824         A fix for bug #370577
2825         * statement.cs, lambda.cs: Added extra limitations when dealing with void
2826         return type.
2827         
2828 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2829
2830         * typemanager.cs (CSharpName): Made 250 times faster.
2831
2832 2008-03-13  Marek Safar  <marek.safar@gmail.com>
2833
2834         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2835         
2836 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2837
2838         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2839         crash when predefined field does not exist.
2840         
2841 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2842
2843         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2844         
2845 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2846
2847         * class.cs (FixedField): Don't crash when contructors are missing.
2848
2849 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2850
2851         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2852         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2853         check internal types accessibility for internal and external types.
2854         Replaced EnumToUnderlying by GetEnumUnderlyingType.
2855
2856 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2857
2858         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2859         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2860         attribute.cs, statement: Use corect instance of predefined types (work
2861         related to #364674).
2862
2863 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2864
2865         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2866         
2867 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2868
2869         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
2870         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2871         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2872         predefined types clean up, delayed predefined types members initialization
2873         (work related to #364674).
2874
2875 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2876
2877         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2878         
2879 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2880
2881         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2882         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2883         predefined types clean up (work related to #364674).
2884
2885 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2886
2887         * ecore.cs: Print an error message instead of throwing exception.
2888         
2889 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2890
2891         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2892         expression.cs, statement.cs: Unififed null literal representation.
2893
2894 2008-03-03  Marek Safar  <marek.safar@gmail.com>
2895
2896         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2897         expression.cs: Refactored binary operators resolve phase and improved speed.
2898         The nullable code is still missing and won't work correctly, more fixes
2899         required.
2900
2901         It also fixes #323726, #324312, #324248, and many other unreported issues.
2902
2903 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
2904
2905         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
2906         instead of 'gmcs'.
2907
2908 2008-02-27  Marek Safar  <marek.safar@gmail.com>
2909
2910         * ecore.cs: Clean-up and split BetterConversion.
2911         
2912 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
2913
2914         Fix #363791
2915         * enum.cs (EnumMember.Value): Only access 'value' if
2916         ResolveValue says it's ok.
2917         (EnumMember.DoResolveValue): Don't set prev_member.value.
2918         (Enum.GetDefinition): Reverse arguments of Equals --
2919         EnumMember.Value can return 'null'.
2920
2921         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2922
2923 2008-02-22  Marek Safar  <marek.safar@gmail.com>
2924
2925         * generic.cs, expression.cs: More ongoing work on expression trees.
2926         
2927 2008-02-21  Marek Safar  <marek.safar@gmail.com>
2928
2929         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2930         handle missing matches when mutiple operators exist.
2931         
2932 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2933
2934         A fix for bug #363218
2935         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2936         initializers.
2937         
2938 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2939
2940         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2941         update. This time to deal correctly with SideEffectConstant expression used
2942         as an argument for another constant folding.
2943
2944 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
2945
2946         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2947         MethodBuilder.
2948
2949 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2950
2951         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2952
2953 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2954
2955         A fix for bug #328136
2956         * expression.cs: Do not fold immediately LogicalAnd operators when the left
2957         side is a false constant, because we still need to evaluate the right-hand
2958         side.
2959
2960         * statement.cs (If): Emit two types of boolean constants (simple constant,
2961         side-effect constant).
2962
2963 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2964
2965         * constant.cs (SideEffectConstant): Don't emit boolean constant.
2966
2967         * expression.cs: Fold immediately LogicalAnd operators when both sides are
2968         constants.
2969
2970 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2971
2972         A fix for bug #361457
2973         * ecore.cs (IsApplicable): Params methods have lower priority.
2974
2975         * support.cs: Return correct parameter modifier for params types.
2976
2977 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2978
2979         * generic.cs (TypeParameter): Cache attribute target name.
2980
2981         * support.cs: Removed unused variable.
2982
2983         * typemanager.cs: Removed debugging leftover.
2984
2985         * ecore.cs: Use local type instead of a property;
2986
2987         * class.cs (VerifyMembers): Consider also parent to test whether type member
2988         is local or public.
2989
2990         * expression.cs (FullMethodDesc): Removed.
2991
2992         * attribute.cs (IsValidArgumentType): Made static.
2993
2994 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
2995
2996         Cleanup to be more readable.
2997         * Makefile (GMCS_PROFILE): Remove.
2998         (COMPILER_NAME): New helper.
2999
3000 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3001
3002         * cs-tokenizer.cs: if a conditional expression happens inside a
3003         (...) this also means that we do not need to de-ambiguate between
3004         an parenthesized expression and a cast.
3005
3006         Fixes 346484.
3007
3008         * constant.cs (SideEffectConstant): a constant value that happens
3009         to have a side effect.
3010
3011         Fixes the build regressions introduced by the fix for #359789
3012
3013 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3014
3015         * expression.cs (Conditional.Emit): when emitting the ternary
3016         operator, use local variables to generate code verifiable code.
3017
3018         The verifier cannot infer that the type on stack before the
3019         stloc.0 is executed is of type ParentB. This happens because the
3020         stack merge algorithm uses only parent types when deciding which
3021         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3022         335.
3023
3024         This code compiled with mcs is not verifiable under MS. The MS
3025         verifier picks the first common interface of Foo and Bar, which is
3026         wrong, but doesn't use a full join type of the 2 interfaces.
3027
3028         CSC uses a clever hack to compile such code in a verifiable
3029         way. It stores the intermediate values in a local variable with
3030         the expected type.
3031
3032         Fixes: #358102
3033
3034 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3035
3036         * expression.cs: Do not fold BitwiseAnd operators when the left
3037         side is a false constant, because we still need to evaluate the
3038         right-hand side.
3039
3040         Fixes #359789
3041
3042         * support.cs: Instead of throwing an InternalErrorException when
3043         the position of the stream is outside the boundary of our buffer,
3044         reset the state of the reader, and restart the reading from the
3045         beginning of the file.
3046
3047 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3048
3049         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3050
3051 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3052
3053         A fix for bug #361686
3054         * decl.cs: A protected types used inside a private class which parents
3055         derives from the protected class are accessible.
3056
3057 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3058
3059         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3060         the parameterless constructor.
3061
3062 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3063
3064         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3065         lookup methods to use standard member cache when doing member lookup.
3066
3067 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3068
3069         * driver.cs: Don't report full path for referenced module as assembly error.
3070
3071 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3072
3073         * Makefile: Fixed `qh' target to work on all machines.
3074
3075         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3076         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3077         and HasElementType with TypeManager implementation.
3078
3079 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3080
3081         A fix for bugs #325134, #359749
3082         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3083         first binds point to non-method member expression.
3084
3085 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3086
3087         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3088
3089 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3090
3091         A fix for bugs #321394, #323028
3092         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3093         Reworked naive IsAccessibleAs implementation to handle nested types.
3094
3095 2008-02-05  Jb Evain  <jbevain@novell.com>
3096
3097         * class.cs: use generic type comparison for parameters
3098         as well.
3099
3100 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3101
3102         A fix for bug #325372
3103         * class.cs: Use generic type comparison when testing method signatures.
3104
3105 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3106
3107         A fix for bug #357047
3108         * ecore.cs: Applied C# 3.0 changes to better conversion.
3109
3110 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3111
3112         A fix for bug #358374
3113         * cs-parser.jay: Correctly set modifiers for all constructor types.
3114
3115 2008-02-04  Marek Safar  <marek.safar@gmail.com>
3116
3117         A fix for bug #355251
3118         * generic.cs: Added base class constraint based type inference.
3119
3120 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3121
3122         A fix for bug #357255
3123         * decl.cs: One more missing visibility check.
3124
3125 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3126
3127         * support.cs: Fixed broken return.
3128
3129 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3130
3131         * report.cs: Correctly reset warnings count after probing.
3132
3133 2008-01-25  Martin Baulig  <martin@ximian.com>
3134
3135         * namespace.cs
3136         (NamespaceEntry.SymbolFileID): Make this work again after
3137         MemberName.ToString() is gone.
3138
3139 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3140
3141         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3142         expressions.
3143
3144 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3145
3146         * generic.cs: Use full implicit conversion for type inference fixing.
3147
3148 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3149
3150         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3151         Fixed user operator conversions.
3152
3153 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3154
3155         * generic.cs: Do nullable type to null comparison optimization during
3156         resolve phase.
3157
3158 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3159
3160         A fix for bug #355163
3161         * generic.cs: Enabled l-value resolve on nullable expressions.
3162
3163 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3164
3165         A fix for bug #353986
3166         * class.cs: Ingore static ctors with parameters for any further checks.
3167
3168 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3169
3170         A fix for bug #354310
3171         * namespace.cs: Removed redundant check.
3172
3173 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3174
3175         A fix for bug #354928
3176         * expression.cs: ElementInitializers can be resolved only once.
3177
3178 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3179
3180         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3181         Condition expressions.
3182
3183 2008-01-23  Marek Safar  <marek.safar@gmail.com>
3184
3185         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3186
3187 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3188
3189         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3190         not allowed.
3191
3192         * generic.cs: Implemented coalesce expression.
3193
3194 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3195
3196         A fix for bug #355145
3197         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3198         expression tree type inference.
3199
3200 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
3201
3202         Fix #354663
3203         * expression.cs (Binary.IsUnsignedType): Fix typo.
3204
3205 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3206
3207         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3208
3209 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3210
3211         A fix for bug #355161
3212         * ecore.cs, expression.cs: Wider range of extension method supported
3213         expressions.
3214
3215 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
3216
3217         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3218         AssemblyBuilder to operate in compiler context. Fixes mcs part of
3219         bug #354970.
3220
3221 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3222
3223         A fix for bug #355148
3224         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3225
3226 2008-01-22  Miguel de Icaza  <miguel@novell.com>
3227
3228         * expression.cs (CreateExpressionTree): Add support for or and
3229         logical or, and indent following the coding conventions.
3230
3231         * typemanager.cs (LinqExpression): renamed from
3232         ExpressionTreeManager, for a shorter name.
3233
3234         Use TypeManager.CoreLookupType to lookup types from our core
3235         assemblies and turn those into "Type" variables.
3236
3237         Consumers that previously used "Namespace" and "Type" from this
3238         class should instead use the TypeExpression which is a type that
3239         is fully resolved (without involving the regular C# resolution
3240         rules). 
3241
3242         This typically looks like this:
3243
3244         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3245         new MemberAccess (texpr, name, type_arguments, loc)
3246
3247         This avoids the problem in: #355178
3248
3249 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3250
3251         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3252         feature in parser only as we do in other cases.
3253         
3254 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3255
3256         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3257         typemanager.cs: A refactoring of params arguments to reuse existing
3258         expressions (params -> array initializer) to emit params argument instead
3259         of specialized handling.
3260         It was required by expression tree implementation and it has other benefits
3261         as well, we now apply same optimization for params arguments as we do for
3262         array initializers.
3263         
3264 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3265
3266         A fix for bug #353526
3267         * generic.cs: A type inference of params arguments may not required any
3268         temporary array creation.
3269         
3270 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3271
3272         A fix for bug #353534
3273         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3274         supported for delegates only.
3275         
3276 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3277
3278         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3279         type for more than 1 candidates.
3280         
3281 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3282
3283         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3284         expressions.
3285         
3286 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3287
3288         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3289         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3290         operator) expressions. 
3291                 
3292 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3293
3294         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3295         not accessed from the generated IL.
3296
3297 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3298
3299         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3300         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3301         statement.cs: The first expression tree implementation drop, mostly
3302         infrastructure work.
3303
3304 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3305
3306         * ecore.cs (IsNestedChild): Refactored.
3307
3308 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3309
3310         * lambda.cs: Don't use a cast on unknown expression statement.
3311
3312 2008-01-10  Geoff Norton  <gnorton@novell.com>
3313
3314         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3315         arguments
3316
3317 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3318
3319         * doc.cs: Report better /doc crash details.
3320         
3321 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3322
3323         A fix for bug #352536
3324         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3325
3326 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3327
3328         A fix for bug #352287
3329         * ecore.cs, expression.cs: Do `this' access checking in all member access
3330         expressions.
3331         
3332 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3333
3334         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3335         
3336         * report.cs: Reset message stacks.
3337         
3338 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3339
3340         * generic.cs (InferInPhases): Correctly calculate params position.
3341         
3342 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3343
3344         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3345         arguments.
3346
3347 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3348
3349         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3350         
3351         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3352         
3353         * driver.cs: Updated --help option.
3354         
3355 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3356
3357         * generic.cs (InferParamsTypeArguments): Removed.
3358         (InferInPhases): Add params type inference.
3359         (LowerBoundInference): Fixed scoring mechanism.
3360         
3361         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3362         
3363 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3364
3365         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3366         byte array for unsigned "baked" assemblies.
3367
3368 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3369
3370         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3371         array for assemblies that are not strongnamed.
3372
3373 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3374
3375         A fix for bug #351481
3376         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3377         declaring type for nested generic types.
3378         
3379 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3380
3381         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3382         instead of ToString.
3383         
3384 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3385
3386         A fix for bug #351047
3387         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3388         null and structs only when equality and inequality operators are defined
3389         either as an user-operators or predefined operators.
3390         
3391 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3392
3393         A fix for bug #351047
3394         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3395         
3396 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3397
3398         A fix for bug #351257
3399         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3400         
3401 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3402
3403         A fix for bug #351157
3404         * class.cs (Using): Fixed yet another broken cloning.
3405         
3406         (Block): Put back more sensible default value for statements.
3407         
3408 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3409
3410         * codegen.cs: Allow AssemblyVersion with only major version component.
3411         Fixes bug #351055.
3412
3413 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3414
3415         A fix for bug #324654
3416         * class.cs: Use FullName property as member name.
3417
3418 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3419
3420         A fix for bug #342117
3421         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3422         constructor constraint.
3423
3424 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3425
3426         A fix for bug #338273
3427         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3428         only.
3429
3430 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3431
3432         A fix for bug #350839
3433         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3434
3435 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3436
3437         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3438         GHOP:
3439         
3440         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3441
3442         * statement.cs: Changed some Hashtables to use HybridDictionaries
3443         instead. It was observed that some HashTables only contained a few
3444         items in the vast majority of cases. Since HybridDictionary is
3445         more efficient on small sets (<10 elements), "known_variables"
3446         from class ExplicitBlock as well as "labels" and "constants " from
3447         class Block were changed to HybridDictionaries. 
3448
3449         Atsai results: (56216kb->54987kb)
3450
3451         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3452
3453
3454 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3455
3456         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3457         GHOP:
3458         
3459         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3460         
3461         * expression.cs: foreach loop to for loop, saved on allocation of
3462         enumerator (59333kb->59141kb)
3463
3464         * statement.cs. Changed foreach loops to for loops, saved on
3465         allocation of enumerator (59141kb->59006kb)
3466
3467         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3468         when constructed with no specified capacity. This was causing a
3469         few ArrayLists to allocate more memory than they would potentially
3470         need in the Block class and MemberCache class. Setting the
3471         ArrayLists to construct with a capacity of 1 saves some
3472         memory. (56216kb->55585kb)
3473
3474 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3475
3476         A fix for bug #347189 (2nd issue)
3477         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3478         type.
3479
3480 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3481         
3482         * report.cs: Do not use colors if stdout and stderr are not a
3483         terminal.
3484
3485 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3486
3487         A fix for bug #346998
3488         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3489         overloads.
3490
3491 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3492
3493         A fix for bug #343465
3494         * class.cs: Explicit method name for nested types uses dots only.
3495
3496 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3497
3498         A fix for bug #343707
3499         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3500
3501 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3502
3503         * ecore.cs: Report type inference errors only when arguments count matches
3504         parameter count.
3505         
3506         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3507         
3508         * expression.cs, report.cs: New warning.
3509         
3510         * typemanager.cs: Catch anonymous method type too.
3511
3512 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3513
3514         A fix for bug #346379
3515         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3516
3517 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3518
3519         A fix for bug #347359
3520         * expression.cs (Invocation): Don't resolve already resolved expression.
3521
3522 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3523
3524         A fix for bug #347189
3525         * class.cs (FixedField): Use non-dependent code only in the define phase.
3526
3527 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3528
3529         A fix for bug #348076
3530         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3531
3532 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3533
3534         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3535         discovered extension methods.
3536
3537 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3538
3539         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3540         method.
3541
3542 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3543
3544         * report.cs (ErrorMessage): Add support for using colors on
3545         terminals that support it. 
3546
3547 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3548
3549         * ecore.cs: Use information about expanded params for error reporting.
3550
3551 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3552
3553         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3554         and logic for params overloads.
3555         
3556 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3557
3558         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3559         as this is also created from the parser.  Fixes #349034
3560
3561 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3562
3563         * statement.cs (Throw.CloneTo): it is valid to have empty
3564         expressions for throw. 
3565
3566 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3567
3568         * cs-parser.jay: Set delegate constraint parsing region correctly.
3569
3570 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3571
3572         A fix for bug #345467
3573         * typemanager.cs (IsEqual): Compare generic parameters position only.
3574         
3575 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3576
3577         * expression.cs (BaseAccess): Type arguments can be null.
3578
3579 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3580
3581         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3582         consistent even when an error has occured.
3583         (Switch.Resolve): Likewise.
3584
3585 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3586
3587         A fix for bug #334505
3588         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3589         overrides.
3590         
3591 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3592
3593         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3594         refactorings required to resolve extension methods correctly when mixing
3595         generics and non-generics members.
3596         
3597 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3598
3599         A fix for bug #342584
3600         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3601         conversion.
3602         
3603 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3604
3605         A fix for bug #342512
3606         * delegate.cs: Use delegate argument expression when is available. Don't
3607         emit virtual call when class is sealed.
3608         
3609 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3610
3611         A fix for bug #325423
3612         * assign.cs (FieldInitializer): Use resolved expression for emit.
3613         
3614         * class.cs: Print less confusing error message.
3615         
3616 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3617
3618         * cs-tokenizer.cs: Removed GMCS ifdefs.
3619         
3620         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3621         mcs.
3622         
3623         * cs-parser.jay: Disabled nullable check.
3624         
3625         * generic-mcs: Copied more generic stuff.
3626                 
3627 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3628
3629         * gcs-parser.jay: Merged to cs-parser.jay.
3630         
3631         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3632         * *.csproj, *.sources: Updated to use only jay parser file.
3633
3634 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3635
3636         * gcs-parser.jay: Added nullable and default expression feature checks.
3637         
3638 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3639
3640         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
3641         it fixes many TODOs and hidden bugs.
3642         
3643         * expression: Removed duplicate error check.
3644
3645 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3646
3647         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3648         implicitly type local variable only when it is used in a declaration.
3649
3650 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3651
3652         * attribute.cs: Use CS0612 for empty strings.
3653
3654 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3655
3656         * lambda.cs, statement.cs: Contextual return may act as a statement.
3657
3658 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3659
3660         A fix for a regression cause by #324222
3661         * class.cs: Don't report unused even when it implements an interface.
3662         
3663 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3664
3665         A fix for bug #341205
3666         * ecore.cs, expression.cs: Method group expression cannot do static
3667         method access with an instance reference check before overloading takes
3668         a place.
3669         
3670 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3671
3672         A fix for bug #325359
3673         * class.cs: Use predictable name for automatically generated property.
3674         
3675 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3676
3677         A fix for bug #324996
3678         * expression.cs (Is): Handle case where D is nullable and T is not
3679         correctly.
3680         
3681         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3682         
3683 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3684
3685         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3686         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3687         Flush small error reporting changes.
3688         
3689 2007-11-09  Marek Safar  <marek.safar@gmail.com>
3690
3691         A fix for bug #324996
3692         * expression.cs: Rewrote Is expression implementation to work with
3693         generics, nullable types, anonymous method. A const result expression 
3694         uses existing infrastructure instead of custom not fully-featured one.
3695         
3696 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3697
3698         A fix for bug #340202
3699         * class.cs: Consider generics for volatile field.
3700
3701 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3702
3703         A fix for bug #335594
3704         * expression.cs: Use conversion rules when handling string addition.
3705         
3706 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3707
3708         A fix for bug #336651
3709         * expression.cs: Fixed a crash when probing is on.
3710         
3711 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3712
3713         A fix for bug #324242
3714         * covert.cs: Added a conversion from any nullable-type with an 
3715         underlying enum-type to the type System.Enum.
3716         
3717 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3718
3719         A fix for bug #324222
3720         * class.cs: Report all non-used event fields.
3721         
3722 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3723
3724         A fix for bug #325161
3725         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3726         qualifier for generic types.
3727         
3728 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3729
3730         A fix for bug #322971
3731         * expression.cs, ecore.cs: Added intermediate result value check for
3732         indexers. 
3733         
3734 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3735
3736         A fix for bug #324754
3737         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3738         when it was requested.
3739
3740 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3741
3742         A fix for bug #325101
3743         * expression.cs: Do type not value comparison for `is' expression.
3744
3745 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3746
3747         A fix for bug #320236
3748         * convert.cs: Don't apply user conversion on underlying target type.
3749
3750 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3751
3752         * expression.cs: Don't use unresolved expression for error reporting.
3753  
3754 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3755
3756         A fix for bugs #337712, #324490
3757         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3758         overloading resolution too.
3759         
3760         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3761         the process consistent and more robust.
3762         
3763         * expression.cs, linq.cs, report.cs: Update.
3764
3765 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3766
3767         A fix for bug #332909
3768         * attribute.cs: Resolve attributes in correct context using error
3769         handling procedure.
3770         
3771         * rootcontext.cs: Define Obsolete attribute members as core members.
3772         
3773 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3774
3775         * statement.cs: Removed unused methods.
3776         
3777 2007-10-31  Wade Berrier  <wberrier@novell.com>
3778
3779         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
3780         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3781         during 'make dist')
3782
3783 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3784
3785         A fix for bug #338102
3786         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3787         methods registered as non-generics.
3788         
3789 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3790
3791         A fix for bugs #337712, #324490
3792         * delegate.cs: Delegate covariance and contravariance is not allowed for
3793         value types.
3794         
3795 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3796
3797         A fix for bug #337719 
3798         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3799         `from' keyword.
3800         
3801 2007-10-30  Marek Safar  <marek.safar@gmail.com>
3802  
3803         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3804
3805 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3806  
3807         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3808         query expressions.
3809
3810 2007-10-29  Raja R Harinath  <rharinath@novell.com>
3811
3812         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3813
3814 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3815  
3816         A fix for bug #334652
3817         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3818         extension methods when we have not found the best candidate in normal
3819         container.
3820
3821 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3822
3823         * AssemblyInfo.cs: Keep up-to-date.
3824
3825 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3826
3827         * Makefile: Fixed generics compiler name.
3828         
3829 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3830
3831         * lambda.test: removed, lambda parsing is done differently.
3832         
3833         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3834
3835 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
3836
3837         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3838
3839 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3840
3841         * Makefile, *.sources : All C# compilers are in mcs folder.
3842         
3843         * *.cs: Use existing 2_1 define for smcs.
3844
3845 2007-10-26  Marek Safar  <marek.safar@gmail.com>
3846
3847         A fix for bug #335847
3848         * assign.cs, expression.cs: Couple of changes to avoid creating a
3849         temporary variable for each object initializer assignment statement. It
3850         simplifies struct initialization too, otherwise two temporary variables
3851         would be required.
3852         Implemented optimization of redundant default element initializers.
3853         
3854 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3855
3856         A fix for bug #336766
3857         * expression.cs (Class.CheckBase): Use generic name when method is
3858         generic.
3859         
3860 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3861
3862         A fix for bug #334737
3863         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3864         variable and not variable argument for prepared copies.
3865
3866 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3867
3868         A fix for bug #325110
3869         * class.cs, expression.cs, attribute.cs: Use open generic method when
3870         checking conditional attribute.
3871         
3872 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3873
3874         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
3875         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3876         FeatureIsNotAvailable.
3877
3878 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3879
3880         ** C# 3.0 Partial methods
3881         
3882         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3883         methods support. Because of member cache issue with generics only
3884         non-generics partial methods are fully supported.
3885         
3886 2007-10-23  Marek Safar  <marek.safar@gmail.com>
3887         
3888         * class.cs, decl.cs: Rewrote member overloads check to cope with 
3889         generics and to use member cache for member checking. It also improves
3890         performance and fixes remaining overloads issues.
3891         
3892 2007-10-20  Marek Safar  <marek.safar@gmail.com>
3893         
3894         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3895         roottypes.cs, typemanager.cs:
3896                 
3897         A member cache creation logic changed to add members immediately and
3898         not rely on fallback. The member cache is now only prefered way
3899         how to access and find type declaration members. It saves 5 MB of memory
3900         during MWF compilation and makes code ready for more optimizations and
3901         clean-ups, it's also a pre-requirement for partial methods.
3902         
3903 2007-10-18  Raja R Harinath  <harinath@gmail.com>
3904
3905         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3906         handling for generic parameters.
3907
3908 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3909         
3910         * class.cs (FixedField): Removed redundant volatile check.
3911         
3912 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3913         
3914         * class.cs, decl.cs: Fixed overload members verification to do only one
3915         check per possible collision.
3916         
3917 2007-10-13  Marek Safar  <marek.safar@gmail.com>
3918         
3919         A fix for bug #325478
3920         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3921         and create only one disposable flags container.
3922         
3923 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3924         
3925         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3926         * statement.cs (Fixed): Fixed variables cloning.
3927         
3928 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3929         
3930         A fix for bug #333342
3931         * class.cs (EventField): Don't mark value type event as synchronized. 
3932         
3933 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3934         
3935         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3936         inference to identify best candidate method correctly.
3937         (ProperyExpr): A range variable is read only and cannot be modified.
3938         
3939 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3940         
3941         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3942         logic to identify best candidate method correctly.
3943         
3944 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3945         
3946         * location.cs (Equals, GetHashCode): Removed.
3947         
3948 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3949         
3950         * report.cs: Implemented message recorder. It is used mainly for lambda
3951         expressions to capture otherwise swallowed error messages.
3952         
3953         * anonymous.cs, lambda.cs.cs: Do full parameters check.
3954
3955         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3956         and not at the top.
3957         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3958                 
3959         * expression.cs (MemberAccess): Always report lookup failure.
3960         
3961         * location.cs: Implemented Equals, GetHashCode.
3962         
3963         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3964         
3965 2007-10-10  Jb Evain  <jbevain@novell.com>
3966
3967         * codegen.cs: re-enable assembly version check.
3968
3969 2007-10-09  Marek Safar  <marek.safar@gmail.com>
3970         
3971         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3972         checks.
3973         
3974         * namespace.cs (UsingAlias): Do correct version check.
3975         
3976 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3977         
3978         * expresison.cs, ecore.cs: Issue extension method error message when
3979         appropriate.
3980         
3981         * rootcontext.cs: Added ISO_2 compiler mode option.
3982
3983 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3984         
3985         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3986          message.
3987         
3988 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3989         
3990         * attribute.cs (GetString, GetBoolean): Work with both literal and
3991         constant.
3992         
3993         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3994         Moved method overload specific methods to MethodGroupExpr.
3995         
3996         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3997         it should be less memory consuming.
3998         
3999 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4000
4001         * codegen.cs: remove the assembly version check until the buildbot is
4002         fixed.
4003
4004 2007-10-07  Jb Evain  <jbevain@novell.com>
4005
4006         * attribute.cs (Attribute.GetString): if the value
4007         expression is a StringConstant, return its string value.
4008
4009 2007-10-07  Jb Evain  <jbevain@novell.com>
4010
4011         * typemanager.cs: add `assembly_version_attribute_type`.
4012         * codegen.cs: on attribute emission, check that the
4013         AssemblyVersionAttribute doesn't overflow.
4014
4015 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4016         
4017         A fix for bug #324677
4018         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4019         parent container of a scope container with currently resolved one. 
4020         
4021 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4022         
4023         A fix for bug #325534
4024         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4025         only.
4026         
4027 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4028         
4029         A fix for bug #327504
4030         * class.cs (Operator.Define): Refactored implicit and explicit user
4031         operator conversion rules.
4032         
4033 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4034         
4035         A fix for bug #327520
4036         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4037         
4038 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4039         
4040         A fix for bug #328022
4041         * class.cs (MethodData.Define): Use correct method to check whether
4042         a method implementents an accessor.
4043         
4044 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4045         
4046         A fix for bug #330069
4047         * statement.cs (Fixed.Resolve): Read the first array element only when
4048         an array is instantiated. 
4049         
4050 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4051         
4052         * expression.cs, assign.cs, generics.cs: Print correct operator when
4053         compound assignment is used.
4054         
4055 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4056         
4057         A fix for bug #325841
4058         * expression.cs (ArrayAccess): Use full argument cloning only for
4059         string compound concatenation.
4060         
4061 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4062         
4063         A fix for bug #328774
4064         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4065         assignment.
4066         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4067         assignment.
4068
4069 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4070
4071         Fix #328490
4072         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4073         Event accessibility checks here.  Remove some bogus code that
4074         accidently made GenericMethods work.
4075         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4076
4077 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4078         
4079         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4080         
4081         * statement.cs (Block): Refactored AddVariable to allow error handling
4082         customization.
4083         
4084         * generic.cs: New stub.
4085         
4086 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4087         
4088         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4089         flag.
4090         
4091 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4092
4093         * class.cs: Use partial container to record whether any partial part
4094         contains static field initializer and therefore default contructor has
4095         to be defined.
4096         
4097 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4098
4099         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4100         mono-list when only one of two partial parts has defined accessibility
4101         modifier.
4102         
4103 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4104
4105         A fix for bug #82845
4106         
4107         * class.cs (TypeContainer): Set correct resolve context for all field
4108         initializers.
4109         
4110 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4111
4112         * assign.cs: Fixed a crash when field is resolved twice with an error.
4113         
4114         * codegen.cs: Changed InFieldInitializer to be flag.
4115         
4116         * anonymous.cs, ecore.cs, expression.cs: Update after
4117         IsInFieldInitializer rename.
4118         
4119         * const.cs: Removed unused parameter.
4120         
4121         * class.cs: Changed the way how we resolve and emit field initializers.
4122         The field initilizers have to have access to contructor block to emit
4123         compiler generated code.
4124
4125 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4126
4127         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4128         generics use TypeContainer instead.
4129         
4130 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4131         
4132         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4133
4134         * lambda.cs (ResolveParameters): Use more powerful
4135         InflateGenericArgument.
4136         
4137         * parameters.cs: Better exception message.
4138                 
4139 2007-09-10  Marek Safar  <marek.safar@gmail.com>
4140
4141         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4142         correct expression block type. 
4143         
4144         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4145         
4146         * expression.cs (Invocation): Extracted method group resolve to
4147         DoResolveOverload.
4148         
4149 2007-09-07  Marek Safar  <marek.safar@gmail.com>
4150
4151         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4152         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4153         
4154         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4155         generic extension methods.
4156
4157 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4158
4159         A fix for bug #82676 (Do I get it right now?)
4160         * convert.cs (Binary.ResolveOperator): An interface is converted to the
4161         object before a standard conversion is applied.
4162         
4163 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4164
4165         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4166         #82676.
4167         
4168 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4169
4170         A fix for bug #82676
4171         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4172         non-generic interface types.
4173         
4174 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4175
4176         A fix for bug #82690
4177         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4178         
4179 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4180
4181         A fix for bug #82571
4182         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
4183         modifier for container based methods.
4184         
4185 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4186
4187         A fix for bug #82676
4188         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4189         any interface-type T means to any of interface type T.
4190
4191 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4192
4193         * namespace.cs: We have 2 versions of System.Core assembly.
4194
4195 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4196
4197         A fix for bug #82652
4198         * class.cs (Class.GetClassBases): Compare types and not expressions.
4199
4200 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4201
4202         A fix for bug #82620
4203         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4204         actually never worked before.
4205         (IndexerAccess): Emit prepared arguments before they are modified.
4206         
4207 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4208
4209         A fix for bug #82563
4210         * assign.cs: Revert wrong fix.
4211         
4212         * expression.cs (VariableReference.EmitAssign): Handle ref reference
4213         correctly.
4214         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4215         Instead of ldelema/stdind we have to use temporary variables to handle
4216         cases like String.Concat (params string[]).
4217         
4218 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4219
4220         * class.cs: EmitAttributes to Emit rename.
4221         
4222         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4223         null.
4224         (MemberCore.HasClsCompliantAttribute): Don't depend on 
4225         GetClsCompliantAttributeValue execution.
4226         
4227 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4228
4229         * anonymous.cs: Use shorter type prefix.
4230         
4231         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4232         when exist.
4233         
4234         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4235         variables when probing is on.
4236         
4237         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4238         unresolved variables.
4239         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4240         handle transparent identifiers.
4241         
4242 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4243
4244         * attribute.cs (IsClsCompliant): Add nullable types test.
4245         
4246 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4247
4248         * doc.cs : catch other types of exception than XmlException to
4249           report CS1570. Fixed bug #82565.
4250
4251 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4252
4253         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4254         The number of delegate parameters has to match.
4255         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4256         arrays.
4257
4258 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4259
4260         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4261         to fix problem with private arguments.
4262
4263 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4264
4265         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4266         
4267         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4268         
4269         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4270         empty. Add cloning suport.
4271         
4272         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4273
4274 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4275
4276         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4277         to create EmptyCast. It handles EmptyConstantCast specialization for
4278         constants.
4279         
4280 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4281
4282         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4283         (EmitArrayArgument): One routine for array arguments.
4284         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4285         
4286 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4287
4288         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4289
4290 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4291
4292         * anonymous.cs: MemberLookupFinal update.
4293
4294         * class.cs (ConstructorInitializer): Is expression based.
4295         
4296         * delegate.cs: MethodGroupExpr update.
4297         
4298         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4299         messages.
4300         (Error_MemberLookupFailed): Customizable error override.
4301         (MethodGroupExpr): Keep queried type for later usage.
4302         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4303         resolve.
4304         
4305         * expression.cs: Error_MemberLookupFailed refactoring.
4306         (New.DoResolve): Resolve as much as possible.
4307         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4308         customization for invalid member types.
4309
4310         * statement.cs: MethodGroupExpr update.
4311         
4312 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4313
4314         * modifier.cs (Check): Check all modifiers and not only accessibility
4315         ones.
4316
4317 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4318
4319         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4320         type and not an expression.
4321
4322 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4323
4324         * statement.cs (Catch.Clone): Type and variable can be null.
4325
4326 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4327
4328         A fix for bug #81979
4329         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4330         I am really not sure whether this is the best fix.
4331         
4332         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4333         only once.
4334         
4335 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4336
4337         ** C# 3.0 Object and collection initializers (major re-write)
4338         
4339         * assign.cs (DoResolve): Initializers are not assign related.
4340         
4341         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4342         used during collection or object initialization.
4343         
4344         * expression.cs (Error_InvalidArguments): Add initializers specific
4345         messages. More will come later because it requires some general
4346         refactoring.
4347         (New.DoResolve): Better error handling for unsafe types.
4348         (EmptyExpressionStatement): New class.
4349         (ElementInitializer): An object initializer expression.
4350         (CollectionElementInitializer): A collection initializer expression.
4351         (CollectionOrObjectInitializers): A block of object or collection
4352         initializers.
4353         (NewInitialize): New expression with element/object initializers.
4354         
4355         * statement.cs: Reverted object/collection initializer hacks.
4356         
4357         * typemanager.cs (CSharpName): Filter __arglist type.
4358         
4359 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4360
4361         ** C# 3.0 Anonymous Types (update to the latest standard)
4362         
4363         * expression.cs (Binary.ResolveOperator): Threat all null based types
4364         same.
4365         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4366         (AnonymousTypeParameter): Updated.
4367         
4368         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4369         (AnonymousTypeClass): New anonymous type container.
4370         
4371         * class.cs (AddField): Return operation result.
4372         
4373         * generic.cs: Another empty TypeArguments overload.
4374         
4375         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4376         are stored at top of normal hierarchy.
4377         
4378         * typemanager.cs (CSharpName): Filter anonymous types.
4379         
4380 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4381
4382         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4383         as single Concat call. How could we miss that :-(
4384         
4385 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4386
4387         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4388         
4389 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4390
4391         * expression.cs: Fix the previous commit, the creation of the
4392         arguments array list needs also to be conditional on the arguments
4393         not being null.
4394
4395         * class.cs: Add a little bit of help to help narrow down problems.
4396
4397         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4398         not try to copy in that case. 
4399
4400         * driver.cs: When building SMCS, include a new different set of
4401         default assemblies here.   Do this here so we can control whether
4402         to include the default assemblies with /noconfig.
4403
4404 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4405
4406         A fix for bug #81979
4407         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4408         only.
4409
4410 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4411
4412         A fix for bug #82300
4413
4414         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4415         we are in probing scope.
4416
4417 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4418
4419         A fix for bug #82301
4420
4421         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4422         (Statement.CloneTo): Clone and not map children blocks.
4423
4424 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4425
4426         A fix for bug #82299
4427
4428         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4429         variable too.
4430         
4431         * statement.cs (Statement.CloneTo): Clone variables before statements
4432         to allow remaping of local variables.
4433
4434 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4435
4436         A fix for bug #82296
4437
4438         * anonymous.cs,
4439         * report.cs: Log crash details for future clone problems.
4440         
4441         * statement.cs (Return.Clone): Don't clone non-existent expression.
4442
4443 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4444
4445         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4446         (Class.AddBasesForPart): Move CS0537 check here from ...
4447         * cs-parser.jay (class_declaration): ... here.  Move calling of
4448         'AddBasesForPart' to ...
4449         (class_bases): ... here.
4450         (struct_declaration, interface_declaration): Update to changes.
4451
4452 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4453
4454         A fix for bug #81923
4455
4456         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4457         conversion is allowed.
4458
4459 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4460
4461         A fix for bug #81564
4462
4463         * ecore.cs (EventExpr): Add IsBase handling.
4464
4465         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4466         too.    
4467         
4468 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4469
4470         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4471         * cs-parser.jay: Some whitespace cleanups.
4472         (current_delegate): New.
4473         (type_name): New.
4474         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4475         a dummy code block, and use 'type_name' instead of 'member_name'.
4476         (interface_declaration, class_declaration): Likewise.
4477         (delegate_declaration): Likewise.  Rearrange slightly and use
4478         'current_delegate'.
4479         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4480         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4481
4482 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4483
4484         A fix for bug #82039
4485
4486         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4487         available.
4488
4489         * typemanager.cs (CSharpName): Split to string overload.
4490
4491 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4492
4493         * expression.cs,
4494         * report.cs: Updated warning CS0472.
4495
4496 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4497
4498         A fix for bug #82181
4499         * cs-parser.jay,
4500         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4501
4502 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4503
4504         A fix for bug #82277
4505         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4506
4507 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4508
4509         ** C# 3.0 Type Inference (major bits are working)
4510         
4511         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4512         (.ImplicitStandardConversionExists): Uses compatible.
4513         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4514         (.InferReturnType): New method.
4515         (.Compatible): Refactored.
4516         (.ResolveParameters): Uses factory to create resolved parameters.
4517         (.CompatibleMethod): Add probing mode support.
4518         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4519         clearly distinguish between 2 different operations.
4520         (LambdaMethod): Moved to lambda.cs.
4521         (AnonymousMethod): Removed unused fields and methods.
4522         (AnonymousDelegate): Simplified.
4523         
4524         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4525         
4526         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4527         
4528         * delegate.cs (Delegate): New mehods to reduce code duplication.
4529         (.GetConstructor): New method.
4530         (.GetInvokeMethod): New method.
4531         (DelegateCreation): Updated.
4532         
4533         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4534         does not exist.
4535         (OverloadResolve): Made probing little bit faster.
4536         
4537         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4538         when probing is on.
4539         
4540         * generic.cs (TypeInferenceContext): Dummy implementation.
4541         
4542         * iterators.cs: Updated after Resolve/Define rename.
4543         
4544         * lambda.cs (LambdaExpression)
4545         (.ResolveParameters): Handles both type of arguments and type inference too.
4546         
4547         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4548         (InflateTypes): Updated.
4549         
4550         * support.cs (InflateTypes): Changed signature and updated.
4551         
4552         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4553         (MemberLookup_FindMembers): More MS tricks.
4554         (GetParameterData): Ditto.
4555         (GetDelegateParameters): Uses quick path for dynamic types.
4556         
4557 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4558
4559         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4560         only.
4561
4562 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4563
4564         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4565         syntax.
4566         
4567 2007-07-26  Jb Evain  <jbevain@novell.com>
4568
4569         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4570         which takes a boolean 'report_errors', similar to the GetMethod.
4571         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4572         in .net 2.1, do not report errors here.
4573
4574         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4575         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4576         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4577         in .net 2.1.
4578
4579         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4580         of the type InternalsVisibleToAttribute before the first call
4581         to CoreLookupType which is allowed to fail (third boolean parameter
4582         to true). Because, during the resolution for a type that is not
4583         immediately found, we try to check if the type is not defined in
4584         a friend assembly, and to do so, we need the
4585         InternalVisibleToAttribute.
4586
4587 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4588
4589         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4590         feature that allows structs to be compared against null and inline
4591         the result as true or false.
4592
4593         Notice that the same code is not permitted inside a generic block
4594         of code that would do:
4595
4596         class Foo<T> where T : struct {
4597             bool Eval (T x)
4598             {
4599                  return x == null;
4600             }
4601         }
4602
4603         It is only allowed if the type of T is not bound (no where
4604         clause).   In my opinion, this CSC 2 behavior is broken but people
4605         seem to be using it (IronRuby does, a few bug reports on bugzilla
4606         have it and some people have complained about it).
4607
4608         All of the users that depend on this behavior have code that is
4609         very likely broken. 
4610         
4611         * report.cs (Warning, Error): make these take object arguments,
4612         not strings, as that allows us to take advantage of Format.
4613
4614 2007-07-20  William Holmes  <billholmes54@gmail.com>
4615
4616         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4617           Left member variable for the Count.
4618         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4619           MemberName.CountTypeArguments to avoid a NRE. 
4620
4621         This code is contributed under the MIT X11 license
4622
4623 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4624
4625         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4626
4627 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4628
4629         * doc.cs : generic method arguments are written as ``x while generic
4630           type arguments are `x. Combined with the previous change, fixed bug
4631           #79706.
4632
4633 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4634
4635         Fix #82120
4636         * expression.cs (Binary.ResolveOperator): When converting
4637         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4638
4639 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4640
4641         * doc.cs : when T: or whatever x: is specified, it does not really
4642           check the doc comment's syntax correctness. Fixed bug #82006.
4643
4644 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4645
4646         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4647         LambdaExpression better.
4648         
4649         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4650         
4651         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4652         
4653         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4654         as it can be generated.
4655         
4656         * expression.cs (Invocation.Error_InvalidArguments): Show correct
4657         modifiers.
4658         
4659         * lambda.cs (LambdaExpression): Refactored to share same code with
4660         AnonymousMethodExpression.
4661         
4662 2007-07-17  Marek Safar  <marek.safar@gmail.com>
4663
4664         * anonymous.cs (MakeName): Include host name for easier debugging.
4665         (LambdaMethod): New class for lambda spcecific stuff.
4666         
4667         * attribute.cs: Set EmitContext return type.
4668
4669         * class.cs: Set EmitContext return type.
4670         
4671         * codegen.cs (EmitContext): Return type cannot be null to stop messing
4672         with null/void meaning.
4673         
4674         * iterators.cs (ContainerType): Implemented.
4675         
4676         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4677         
4678         * statement.cs (Return): Updated to lambda expressions.
4679         (Block.CloneTo): Parent can be null.
4680                 
4681 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4682
4683         A fix for bug #81917
4684         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4685         
4686         * class.cs (FixedField): Check whether field is in unsafe scope.
4687
4688         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4689         (FieldExpr.Emit): Fixed buffers cannot be volatile.
4690
4691         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4692         FieldExpr.
4693         
4694         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4695                 
4696 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4697
4698         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4699         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4700         from Report class.
4701
4702 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4703
4704         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4705         
4706 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4707
4708         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4709         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4710         
4711         * codegen.cs(EmitContext): Add ProbingMode flag.
4712         
4713         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4714         
4715         * driver.cs: For now set both warning values.
4716         
4717         * ecore.cs (SimpleName): Name is readonly.
4718         (MethodGroup.OverloadResolve): One quick path for probing.
4719         
4720         * expression.cs (Unary): Set Oper r/o.
4721         (Binary): Set Oper r/o.
4722         (ParameterReference): Set few instance variables as r/o.
4723         (ParameterReference.DoResolveBase): Don't capture aruments when 
4724         the probing is on.
4725         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4726         (Arglist): arguments are private.
4727         (SizeOf): type is private and r/o.
4728         (MemberAccess): arguments are private.
4729
4730         * report.cs: Enhanced reporting on/off capabilities.
4731         
4732         * lambda.cs: Uses ec.IsInProbingMode.
4733         (ContextualReturn): Derives from return.
4734         
4735         * rootcontext.cs: For now set both warning values.
4736         
4737         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4738         copy if one exists.
4739         (Return.Resolve): Don't die immediately.
4740         (Block.Resolve): Speed-up probing.
4741         (Block.CloneTo): Clone only child blocks.
4742
4743 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4744
4745         * iterators.cs: reverted Miguel's latest change (r81925) as it
4746         breaks the build in System.
4747
4748 2007-07-13  Miguel de Icaza  <miguel@novell.com>
4749
4750         * iterators.cs (Yield.CheckContext): Check for the iterator type
4751         also here as we can call into Yield even in codepaths that are not
4752         directly checked by
4753         (MethodOrOperator is the only path that was checked).
4754
4755         In addition to the standard check, use a more specific check for
4756         constructors to report a more verbose error. 
4757
4758 2007-07-12  Miguel de Icaza  <miguel@novell.com>
4759
4760         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4761         report the warning and continue 
4762
4763         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4764         values on the stack on the call to Emit.   Use EmitStatement if
4765         possible, or using Emit + Pop if not possible.   Fixes #82064
4766
4767 2007-07-12  Raja R Harinath  <rharinath@novell.com>
4768
4769         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4770         avoid try...finally in some cases.
4771
4772 2007-07-10  Marek Safar  <marek.safar@gmail.com>
4773
4774         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4775         
4776         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4777         instead of method. Re-use standard error handling.
4778         (ConstructorInitializer.Emit): Simplified.
4779         
4780         * delegate.cs: Updated after Invocation.EmitCall change.
4781         
4782         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4783         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4784         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4785         method and don't permanently changing input arguments.
4786         (MethodGroupExpr): Introduced resolved best_candidate, when method group
4787         is resolved it has one of the candidates is the best one which is later
4788         used to emit. Removed a few unused method.
4789         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4790
4791         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4792         (Binary.ResolveOperator): Ditto.
4793         (ConditionalLogicalOperator.DoResolve): Ditto.
4794         (Invocation): Uses method group.
4795         (Invocation.DoResolve): Simplified.
4796         (Invocation.EmitCall): Removed useless is_static.
4797         (Invocation.Emit): Delegate to method group.
4798         (Invocation.EmitStatement): Simplified.
4799         (New): Uses method group.
4800         (MemberAccess.DoResolve): Don't destroy original expression.
4801         
4802         * statement.cs (ForEach.Resolve): Use null for no method arguments.
4803         
4804 2007-07-04  Marek Safar  <marek.safar@gmail.com>
4805
4806         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4807         
4808         * anonymous.cs,
4809         * lambda.cs: Add custom error message type.
4810
4811 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4812
4813         * lambda.cs: Simplified little bit.
4814         
4815         * parameter.cs: Introduced ImplicitLambdaParameter.
4816         (Parameters.CreateFullyResolved): New factory instead of ctor.
4817         
4818         * anonymous.cs,
4819         * class.cs,
4820         * delegate.cs: Updated parameter creation.
4821         
4822 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4823
4824         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4825         arguments.
4826         
4827         * generic.cs: Synchronized with gmcs.
4828         
4829 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4830
4831         * class.cs (Indexer): Check return type as soon as possible.
4832         
4833         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4834         members too.
4835         
4836         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4837         
4838         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4839         
4840         * parameter.cs (Parameter): Use expression type when it is available.
4841         
4842         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4843         method modifier for the first parameter only.
4844
4845 2007-06-24  Marek Safar  <marek.safar@gmail.com>
4846
4847         A fix for bug #81938
4848         * typemanager.cs (ChangeType): Fixed couple of char conversions.
4849         
4850         * constant.cs: Tide up an exception message.
4851
4852 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4853
4854         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4855         an uninitialized variable is used.
4856         
4857         * expression.cs (LocalVariableReference.DoResolve): Ditto.
4858
4859 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4860
4861         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4862         not found error handling.
4863
4864         * expression.cs (ArrayCreation): Removed redundant fields and little bit
4865         simplified.
4866         (ArrayCreation.ResolveArrayElement): To be ready to customization.
4867         (ArrayCreation.DoResolve): Simplified.
4868         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4869         its own resolve process.
4870         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4871
4872 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4873
4874         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4875         more error details.
4876         
4877 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4878
4879         * cs-tokenizer.cs: Removed var related stuff.
4880         
4881         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4882         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4883         a type and a keyword at same time.
4884         
4885         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4886         matches to "var".
4887         
4888         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4889         implicitly typed arrays, more changes will follow.
4890         
4891         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4892         
4893 2007-06-19  Marek Safar  <marek.safar@gmail.com>
4894
4895         * ecore.cs (VarExpr): Removed Handled field.
4896         
4897         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4898         build-in assign functionality.
4899         (ForEach.Resolve): Removed all implicitly typed local variable code and
4900         simplified.
4901         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4902         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4903
4904 2007-06-18  Marek Safar  <marek.safar@gmail.com>
4905
4906         * assign.cs: Removed implicitly typed local variable check.
4907         
4908         * expression.cs (LocalVariableReference.DoResolve): Add check for self
4909         referencing implicitly typed local variable.
4910         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4911         variable here.
4912         
4913         * statement.cs (Fixed): Removed unsupported implicitly typed local
4914         variable code.
4915
4916 2007-06-15  Marek Safar  <marek.safar@gmail.com>
4917
4918         * decl.cs (MemberName): Moved all Unbound stuff to parser.
4919
4920 2007-06-14  Marek Safar  <marek.safar@gmail.com>
4921
4922         A fix for bugs #81855 and #76274
4923         * attribute.cs (AttachTo): Always set owner for global attributes to
4924         prefined owner.
4925         
4926         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4927         usefull too.
4928         
4929         * cs-parser.jay: Assembly and module attributes must precede all other
4930         elements except using clauses and extern alias declarations.
4931
4932 2007-06-13  Marek Safar  <marek.safar@gmail.com>
4933
4934         A fix for bug #81748
4935         * cs-tokenizer.cs,
4936         * expression.cs: More checks for non ISO-1 features.
4937
4938 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4939
4940         A fix for bug #81807
4941         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4942         present inside switch statement and it is required by nullable check.
4943
4944 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4945
4946         A fix for bug #81840
4947         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4948         when type matching fails.
4949         
4950         * namespace.cs: Tiny error message change.
4951
4952 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4953
4954         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4955         reporting. Added automatic property check.
4956         
4957         * class.cs: Updated after CheckAbstractAndExtern relocation.
4958         (AEventPropertyAccessor.GetSignatureForError): Customized.
4959         
4960 2007-06-11  Marek Safar  <marek.safar@gmail.com>
4961
4962         * class.cs (DefineBaseTypes): Base type can be undefined.
4963         
4964         * ecore.cs (TypeLookup): Minor refactoring.
4965         (DoResolveAsTypeStep): Removed redundant check.
4966
4967         * namespace.cs (Lookup): Removed redundant check.
4968                 
4969         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
4970         ResolveAsTypeTerminal step.
4971         (BootstrapCorlib_*): Simplified.
4972         (PopulateCoreType): Core types can be now external.
4973
4974 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4975
4976         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4977          verification only.
4978          (InferTypeArguments): Infers anonymous expression type arguments.
4979          (Compatible): Split to Compatible and InferTypeArguments. 
4980         
4981         * lambda.cs: Updated.
4982
4983 2007-06-08  Marek Safar  <marek.safar@gmail.com>
4984
4985         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4986
4987 2007-06-07  Raja R Harinath  <harinath@gmail.com>
4988
4989         Fix #80477, cs0135-2.cs, cs0135-3.cs
4990         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4991         names to the "known" variables list.
4992         (Block.CheckInvariantMeaningInBlock): Handle the fact the
4993         parameter names are also "known".
4994         (Block.CheckError136): Remove.
4995         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
4996         null.
4997
4998 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4999
5000         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5001
5002 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5003
5004         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5005         internal error not an user error.
5006          
5007         * expression.cs (IsApplicable): Refactored to make debugging easier.
5008
5009         * support.cs: More tricks for non-mono runtimes.
5010         
5011         * typemanager.cs (CoreLookupType): Made public.
5012         (InitSystemCore): All linq specific stuff moved to linq.cs
5013
5014 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5015
5016         * typemanager.cs (CSharpSignature): One more missing build-in types
5017         replacement.
5018         More tricks for non-mono runtime.
5019
5020 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5021
5022         * statement.cs (Block.CheckError136_InParents): Remove.
5023         (Block.AddVariable): Use GetParameterInfo instead.
5024         (ToplevelBlock.ProcessArguments): Likewise.
5025
5026 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5027
5028         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5029         information too.
5030         (ToplevelBlock.GetParameterInfo): Split out of ...
5031         (ToplevelBlock.GetParameterRefernce): ... this.
5032         (ToplevelBlock.ParameterMap): Remove.
5033         * expression.cs (ParameterReference): Update to use
5034         ToplevelParameterInfo.
5035
5036         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5037         regression.
5038
5039         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5040         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5041
5042         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5043         (ToplevelBlock.ProcessParameters) ... here.
5044         (ToplevelBlock..ctor): Invoke it.
5045
5046         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5047         new parameters.
5048
5049         * statement.cs (IKnownVariable): New interface.
5050         (LocalInfo): Implement it.
5051         (ToplevelParameterInfo): New class.
5052         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5053         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5054         GetKnownVariableInfo.
5055
5056 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5057
5058         Partly speed up CS0136 error checks.
5059         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5060         'recurse' parameter.
5061         (Block.DoCheckError136): Only check errors in parameters.  Move
5062         local variable checks ...
5063         (Block.AddVariable): ... here, and ...
5064         (ToplevelBlock.ResolveMeta): ... here.
5065
5066 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5067
5068         * statement.cs (Block.IsChildOf): Remove.
5069
5070         * statement.cs (Statement.Clone): Move special case code ...
5071         (Block.CloneTo): ... here.
5072
5073 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5074
5075         * statement.cs (ToplevelBlock.container): Remove field.  It's
5076         redundant with 'Parent'.
5077         (ToplevelBlock.ContainerBlock): Remove accessor.
5078         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5079         child with parent here, ...
5080         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5081         current_block.
5082         (start_anonymous): Don't save current_block.
5083         (top_current_block): Remove.
5084
5085         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5086         (Block.Resolve): Update to changes.
5087         (Block..ctor): Move setting of "correct" 'Toplevel'
5088         and 'Explicit' fields to ...
5089         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5090
5091 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5092
5093         Kill Block.Implicit
5094         * statement.cs (Block.Implicit): Remove.
5095         (Block): Update to changes.
5096         * flowanalysis.cs: Likewise.
5097
5098         Mildly speed up CheckInvariantMeaningInBlock
5099         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5100         Recursively call AddKnownVariable to all enclosing blocks.
5101         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5102         Remove recursive calls.
5103         (Block): Update to changes.
5104
5105         New ExplicitBlock invariants
5106         * statement.cs (Block.Explicit): New field.  It points to the
5107         immediately enclosing non-implicit block.
5108         (Block..ctor): Maintain the invariant.
5109         * cs-parser.jay: Take advantage of invariant.
5110
5111         Introduce ExplicitBlock
5112         * statement.cs (ExplicitBlock): New.
5113         (ToplevelBlock): Derive from it.
5114         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5115         sense of flag.
5116         (Block.Implicit): Update to changes.
5117         * cs-parser.jay: Update to changes.
5118
5119         Remove unused field
5120         * codegen.cs (EmitContext.IsLastStatement): Remove.
5121         * statement.cs (Block.DoEmit): Update to changes.
5122
5123 2007-05-25  Raja R Harinath  <rharinath@novell.com>
5124
5125         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5126         modifying current_block directly.
5127
5128 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
5129         
5130         * class.cs: Implemented automatic properties (C# 3.0)
5131           Thanks to Marek for the help.
5132
5133 2007-05-23  Raja R Harinath  <rharinath@novell.com>
5134
5135         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5136         variable as assigned, note also that all its components are
5137         assigned too.
5138         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
5139
5140 2007-05-19  Marek Safar  <marek.safar@gmail.com>
5141
5142         * anonymous.cs, class.cs: Emit Compiler generated attribute when
5143         member is marked as compiler generated.
5144         
5145         * decl.cs (MemberCore): Refactored ModFlags into property.
5146
5147         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5148         (Check): Check only accessibility modifiers.
5149
5150 2007-05-18  Raja R Harinath  <rharinath@novell.com>
5151
5152         Track all assignable slots in one bit array
5153         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5154         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
5155         logic from VariableMap constructor here.  Use the same 'offset'
5156         variable that's later used for computing offsets of local
5157         variables.
5158         * flowanalysis.cs (UsageVector.parameters): Remove.
5159         (UsageVector): Update to changes.
5160         (VariableMap): Remove.
5161
5162         Avoid creating ParameterMap in every block
5163         * statement.cs (Block.ParameterMap): Move ...
5164         (ToplevelBlock.ParameterMap): ... here.
5165         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5166         only once.
5167         * flowanalysis.cs (FlowBranching.param_map): Remove.
5168         (FlowBranching.UsageVector): Update to changes.
5169         (FlowBranchingToplevel.CheckOutParameters): Likewise.
5170
5171         * statement.cs (Block.CloneTo): Clone Toplevel field too.
5172
5173         * expression.cs (ParameterReference): Distinguish between block
5174         where parameter was referenced and declared.
5175
5176 2007-05-18  Marek Safar  <marek.safar@gmail.com>
5177
5178         * flowanalysis.cs, statement.cs: Put back improved error handling.
5179
5180 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
5181         
5182         * assign.cs:
5183         * expression.cs:
5184           Imporved object and collection initialization (C# 3.0).
5185
5186 2007-05-15  Marek Safar  <marek.safar@gmail.com>
5187
5188         A fix for bug #81380
5189         * expression.cs (Is.DoResolve): Only value types have constant `is'
5190         behaviour.
5191
5192 2007-05-15  Raja R Harinath  <rharinath@novell.com>
5193
5194         * statement.cs (ToplevelBlock.child): Remove.
5195
5196 2007-05-15  Raja R Harinath  <harinath@gmail.com>
5197
5198         Rationalize ResolveMeta: refactoring
5199         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
5200         out constant handling code into ...
5201         (Block.DoResolveConstants): ... this.
5202
5203         Rationalize ResolveMeta: kill local_map
5204         * statement.cs (Block.local_map, Block.LocalMap): Remove.
5205         (Block.AssignableSlots): New.
5206         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
5207         for locals -- move code from VariableMap here.  Avoid unnecessary
5208         allocations.
5209         * flowanalysis.cs (FlowBranching.local_map): Remove.
5210         (FlowBranching..ctor): Use Block.AssignableSlots.
5211         (VariableMap): Remove unused constructors.
5212
5213 2007-05-11  Raja R Harinath  <rharinath@novell.com>
5214
5215         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5216
5217 2007-05-11  Marek Safar  <marek.safar@gmail.com>
5218
5219         * typemanager.cs (IsFriendAssembly): Should not be called for building
5220         assembly.
5221
5222 2007-05-09  Marek Safar  <marek.safar@gmail.com>
5223
5224         * literal.cs (NullConstant): Print null in all cases.
5225         
5226         * expression.cs (Binary.ResolveOperator): Implemented delegate
5227          comparison based on C# 2.0 changes.
5228
5229 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
5230
5231         This code is contributed under the MIT X11 license
5232         
5233         The following enables support for several C# 3.0 language features:
5234         
5235         * cs-tokenizer.cs: Added support for the "var" keyword.
5236         
5237         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5238           Added VarExpr class to facilitate type inferencing.
5239         
5240         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5241           to support anonymous types.
5242         
5243         * assign.cs: Added support for type inferencing and initialization.
5244         
5245         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5246         
5247         * expression.cs: Added implicit array support to ArrayCreation.
5248           Added 5 types and 1 interface:
5249           
5250           IInitializable                Implementing classes can inject initializing
5251                                         statements after object instantiation.
5252           
5253           Initializer                   Stores data for object initialization.
5254           
5255           AnonymousType                 An expression for anonymous types.
5256           
5257           AnonymousTypeParameter        Stores data about an anonymous type's field.
5258           
5259           NewInitialize                 An expression for object initialization.
5260           
5261           CollectionInitialize          An expression for collection initialization.
5262         
5263         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5264           statements.
5265
5266 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5267
5268         A fix for bug #81500
5269         * cs-tokenizer.cs: Add special handling for coalescing operator.
5270
5271 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5272
5273         A fix for bug #81529
5274         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5275         its value from base class until it is redefined.
5276
5277 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5278
5279         Fix regression in cs0631-3.cs
5280         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5281         fallback.  Make error fallback catch more cases.
5282
5283 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5284
5285         * cs-parser.jay: Allow parameters in operator declarations to have
5286         attributes. 
5287
5288 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5289
5290         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5291         exists. 
5292
5293         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5294         inside the ContextualReturn, it does not have to be an
5295         ExpressionStatement. 
5296
5297 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5298
5299         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5300         set, set it.
5301
5302 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5303
5304         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5305         method in two methods: ResolveNoDefine and Resolve.
5306
5307         ResolveNoDefine will stop just after ResolveTopBlock has been
5308         called.   
5309
5310         Resolve will then continue by creating a method and issuing the
5311         call to method.Define ().
5312
5313         (AnonymousMethod): Split and implement the new Resolve and
5314         ResolveNoDefine as well.
5315
5316         * lambda.cs (LambdaExpression): Split the anonymous method
5317         resolution code into a separate routine (CoreCompatibilityTest)
5318         from DoCompatibleTest.
5319
5320         (LambdaExpression.TryBuild): New method, this method tries to
5321         build the LambdaExpression with the given set of types to be used
5322         as the types for the various parameters of the lambda expression. 
5323
5324         If the compilation succeed with the given types, the infered type
5325         of the Anonymous method is returned, otherwise null is returned.
5326
5327 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5328
5329         A fix for bug #81414
5330         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5331
5332 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5333
5334         * cs-tokenizer.cs: Change various identifiers here from the
5335         camelCasing to the recommended Linux-like style for instance
5336         variables from the Coding Guidelines. 
5337
5338 2007-04-19  Martin Baulig  <martin@ximian.com>
5339
5340         * convert.cs
5341         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5342         System.Enum to System.ValueType.
5343
5344 2007-04-13  Martin Baulig  <martin@ximian.com>
5345
5346         Rewrote implicit reference conversions.  We need to distinguish
5347         between implicit reference conversions (13.1.4) and implicit
5348         boxing conversions (13.1.5).
5349
5350         According to the spec, there's an an implicit conversion
5351         "From a one-dimensional array-type S[] to IList<T> and base
5352         interfaces of this interface, provided there is an implicit
5353         reference conversion from S to T."  Note that this does not
5354         include boxing conversions.
5355
5356         * convert.cs
5357         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5358         (Convert.ImplicitReferenceConversion): Split into
5359         ImplicitReferenceConversionCore() and
5360         ImplicitBoxingConversionExist().
5361         (Convert.ImplicitReferenceConversionExists): Use the new
5362         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5363
5364 2007-04-12  Martin Baulig  <martin@ximian.com>
5365
5366         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5367         `TypeManager.null_type' checks up to the top of the method.
5368
5369 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5370
5371         A fix for bug #81350
5372         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5373         extension methods.
5374
5375 2007-04-11  Martin Baulig  <martin@ximian.com>
5376
5377         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5378         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5379         to make this work for generic classes; fixes #79561.
5380
5381 2007-04-11  Martin Baulig  <martin@ximian.com>
5382
5383         * expression.cs (As): Add support for nullable types; fixes #79371.
5384
5385 2007-04-11  Martin Baulig  <martin@ximian.com>
5386
5387         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5388         `type.FullName' is null; fixes #80243.
5389
5390 2007-04-11  Martin Baulig  <martin@ximian.com>
5391
5392         * expression.cs (Invocation.IsApplicable): Don't modify the method
5393         if type inference succeeded, but the method was not applicable.
5394         Fixes #81250.
5395
5396 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5397
5398         A fix for bug #81324
5399         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5400         internal and external namespaces containers.
5401
5402 2007-04-10  Martin Baulig  <martin@ximian.com>
5403
5404         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5405         TypeManager.DropGenericMethodArguments() so we also call
5406         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5407
5408 2007-04-10  Martin Baulig  <martin@ximian.com>
5409
5410         * iterators.cs (Iterator.CreateIterator): Don't crash if
5411         `method.ReturnType' is null.  This happens if something went wrong
5412         while resolving that typ (we already reported an error in this case).
5413
5414 2007-04-10  Martin Baulig  <martin@ximian.com>
5415
5416         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5417         generic interfaces; report the CS0144 directly.
5418
5419 2007-04-10  Martin Baulig  <martin@ximian.com>
5420
5421         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5422         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5423
5424 2007-04-10  Martin Baulig  <martin@ximian.com>
5425
5426         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5427
5428 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5429
5430         A better fix
5431         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5432         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5433
5434         Fix #81338
5435         * statement.cs (For.Resolve): If resolution fails, use
5436         KillFlowBranching.
5437
5438 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5439
5440         * anonymous.cs (MakeName): Make faster and zero-based.
5441         (VerifyExplicitParameterCompatibility): Back to mode where generic
5442         parameter is ignored.
5443         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5444
5445         * class.cs (EmitType): Method can emit another new method.
5446
5447         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5448
5449         * driver.cs: Updated.
5450
5451         * lambda.cs: Reuse predefined empty parameters.
5452
5453         * parameter.cs: Updated
5454
5455         * support.cs: Implemented InflateTypes.
5456
5457         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5458         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5459
5460 2007-04-03  Martin Baulig  <martin@ximian.com>
5461
5462         Fix #80632.
5463
5464         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5465         version of TypeManager.IsOverride() which also works with generic
5466         types.  
5467
5468 2007-04-03  Martin Baulig  <martin@ximian.com>
5469
5470         Fix #81044.
5471
5472         * convert.cs
5473         (Convert.ExplicitReferenceConversion): We need to cast when
5474         converting from IList<T> to S[].
5475
5476 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5477
5478         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5479         at this level.
5480         
5481         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5482
5483 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5484
5485         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5486         argument and return type inferring.
5487
5488         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5489         (ReturnType): Turned to property.
5490
5491         * statement.cs (Return): Implemented return type inferring.
5492
5493         * support.cs (ReflectionParameters): Use local types if possible.
5494
5495 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5496
5497         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5498         (FlowBranching.UsageVector): Update to changes.
5499
5500         Prepare to kill 'Reachability'
5501         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5502         argument of constructor.
5503
5504 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5505
5506         Prepare to kill 'Reachability'
5507         * flowanalysis.cs (UsageVector.is_unreachable): New.
5508         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5509         'reachability', and verify they're consistent.
5510
5511         Fix #81121
5512         * expression.cs (New.EmitStatement): Handle type parameters here too.
5513
5514 2007-03-29  Martin Baulig  <martin@ximian.com>
5515
5516         Fix #79148.
5517
5518         * anonymous.cs
5519         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5520         CompilerGeneratedClass.
5521         (ScopeInfo.EmitScopeInstance): Make this protected.
5522         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5523         `ec.CurrentAnonymousMethod.Scope == Scope'.
5524
5525         * statement.cs (Block.ScopeInfo): Make this a property.
5526
5527 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5528
5529         Prepare to kill 'Reachability'
5530         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5531         (FlowBranching.UsageVector.Reachability): Remove property.
5532         (FlowBranching.UsageVector.IsUnreachable): New property.
5533         (FlowBranching.UsageVector.ResetBarrier): New.
5534         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5535         * codegen.cs, statement.cs: Update to changes.
5536
5537 2007-03-27  Martin Baulig  <martin@ximian.com>
5538
5539         Fix #81209.
5540
5541         * decl.cs
5542         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5543         generic types.
5544
5545 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5546
5547         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5548         instead of TriState.  Remove all mention of TriState.
5549
5550         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5551         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5552         and maintain invariants.
5553
5554 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5555
5556         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5557
5558 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5559
5560         * expression.cs: Stop using obsolete 2.0 opcodes.
5561
5562 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5563
5564         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5565         one of the latests Martin's fixes.
5566
5567 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5568
5569         * expression.cs: On BigEndian systems, swap the bytes, temporary
5570         solution until we get a new bitconverter class.
5571
5572 2007-03-23  Martin Baulig  <martin@ximian.com>
5573
5574         Fix #81158.
5575
5576         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5577         "Method" and "Method`1".  Normally, a cache lookup is done on the
5578         "Method" form (ie. without the generic arity), but this one makes
5579         lookups on the full form work as well.
5580
5581 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5582
5583         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5584         unused properties.
5585
5586 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5587         * class.cs: 
5588         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5589         ordered_member_list, to TypeBuilder to store members to be defined
5590         in the order they were parsed in.
5591         - ordered_explicit_member_list contains all properties indexers
5592           and methods that are defined as explicit implementation of an
5593           interface or base class.
5594         - ordered_member_list contains all properties indexers and methods
5595           that are not defined as explicit implementation of an interface
5596           or base class.
5597
5598         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5599         functionality in these removed classes has been replaced with 
5600         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5601         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5602
5603         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5604         to CheckForDuplications inside GetMethod and SetMethod Define Method
5605         to handle method property and indexer name conflicts.
5606
5607         Fixes #79434
5608
5609         All code is contributed under the MIT/X11 license.
5610
5611 2007-03-20  Martin Baulig  <martin@ximian.com>
5612
5613         * class.cs (TypeContainer.Interfaces): Removed; they're now
5614         included in `TypeContainer.Types'.
5615
5616 2007-03-20  Martin Baulig  <martin@ximian.com>
5617
5618         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5619
5620         * class.cs (TypeContainer.CreateType): New public method.  This is
5621         now called before DefineType() to create the TypeBuilders.
5622         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5623         has already been created by CreateType().
5624         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5625         don't resolve our base classes here; this has been moved into
5626         DefineBaseTypes().  We're now called from CreateType().
5627         (TypeContainer.DefineBaseTypes): New private method; resolve our
5628         base classes here.  We're now called from DefineType().
5629
5630         * rootcontext.cs
5631         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5632         our types first to create all the TypeBuilders.  After that, call
5633         TypeContainer.DefineType() on all the types which'll resolve their
5634         base classes and setup the resolve order.
5635
5636 2007-03-20  Martin Baulig  <martin@ximian.com>
5637
5638         * class.cs (TypeContainer.Enums): Removed; they're now included in
5639         `TypeContainer.Types'.  
5640
5641 2007-03-20  Martin Baulig  <martin@ximian.com>
5642
5643         * class.cs
5644         (TypeContainer.DefineType): Don't call ResolveMembers() here.
5645         (TypeContainer.DoResolveMembers): Call DefineType() on our
5646         `compiler_generated' classes; moved here from DefineNestedTypes().
5647
5648         * rootcontext.cs
5649         (RootContext.ResolveTree): Call ResolveMembers() on all
5650         TypeContainer's in the `type_container_resolve_order'.
5651
5652 2007-03-19  Marek Safar  <marek.safar@gmail.com>
5653
5654         * class.cs: Use corlib to handle InternalMethodImplAttribute.
5655
5656 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5657
5658         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5659         implementation flags.
5660
5661 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5662
5663         * class.cs: More optimizations for type parameters.
5664
5665 2007-03-15  Marek Safar  <marek.safar@gmail.com>
5666
5667         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5668
5669         * ecore.cs, parameter.cs: More common code for both corlibs.
5670
5671         * typemanager.cs (IsGenericMethod): Simplified.
5672
5673 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5674
5675         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5676         'returns'.
5677         * statement.cs, iterators.cs, lambda.cs: Update to changes.
5678
5679         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5680         unconditionally.  Simplify explanation.
5681         (Try.Resolve, Using.Resolve): Likewise.
5682
5683 2007-03-15  Martin Baulig  <martin@ximian.com>
5684
5685         Fix #80731.
5686
5687         * decl.cs (DeclSpace): If we're a partial class, use our
5688         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5689
5690 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5691
5692         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5693         'throws'.
5694         (FlowBranching.UsageVector): Update to changes.
5695         (FlowBranching.MergeSiblings): Likewise.
5696         * statement.cs: Likewise.
5697
5698 2007-03-15  Martin Baulig  <martin@ximian.com>
5699
5700         Fix #79302.
5701
5702         * decl.cs
5703         (MemberCache): Added a special .ctor for type parameters.
5704
5705         * typemanager.cs
5706         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5707         `MemberCache'.  
5708
5709 2007-03-09  Martin Baulig  <martin@ximian.com>
5710
5711         * enum.cs (Enum): Make this a TypeContainer.
5712         (EnumMember): Derive from `Const'.
5713
5714         * const.cs
5715         (Const.DoResolveValue): New protected virtual method; move most of
5716         the functionality of ResolveValue() here so we can override it in
5717         `EnumMember'.
5718         (Const.CreateConstantReference): Make this virtual.
5719
5720         * class.cs (Kind): Add `Kind.Enum'.
5721         (TypeContainer.Emit): Don't emit the enums here; they're already
5722         in the `RootContext.typecontainer_resolve_order'.
5723
5724         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5725         here; they're already in the `typecontainer_resolve_order'.
5726
5727         * ecore.cs (EnumConstant.ConvertImplicitly): Add
5728         TypeManager.DropGenericTypeArguments().
5729
5730         * typemanager.cs
5731         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5732         (TypeManager.IsEnumType): Likewise.
5733         (TypeManager.EnumToUnderlying): Likewise.
5734         (TypeManager.IsEqual): Add support for enums.
5735
5736 2007-03-12  Raja R Harinath  <rharinath@novell.com>
5737
5738         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5739         DefaultParameterValueAttribute to be undefined, say if System.dll
5740         is not referenced.
5741
5742 2007-03-11  Marek Safar  <marek.safar@gmail.com>
5743
5744         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5745         any mscorlib.
5746
5747 2007-03-10  Marek Safar  <marek.safar@gmail.com>
5748
5749         * class.cs, parameter.cs: Unified parameters verification.
5750
5751 2007-03-08  Martin Baulig  <martin@ximian.com>
5752
5753         * cs-parser.jay (constructor_header): Pass the location to the
5754         newly created TopLevelBlock.
5755
5756 2007-03-07  Martin Baulig  <martin@ximian.com>
5757
5758         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5759
5760 2007-03-06  Miguel de Icaza  <miguel@novell.com>
5761
5762         * convert.cs (ExplicitReferenceConversionExists): Sync this method
5763         with the changes from David, fixes the build.
5764
5765 2007-03-05  David Mitchell  <dmitchell@logos.com>
5766
5767         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5768         and its base interfaces to a one-dimensional array type S[],
5769         provided there is an implicit or explicit reference conversion
5770         from S to T.
5771
5772 2007-03-03  Marek Safar  <marek.safar@gmail.com>
5773
5774         * cs-tokenizer.cs: Implemented basic linq grammar.
5775
5776         * driver.cs: Set linq lang version on demand.
5777
5778 2007-02-26  Marek Safar  <marek.safar@gmail.com>
5779
5780         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5781
5782 2007-02-25  Marek Safar  <marek.safar@gmail.com>
5783
5784         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5785         (Fixes #80455)
5786
5787         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5788         here.
5789         Check property and event extern attributes.
5790
5791         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5792         charset.
5793
5794 2007-02-24  Marek Safar  <marek.safar@gmail.com>
5795
5796         A fix for bug #80407
5797         * ecore.cs: Don't report ambiguity error when methods have same parent.
5798
5799 2007-02-23  Marek Safar  <marek.safar@gmail.com>
5800
5801         A fix for bug #80878
5802         * class.cs, cs-parser.jay: Event property can host anonymous methods.
5803
5804 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5805
5806         * attribute.cs: Enable ExtensionAttribute presence test.
5807
5808 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5809
5810         * class.cs: Warn about missing GetHashCode only when Equals is override.
5811
5812         * decl.cs: Check accessibility of type arguments.
5813
5814         * typemanager.cs: Correctly report nullable array.
5815
5816 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5817
5818         * class.cs, report.cs: Capture more details when things go wrong.
5819
5820 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5821
5822         A fix for bug #80650
5823         * cs-parser.jay: Anonymous container starts at constructor declaration
5824         and not at block beginning because it has to be usable in constructor
5825         initializer.
5826
5827         * statement.cs: Use context location and not block one for error reporting.
5828
5829 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5830
5831         A fix for bug #78712
5832         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5833         too.
5834
5835 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5836
5837         A fix for bug #80493 by Atsushi Enomoto
5838         * cs-parser.jay: Ignore invalid attribute target.
5839
5840 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5841  
5842         * cs-tokenizer.cs: Ignore '\0' as white space character.
5843
5844 2007-02-17  Miguel de Icaza  <miguel@novell.com>
5845
5846         * cs-parser.jay: Add support for lambda expressions to the mcs
5847         compiler as well.
5848
5849         * lambda.cs: Only clone when we are probing, not on the final call
5850         (Compatible is the final call). 
5851
5852         * statement.cs (CloneContext): Introduce class to provide block
5853         remapping during clone.
5854
5855         All statements Clone themselves now.
5856
5857         (Clone): special handling for blocks, when we clone a block, we
5858         register the block inside this routine, as children of the block
5859         might trigger a lookup. 
5860         
5861         * expression.cs: Add support for CloneContext in all expressions. 
5862         
5863 2007-02-17  Marek Safar  <marek.safar@gmail.com>
5864  
5865         A fix for bug #80493
5866         * statement.cs: Report ambiguous warning when interfaces are not related.
5867
5868 2007-02-15  Marek Safar  <marek.safar@gmail.com>
5869
5870         C# 3.0 extension methods.
5871
5872         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5873         cannot be used directly.
5874
5875         * class.cs (Class.Emit): Emit extension attribute if any class method
5876         is extension method.
5877         (Method.Define): Add basic extension method validation conditions.
5878         (Method.Emit): Emit extension attribute for method.
5879
5880         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5881         extension method exists. Currently we follow same approach as Microsoft
5882         does, emit even if a method or a class are private but this can change
5883         later.
5884
5885         * cs-parser.jay: Add handling of `this' keyword in method parameters
5886         context.
5887
5888         * decl.cs (DeclSpace.IsStaticClass): New property.
5889         (MemberCache.FindExtensionMethods): Looks for extension methods with
5890         defined name and extension type.
5891
5892         * doc.cs: Updated after OverloadResolve changes.
5893
5894         * driver.cs: Add new soft reference to System.Core.dll.
5895
5896         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5897         (ExtensionMethodGroupExpr): Represents group of extension methods.
5898
5899         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5900         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5901         to MethodGroupExpr and made non-static for easier customization.
5902         (Invocation.DoResolve): Add extension method lookup when no standard
5903         method was found.
5904         (MemberAccess.DoResolve): Try extension methods if no member exists.
5905
5906         * modifiers.cs: Add METHOD_EXTENSION modifier.
5907
5908         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5909         as well as candidate extension type.
5910         (ComputeNamespaces): When assembly constains extension methods registers
5911         them.
5912         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5913         extension method lookup.
5914         (Namespace.LookupExtensionMethod): Looks for extension method in this
5915         namespace.
5916         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5917         find a method which matches name and extensionType.
5918
5919         * parameter.cs (Parameter): Add This modifer.
5920         (HasExtensionMethodModifier): New property.
5921         (Resolve): Add extension parameter check.
5922         (ModFlags): turned to property to exclude this modifier as it is not real
5923         parameter modifier.
5924         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5925
5926         * support.cs (ParameterData): Add ExtensionMethodType.
5927         (ReflectionParameters): Implemented ExtensionMethodType interface property.
5928
5929         * typemanager.cs: Add type and ctor extension attribute type.
5930
5931 2007-02-15  Miguel de Icaza  <miguel@novell.com>
5932
5933         * report.cs (DisableErrors, EnableErrors): used to prevent error
5934         output when we are "trying" to compile various methods with
5935         different types. 
5936
5937         * ecore.cs (Expression): Add Clone method that calls the virtual
5938         CloneTo method.  The current CloneTo method in Expression throws
5939         an exception so we can track down all the places where this must
5940         be implemented (not using abstract, because that would be a lot of
5941         up-front-work before we can start testing the implementation
5942         idea). 
5943
5944         Important: we only need Clone capabilities for expressions created
5945         by the parser, as the expressions we will be cloning are
5946         expressions in the pre-resolved state.   This vastly simplifies
5947         the work required. 
5948         
5949         (SimpleName): Add CloneTo that does nothing.
5950         (EmptyCast): Add CloneTo.
5951         
5952         * expression.cs (Binary): Implement CloneTo.
5953         (Invocation.IsApplicable): Store the current ec in
5954         EmitContext.TempEc and restore it on return.  This is used so we
5955         do not have to sprinkle hundres of methods with an extra
5956         EmitContext, we know that the only user is the lambda expression
5957         ImplicitConversionExists code. 
5958         
5959         (Argument): Add Cloning capabilities.
5960         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5961         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5962         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5963         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5964         IndexerAccess): Add Clone capability.
5965
5966         (LocalVariableReference, This): TODO: needs cloned Block mapping.
5967
5968         (Argument): Add cloning capability.
5969
5970         * assign.cs (Assign): Implement CloneTo.
5971
5972         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5973         
5974         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5975         version by calling Convert with the EmitContext (that we are
5976         currently storing in ec, this is not great, but will do for now,
5977         to avoid passing EmitContext parameters to hundreds of functions
5978         that do not need them now).
5979
5980         (SetExpression): Remove, it is not needed.
5981         
5982         (ContextualReturn): Implement CloneTo.
5983
5984         * statement.cs (Statement): Implement cloning infrastructure,
5985         similar to expressions.
5986
5987         (Block): Partial implementation of Clone for statements.
5988
5989         (Return): Implement clone.
5990         
5991         * constant.cs (Constant.CloneTo): New method, does nothing.
5992
5993         * codegen.cs (TempEc): Add a static EmitContext as a temporary
5994         solution, until we decide how to exactly do this.  
5995         
5996 2007-02-14  Marek Safar  <marek.safar@gmail.com>
5997  
5998         A fix for bug #80493
5999         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6000         a property is override we need to use second accessor.
6001
6002 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6003  
6004         A fix for bug #80418
6005         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6006         methods.
6007
6008 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6009
6010         Another fix for bug #80749
6011         * pending.cs: Abstract class has priority over interfaces.
6012
6013 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6014
6015         Another fix for bug #80749
6016         * pending.cs: Abstract class has priority over interfaces.
6017
6018 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6019
6020         Another fix for bug #80749
6021         * pending.cs: Abstract class has priority over interfaces.
6022
6023 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6024
6025         Another fix for bug #80749
6026         * pending.cs: Abstract class has priority over interfaces.
6027
6028 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6029
6030         * class.cs Better error message.
6031
6032         * driver.cs: Add shorter versions of -optimize option.
6033
6034 2007-02-13  Martin Baulig  <martin@ximian.com>
6035
6036         * class.cs (Constructor.Emit): Check the return value of
6037         ec.ResolveTopBlock() and return on error.
6038
6039 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6040
6041         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6042         message to fix error message regression.
6043
6044 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6045
6046         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6047
6048 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6049
6050         A fix for bug #80749
6051         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6052         its parent container.
6053
6054         * class.cs (DefineFieldInitializers): Each initializer can has different
6055         resolve context.
6056
6057         * const.cs: Updated.
6058
6059 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6060
6061         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6062         now all the heavy lifting to check that embedded statements or
6063         expressions have the right form is done in the ContextualReturn.
6064
6065         (ContextualReturn): New class.  
6066
6067         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6068         method that can be invoked to report 201, so we do not replicate
6069         this everywhere.
6070
6071         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6072         
6073         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6074         treating tabs as spaces. 
6075
6076 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6077
6078         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6079         * assign.cs: Use full implicit conversion for right side check.
6080
6081 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6082
6083         * statement.cs (Switch): Switch over boolean type is not standardized.
6084
6085 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6086
6087         A fix for bug #80755
6088         * decl.cs (FindBaseEvent): Don't use method cache for events.
6089
6090 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6091
6092         * cs-parser.jay: Better syntax error handling.
6093
6094         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6095         instead of underlying type value.
6096
6097 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6098
6099         * driver.cs: Check define identifier before is registered.
6100
6101         * namespace.cs: Use existing error message.
6102
6103         * report.cs: New warning.
6104
6105 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6106
6107         A fix for bug #80742
6108         * expression.cs: Delegate Invoke method can be called directly.
6109
6110 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6111
6112         A fix for bug #80676
6113         * class.cs (IsEntryPoint): The Main method can have params modifier.
6114
6115 2007-02-04  Miguel de Icaza  <miguel@novell.com>
6116
6117         * parameter.cs (Parameter, Parameters): Add Clone method.
6118
6119         * anonymous.cs (Compatible): Turn method into virtual method, so
6120         LambdaExpression can implement a different behavior.
6121
6122         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6123         out the basic checking here, so it can be used by
6124         LambdaExpressions.
6125         
6126         * lambda.cs: Introduce "Compatible" function that will do the
6127         heavy lifting.
6128
6129 2007-02-02  Marek Safar  <marek.safar@gmail.com>
6130
6131         * attribute.cs: Unified one error message.
6132
6133         * class.cs (Class): Use type attributes and not properties to test static
6134         class.
6135         (IsEntryPoint): Don's pass local variable.
6136
6137         * convert.cs: Removed duplicate check.
6138
6139         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6140
6141         * driver.cs: Don't crash when soft reference does not exist.
6142
6143         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6144         (UsingEntry): Removed redundant allocation.
6145
6146         * parameter.cs: Add fast path for type parameters.
6147
6148         * support.cs: Don't allocate attribute when it's not used.
6149
6150 2007-01-30  Miguel de Icaza  <miguel@novell.com>
6151
6152         * anonymous.cs
6153         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6154         this into a virtual method, so we can override it in LambdaExpression.
6155
6156         * driver.cs: Improve diagnostics in case of failure. 
6157
6158         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6159         write a function that is slightly more complex and that parses:
6160
6161         type identifier [, type identifier]* )
6162
6163         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6164         this expression:
6165
6166                 (canEmpty ? i >= 0 : i > 0)
6167
6168 2007-01-30  Raja R Harinath  <rharinath@novell.com>
6169
6170         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6171         exception on possibly valid code.
6172
6173 2007-01-29  Raja R Harinath  <rharinath@novell.com>
6174
6175         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6176         Push/PopPosition.
6177         (parse_opt_type_arguments): Remove.  It's almost the same as
6178         parse_less_than.
6179         (parse_namespace_or_typename): Use parse_less_than.
6180
6181 2007-01-28  Miguel de Icaza  <miguel@novell.com>
6182
6183         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6184         this bug took a few hours to find, because the state saved and
6185         restored by PushPosition and PopPosition was ignoring the state of
6186         parse_generic_less_than.
6187
6188         I can also now remove the handling of OP_LT and OP_GT, this solves
6189         the big mistery.
6190         
6191         * cs-tokenizer.cs: store the location for the ARROW token, we use
6192         that in the parser.
6193
6194         (PushPosition, PopPosition): save/restore also `current_token',
6195         restore `parse_generic_less_than' (was missing).
6196
6197         (parse_opt_type_arguments): use parse_type, not
6198         parse_namespace_or_typename to parse types.
6199
6200         * lambda.cs: Empty new file, will eventually have the lambda
6201         expression implementation.
6202
6203         * lambda.test: used to test the internal tokenizer. 
6204
6205         * report.cs (FeatureIsNotISO1): Rename from
6206         FeatureIsNotStandardized, because it was about the language level
6207         (1 vs 2) it was not about standarization.
6208
6209         (FeatureRequiresLINQ): New.
6210
6211         * support.cs (SeekableStreamReader): Only require that the reader
6212         is a TextReader, not a StreamReader, so we can plug StringReader. 
6213
6214         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6215         given position in the input stream the following tokens can be
6216         parsed as a type followed by an identifier.
6217
6218         (is_punct): after a '(' if parse_type_and_parameter returns true,
6219         then return a special token OPEN_PARENS_LAMBDA which is used to
6220         avoid reduce/reduce errors in the grammar for the
6221         lambda_expression rules.
6222
6223         (parse_type): implement a type parser inside the
6224         tokenizer, the parser only returns true or false depending on
6225         whether the input at a given position can be parsed as a type.
6226
6227         (peek_token): new method used during type parsing.
6228
6229 2007-01-28  Raja R Harinath  <rharinath@novell.com>
6230
6231         Fix #80531
6232         * anonymous.cs (ScopeInfo.InflateParameters): New.
6233         (AnonymousContainer.Resolve): Use it to redirect types of
6234         delegate parameters.
6235
6236 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6237
6238         Fix #80530
6239         * expression.cs (Error_InvalidArguments): Don't use two different
6240         messages for CS1503.  Use ExtraInformation and
6241         SymbolRelatedToPreviousError instead.
6242
6243         Fix #80358
6244         * decl.cs (DeclSpace.initialize_type_params): Don't access
6245         'type_params' of a partial class directly.
6246
6247 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6248
6249         * constant.cs: Removed a handful of out-of-range checks that were
6250         not necessary. 
6251
6252 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6253
6254         * expression.cs (CheckUselessComparison): Add additional check for char
6255         constants.
6256
6257         * namespace.cs: Fixed typo.
6258
6259 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6260
6261         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6262         gone, instead we inline the test, preventing the needless casts to
6263         longs, ulongs and doubles for the parameters, avoiding calls to
6264         methods that overchecked stuff, and instead inlined things
6265         nicely. 
6266
6267 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6268
6269         * cs-parser.jay: Better parameter error handling.
6270
6271 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6272
6273         A fix for bug #80368, #80522
6274         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6275         whether array initializer contains constants only.
6276         (ArrayCreation.Emit): Use better formula to decide when
6277         are array initializers for static initialization.
6278         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6279         have to emit even constants otherwise they are pre-initialized.
6280
6281 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6282             Raja R Harinath  <rharinath@novell.com>
6283
6284         Fix emit order of 'get' vs. 'set'.
6285         * support.cs (Accessors): New.
6286         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6287         Note the order in which accessors are declared in the source.
6288         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6289         Refactored from Property.Define and Indexer.Define.
6290         (PropertyBase.DefineAccessors): New helper that calls the above in
6291         appropriate order as noted by the parser.
6292         (Property.Define, Indexer.Define): Update to changes.
6293         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6294
6295 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6296
6297         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6298         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6299         there's an implicit conversion from the current type to the target
6300         type before converting the underlying constant.
6301
6302 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6303
6304         * const.cs (ResolveValue): Updated after constant conversion was made more
6305         generic.
6306
6307         * constant.cs (GetAttributableValue): constant to object conversion is
6308         used for attributes only.
6309         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6310         constant conversions.
6311         (LongConstant.ConvertImplicitly): Ditto.
6312
6313         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6314         (ImplicitConversionStandard): Handle constant conversion as extra step.
6315         It solves the issue when constant conversion was called indirectly like
6316         inside array initializer and constant folding was skipped.
6317
6318         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6319         this change.
6320
6321         * statement.cs(ImplicitConversionStandard): Updated after constant
6322         conversion was made more generic.
6323
6324 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6325
6326         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6327         Constraints, solves the problem where the compiler incorrectly
6328         reported that a type parameter was not constrained to a class (Bug
6329         80518)
6330
6331 2007-01-14  Marek Habersack  <grendello@gmail.com>
6332
6333         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6334
6335 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6336
6337         A fix for bug #80368
6338         * assign.cs (FieldInitializer): New class implements field
6339         initializer statement.
6340
6341         * attribute.cs: Update after FieldMember rename.
6342
6343         * class.cs (PropertyBasedMember): New common class for property based
6344         types.
6345         (InterfaceMemberBase): New base class for all members which can be used as
6346         an interface members.
6347         (MethodCore): Moved really common code to InterfaceMemberBase.
6348         (Method.Define): Equal and GetHasCode detection is relevant for methods
6349         only.
6350         (MethodData.Define): Don't assume that public event implements an
6351         interface automatically.
6352         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6353         modifier is used.
6354         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6355         (FieldMember): Merged with FieldBase.
6356         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6357         event extern modifier can be used.
6358         (EventField.EventFieldAccessor): Moved event field specific code here.
6359         (Event.AllowedModifiers): Even event can be extern.
6360         (Event.FindOutBaseMethod): New override specific to events.
6361         (Indexer.parameters): Reintroduce parameters because base class holds
6362         only properties common data.
6363         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6364         need do extra parameters check.
6365
6366         * const.cs: Update after FieldMember rename.
6367
6368         * decl.cs (MemberCache.FindBaseEvent): New method.
6369
6370         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6371         to reflect that indexer is now derived from PropertyBased.
6372
6373         * ecore.cs (GetMemberType): Made public.
6374         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6375         obsolete event.
6376
6377         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6378         
6379         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6380         (RegisterEvent): Removed.
6381         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6382         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6383
6384 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6385
6386         Fix #80249
6387         * statement.cs (CollectionForeach.TryType): Prefer generic
6388         GetEnumerator over non-generic variant.  Fix code to follow comments.
6389
6390 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6391
6392         Fix #80446
6393         * support.cs (ReflectionParameter): Don't use an invalid index on
6394         the generic parameter data.
6395
6396 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6397
6398         * driver.cs: Just add a tiny bit of infrastructure.
6399
6400 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6401
6402         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6403         where field type is struct from current assembly.
6404         
6405         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6406         it is possible.
6407
6408 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6409
6410         A fix for bug #80381
6411         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6412         the core types.
6413
6414         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6415         messages.
6416         (Namespace.LookupType): Always use core types from corlib when speficied.
6417
6418         * report.cs: A new warning.
6419
6420         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6421         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6422         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6423
6424         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6425         (InitCoreTypes): Set expression type of object_type and value_type
6426         immediately after lookup.
6427
6428 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6429
6430         * cs-tokenizer.cs: Accept Pc class characters (Connector
6431         Punctuation) as valid identifiers.  Fixes #78259
6432
6433         * expression.cs (Invocation.DoResolve): Moved the check for the
6434         use of `this' for doing method calls to the Invocation resolution
6435         step, after overload resolution has taken place instead of doing
6436         the check at the low-level `This.DoResolve' level.
6437
6438         The `This.DoResolve'(appens before overload resolution, so it has
6439         no way of knowing if the method that will be called will be
6440         instace or static, triggering an erroneous report for cs0188 (Bug
6441         78113).
6442
6443         We now do the check for instance method invocations after we know
6444         what method will be called.
6445
6446         (This.CheckThisUsage): Move the actual use of this structure
6447         checking into its own method and expose it. 
6448
6449         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6450         EmitContext.
6451
6452         Exceptions: Null.ConvertImplicitly,
6453         Constant.ImplicitConversionRequired as there are too many call
6454         sites for passing the ec. 
6455
6456         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6457         EmitContext, if the value is null, then we do not try to provide
6458         the extra information from the error (If a userdefined conversion
6459         exists, as UserDefinedConversion requires a non null-EmitContext).
6460
6461         Fixes: #80347
6462
6463 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6464
6465         * flowanalysis.cs (MyBitVector): Document some invariants.
6466         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6467         introduced below, and add a couple of others, 
6468
6469 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6470
6471         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6472         GetPropertyFromAccessor and GetEventFromAccessor.
6473         
6474         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6475         overrides non-obsolete one.
6476         (Indexer.Define): Error message has been moved to the parser.
6477
6478         * cs-parser.jay: Better syntax errors handling.
6479
6480         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6481         when an invocation has no arguments.
6482
6483         * ecore.cs: Removed not used caching.
6484
6485         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6486         implementation.
6487
6488         * report.cs: Add a new warning.
6489
6490         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6491
6492         * typemanager.cs (enumeration_type): Removed.
6493         (CSharpSignature): Reuses IsSpecialMethod.
6494         (IsEqual): Hack for MS BCL.
6495         (GetPropertyFromAccessor): New method.
6496         (GetEventFromAccessor): New method.
6497         (IsSpecialMethod): Fixed to handle more cases.
6498
6499 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6500
6501         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6502         Made white spaces array static.
6503
6504         * ecore.cs (RemoveGenericArity): Optimized.
6505
6506         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6507         10 times faster).
6508         (MyBitVector.initialize_vector): Simplified.
6509
6510 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6511
6512         * ecore.cs: Am not entirely happy with this hack, but it seems to
6513         address the issue in 80257 (a small test case for
6514         CreativeDocs.NET). 
6515
6516         I set the MethodGroupExpr.Type to an internal compiler type
6517         (itself in this case) to force the resolution to take place.   Why
6518         it does not take place with a null is beyond me.
6519
6520 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6521
6522         A fix for bug #80288
6523         * expression.cs (ResolveOperator): Consider user defined conversion for
6524         logical and operator too.
6525         (EmitBranchable): Optimization for logical and when full constant folding
6526         could not be applied but one operand is constant.
6527
6528 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6529
6530         * class.cs (GetClassBases): Write 5 times every day, will never use
6531         FullName for error reporting.
6532
6533         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6534
6535 2006-12-19  Martin Baulig  <martin@ximian.com>
6536
6537         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6538         the symbol file info here.
6539
6540 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6541
6542         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6543         of `elseif' is taking then following sections are not taking.
6544         Fixes an issue reported on mono mailing list.
6545
6546 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6547
6548         A fix for bug #80300
6549         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6550         a caller is not taking.
6551
6552 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6553
6554         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6555         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6556         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6557         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6558         * class.cs: Update to changes.
6559
6560 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6561
6562         A fix for bug #79934
6563         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6564         partial container.
6565
6566         * class.cs (ResolveMembers): Register an iterator in current container and
6567         not in shared one.
6568
6569 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6570
6571         Fix test-543.cs
6572         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6573         satisfy a params annotated parameter.
6574
6575 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6576
6577         A fix for bug #77014
6578         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6579         paramters correctly and not rely on hacks in Parameters class.
6580         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6581         at any possition.
6582         (Invocation.VerifyArgumentsCompat): Ditto.
6583         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6584         any possition.
6585
6586         * parameter.cs (HasParams): Don't assume that params is the last one.
6587
6588         * support.cs (ReflectionParameters.ctor): Look for params attribute
6589         correctly.
6590         (ReflectionParameters.ParameterType): Removed hack when we returned last
6591         parameter for out of range parameters.
6592         (ParameterName, ParameterModifier): Ditto.
6593
6594 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6595
6596         A fix for bug #79987
6597         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6598         when assembly is not CLS compliant but type is. I have no idea why is this
6599         allowed.
6600
6601         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6602
6603 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6604
6605         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6606         in struct constructors, they are basically no-ops.
6607
6608 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6609
6610         * cs-tokenizer.cs (Position): Save preprocessor status too.
6611
6612 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6613
6614         A fix for bug #77794
6615         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6616
6617 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6618
6619         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6620         Fixes #69299.
6621         (pp_expr): Report error for an invalid expression.
6622         (handle_preprocessing_directive): Simplified; add more error checking.
6623
6624 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6625
6626         A fix for bug #74939
6627         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6628         directives handling.
6629
6630 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6631
6632         A fix for bugs #80093, and #75984
6633         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6634         logic, it seems to me as it worked before "by coincidence".
6635         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6636         (cleanup): Enabled endif check.
6637
6638 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6639
6640         A fix for bug #80162
6641         * statement.cs (CollectionForeach.TryType): Generics and non-generics
6642         enumerators are never ambiguous.
6643
6644 2006-12-08  Raja R Harinath  <rharinath@novell.com>
6645
6646         Fix #80060
6647         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6648
6649 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6650
6651         A fix for bug #80144
6652         * class.cs (EventProperty.Define): Explicit implementation means
6653         that an even is used.
6654
6655 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6656
6657         Fixes the operators implementation (part II)
6658
6659         * cfold.cs (DoConstantNumericPromotions): Renamed to
6660         DoBinaryNumericPromotions and simplified.
6661         (BinaryFold): Couple of conversion fixes; simplified.
6662
6663         * constant.cs, ecore.cs, literal.cs
6664         (ToType): Renamed to ConvertImplicitly.
6665         (Reduce): Renamed to ConvertExplicitly.
6666
6667         * class.cs, convert.cs: Updated.
6668
6669         * expression.cs: TryReduce doesn't throw an exception.
6670
6671 2006-12-01  Marek Safar  <marek.safar@gmail.com>
6672
6673         A fix for bug #80108
6674         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6675         compatible.
6676
6677 2006-11-30  Marek Safar  <marek.safar@gmail.com>
6678
6679         Fixes unary operators implementation (part I)
6680         Also fixes #80026
6681
6682         * cfold.cs (Error_CompileTimeOverflow): Made internal
6683
6684         * const.cs (IConstant): Changed to use reference to constant and
6685         not constant itself.
6686         Updated IConstant implementations.
6687
6688         * constant.cs (CreateConstant): New factory method.
6689         Updated IConstant implementation.
6690
6691         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6692
6693         * ecore.cs: Updated to use CreateConstantReference.
6694
6695         * enum.cs: Reflects IConstant changes.
6696
6697         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6698
6699         * literal.cs (NullConstant): Change to be independently usable.
6700
6701 2006-11-29  Martin Baulig  <martin@ximian.com>
6702
6703         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6704         we need to emit the scope initializer before calling the base .ctor.
6705
6706         * anonymous.cs: Merged back from the new anonymous methods branch.
6707         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6708
6709         * expression.cs (ParameterReference.DoResolveBase): Create a
6710         "normal" ScopeInfo when capturing parameters rather than using the
6711         root scope; this makes things work with anonymous methods having
6712         parameters.
6713
6714         * statement.cs
6715         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6716
6717 2006-11-22  Marek Safar  <marek.safar@gmail.com>
6718
6719         A fix for bug #79987
6720         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6721         check to a base class.
6722         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6723         only when assembly has missing attribute.
6724         * report.cs: Update.
6725
6726 2006-11-21  Marek Safar  <marek.safar@gmail.com>
6727
6728         * cs-tokenizer.cs: Merged with gmcs version.
6729
6730 2006-11-20  Marek Safar  <marek.safar@gmail.com>
6731
6732         * cs-tokenizer.cs,
6733         * cs-parser.jay: Better error message when partial keyword is misplaced.
6734
6735 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
6736
6737         A fix for bug #79810
6738         report.cs: CS1058 only applies to 2.0 profile (gmcs).
6739         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6740         a RuntimeWrappedException by default.
6741
6742 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6743
6744         A fix for bug #79843
6745         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6746         implementation.
6747         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6748
6749 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6750
6751         * driver.cs, namespace.cs: Uses faster IndexOf version.
6752
6753 2006-11-17  Marek Safar  <marek.safar@gmail.com>
6754
6755         A fix for bug #79941
6756         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6757         operators.
6758         (Operator.Define): Implicit/Explicit operator of same type is duplicate
6759         even if internal name is different.
6760         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6761         (UserDefinedConversion): Simplified as the operators cannot be internal.
6762         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6763         conversions.
6764         (MethodLookup): Replaced EmitContext with parentType.
6765         * expression.cs: Updated.
6766
6767 2006-11-09  Raja R Harinath  <rharinath@novell.com>
6768
6769         * driver.cs (BadAssembly): Handle all the ugliness of
6770         DefineDynamicAssembly.
6771
6772 2006-11-08  Raja R Harinath  <rharinath@novell.com>
6773
6774         Address parts of #58244 -- most of what's left is in the runtime
6775         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
6776         CS1509 error checks, and handle them for all assembly loads, not
6777         just the first invocation.
6778         (LoadModule): Likewise.  Move handling of 'adder_method' ...
6779         * codegen.cs (AssemblyClass.AddModule): ... here.
6780
6781 2006-11-02  Marek Safar  <marek.safar@gmail.com>
6782
6783         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6784         IEnumerable<T> is ambiguous.
6785
6786 2006-10-31  Marek Safar  <marek.safar@gmail.com>
6787
6788         A fix for bug #67689
6789         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6790         GetEnumerator is ambiguous.
6791
6792         * report.cs: Add new warning.
6793
6794 2006-10-29  Marek Safar  <marek.safar@gmail.com>
6795
6796         A fix for bug #78602
6797         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6798         to protected member can be nested type.
6799
6800 2006-10-28  Marek Safar  <marek.safar@gmail.com>
6801
6802         A fix for bug #78965
6803         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6804         to protected member must derive from current type.
6805
6806 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6807
6808         assign.cs: Reuses error method.
6809
6810         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6811         instead of type for constants.
6812         (Expression.Error_ValueAssignment): Common error method.
6813
6814         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6815         for any assignment.
6816
6817 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6818
6819         A fix for bug #79081
6820         * expression.cs (MemberAccess.DoResolve): Check nested type
6821         accessibility.
6822
6823 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
6824
6825         * doc.cs : nested delegates were not handled. Fixed bug #79754.
6826
6827 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6828
6829         A fix for bug #76591
6830         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6831
6832 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6833
6834         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6835         type forwarder of the same type multiple times.
6836
6837 2006-10-26  Raja R Harinath  <rharinath@novell.com>
6838
6839         Fix #78820
6840         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6841         instance as an rvalue, even when we later resolve as an lvalue.
6842
6843 2006-10-25  Martin Baulig  <martin@ximian.com>
6844
6845         * anonymous.cs: Fix #79673.
6846
6847 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
6848
6849         A fix for bug #79666
6850         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6851         ignored when is optimized (= default value) as its value is already set.
6852
6853 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6854
6855         A fix for bug #79724
6856         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6857         TypeContainer for type lookup.
6858
6859 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6860
6861         A fix for bug #79231
6862         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6863         * expression.cs (OverloadResolve): Always convert type name for
6864         an error message.
6865         (ResolveNamespaceOrType): Don't confuse a nested type with any 
6866         other member.
6867
6868 2006-10-18  Martin Baulig <martin@ximian.com>
6869
6870         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6871
6872 2006-10-17  Miguel de Icaza  <miguel@novell.com>
6873
6874         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6875         an int32, but requesting an int64 from the conversion
6876
6877 2006-10-12  Martin Baulig  <martin@ximian.com>
6878
6879         * anonymous.cs
6880         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
6881         
6882 2006-10-12  Martin Baulig  <martin@ximian.com>
6883
6884         * statement.cs
6885         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6886
6887 2006-10-11  Miguel de Icaza  <miguel@novell.com>
6888
6889         * convert.cs: Remove broken code: I was doing the "Existance"
6890         tests for Implicit conversions.
6891
6892 2006-10-10  Miguel de Icaza  <miguel@novell.com>
6893
6894         * convert.cs: Added one missing case in
6895         ImplicitStandardConversionExists uint64 to intptr.
6896
6897         Fixes #59800
6898         
6899         * typemanager.cs (uintptr_type): another core known type.   
6900
6901         * ecore.cs (OperatorCast): routine used to do cast operations that
6902         depend on op_Explicit.  We could change some of the Decimal
6903         conversions to use this.
6904
6905         This one has a probe mechanism that checks both types for an op_
6906         which it coudl be used to eliminate two classes: CastToDecimal
6907         and CastFromDecimal.
6908
6909         * convert.cs: Implement the conversions documented in #59800
6910         
6911 2006-10-10  Martin Baulig  <martin@ximian.com>
6912
6913         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6914         before RootScope.ResolveMembers().
6915
6916         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6917         `CurrentType' if appropriate.
6918
6919 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
6920
6921         A fix for bug #78568
6922         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6923         when contains binary operators.
6924         * cs-parser.jay: Updated.
6925
6926 2006-10-09  Martin Baulig  <martin@ximian.com>
6927
6928         * delegate.cs
6929         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6930         moved that into Define() and also do the other type parameter
6931         checks there.  Fixes #79094.  Added gtest-292.cs.
6932
6933         * expression.cs
6934         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6935         since that doesn't include type parameters; don't use `Ldelema'
6936         for type parameters.  Fixes #78980.  Added gtest-293.cs.
6937
6938 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
6939
6940         A fix for #77796
6941         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6942         conversion is allowed.
6943
6944 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6945
6946         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6947         error reporting when no error occurs.
6948
6949 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6950
6951         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6952         does not exist.
6953
6954 2006-10-06  Raja R Harinath  <rharinath@novell.com>
6955
6956         Fix #79584
6957         * class.cs (DefineTypeBuilder): Check circular dependencies before
6958         setting the parent of the TypeBuilder.
6959         (CheckRecursiveDefinition): Don't use 'BaseType', since
6960         it may not be valid until after DefineTypeBuilder.  Use
6961         'base_type' instead.
6962
6963 2006-10-04  Martin Baulig  <martin@ximian.com>
6964
6965         Merged the Anonymous Methods patch.
6966
6967         * anonymous.cs, iterators.cs: The new anonymous methods code.
6968
6969         * statement.cs (Variable): New public abstract class.
6970         (LocalInfo.Variable): New public property.
6971         (LocalInfo.ResolveVariable): New public method.
6972         (Block.Flags): Add `IsIterator'.
6973         (Block.AddVariable): Improved the CS0136 check.
6974         (Block.AnonymousChildren): New public property.
6975         (Block.AddAnonymousChild): New public method.
6976         (ToplevelBlock): Update to use the new anonymous method framework.
6977         (ToplevelBlock.ctor): `container' is now a `Block' and not a
6978         `ToplevelBlock'; this is required to correctly implement the
6979         CS0136 check.
6980         (Fixed, Using): Use `TemporaryVariable' instead of directly
6981         creating the `LocalBuilder'.
6982
6983         * parameter.cs (Parameter.ResolveVariable): New public method.
6984         (Parameters.ResolveVariable): Likewise.
6985
6986         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6987
6988         * class.cs (TypeContainer): Replaced the `iterators' list and
6989         corresponding methods with a list of `CompilerGeneratedClass'es.
6990         (TypeContainer.ResolveMembers): New public method.
6991         (Method): `IIteratorContainer' has been replaced by
6992         `IAnonymousHost'.
6993
6994         * expression.cs (VariableReference): New public abstract base
6995         class for `LocalVariableReference', `ParameterReference' and
6996         `This'.
6997
6998         * codegen.cs (EmitContext): Removed `capture_context',
6999         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7000         (EmitContext.EmitThis): Removed.
7001
7002         * cs-parser.jay: Replace `iterator_container' with
7003         `anonymous_host'.       
7004
7005 2006-10-04  Martin Baulig  <martin@ximian.com>
7006
7007         * generic.cs (GenericMethod): Don't make this abstract.
7008         (Constraints.Clone): Added dummy implementation.
7009
7010 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7011
7012         Fix #79577
7013         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7014         'declspaces'.  Avoid allocating arrays willy-nilly.
7015
7016         Fix #79553
7017         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7018         cases out of the switch.
7019
7020 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7021
7022         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7023         message when non-generic type is used with the type arguments.
7024         * expression.cs: Updated.
7025
7026 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7027
7028         Fix #79013
7029         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7030         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7031         Change semantics slightly.  Don't insist on having only one
7032         temporary EmptyExpression -- just throttle the creation of new ones.
7033
7034         Fix #79451
7035         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7036         non-interfaces too.  If no methods are found, don't try to create
7037         a MethodGroupExpr.
7038
7039 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7040
7041         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7042         generic type.
7043
7044         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7045         us produce better error message.
7046
7047 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7048
7049         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7050         of the `|' operator.
7051
7052         * report.cs: A new warning added.
7053
7054 2006-09-27  Martin Baulig  <martin@ximian.com>
7055
7056         * generic.cs (GenericMethod): Don't make this abstract.
7057
7058 2006-09-27  Martin Baulig  <martin@ximian.com>
7059
7060         * report.cs
7061         (InternalErrorException): Added overloaded ctor taking a params array.
7062
7063 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7064
7065         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7066         Fixed the cases when same error was reported twice.
7067
7068         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7069         now report symbol information.
7070
7071 2006-09-25  Martin Baulig  <martin@ximian.com>
7072
7073         * class.cs: Completely unified with the gmcs version.
7074
7075 2006-09-25  Martin Baulig  <martin@ximian.com>
7076
7077         * typemanager.cs (TypeManager.IsNullableType): New public function.
7078         (TypeManager.IsNullableTypeOf): Likewise.
7079         (TypeManager.IsNullableValueType): Likewise.
7080
7081         * class.cs (MethodCore): Added the `GenericMethod' argument from
7082         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7083
7084 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7085
7086         * convert.cs: Unify with gmcs version.
7087
7088 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7089
7090         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7091         verify them as well.
7092
7093         * report.cs: New warning.
7094
7095 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7096
7097         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7098         for anonymous block with out argument.
7099
7100 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7101
7102         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7103         not used private events only.
7104
7105 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7106
7107         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7108
7109         * const.cs (Const.Define): Check for constant type.
7110         (Const.IsConstantTypeValid): Looks for valid constant types.
7111
7112         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7113
7114         * ecore.cs (EmptyConstantCast): New common class for all constant based
7115         EmptyCast(s).
7116
7117         * expression.cs (Is.DoResolve): Handle null constant especially.
7118         (New.DoResolve): Check for new void().
7119         (MemberAccess.DoResolve): Cope with all kind of nulls.
7120
7121         * literal.cs (NullConstant): Uses EmptyConstantCast.
7122         (NullDefault): Based on EmptyConstantCast.
7123         (NullLiteral): Uses EmptyConstantCast.
7124
7125         * statement.cs (Block.ResolveMeta): Check for constant type.
7126
7127 2006-09-22  Martin Baulig  <martin@ximian.com>
7128
7129         * delegate.cs, attribute.cs: Merged with the gmcs versions.
7130
7131 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7132
7133         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7134         not the null type.
7135
7136         Fix part of #79451
7137         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7138         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
7139         code slightly.
7140
7141 2006-09-22  Martin Baulig  <martin@ximian.com>
7142
7143         * ecore.cs: Merged with the gmcs version.
7144
7145         * generic.cs (ConstructedType): New dummy class.
7146         (TypeArguments): Don't make this abstract.
7147
7148         * typemanager.cs
7149         (TypeManager.IsGenericTypeDefinition): New method.
7150         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7151
7152 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7153
7154         * expression.cs (ComposedCast): Check for arrays of TypedReference
7155         before creating the type, not after.
7156
7157 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
7158
7159         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7160         after ToType change.
7161
7162         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7163         when constant must be implicitly convertible.
7164
7165         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7166
7167         * ecore.cs (NullCast): Derives from NullConstant.
7168
7169         * expression.cs (Is.DoResolve): Removed useless variables.
7170         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7171         (New.Constantify): Add enum support.
7172         (MemberAccess.DoResolve): Add warning when accessing null constant or
7173         variable.
7174
7175         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7176         property.
7177
7178         * literal.cs (NullConstant): New abstract class with common
7179         functionality for all null specializations.
7180         (NullDefault): Represents default(X) when result can be
7181         reduced to null.
7182         (NullLiteral): Updated.
7183
7184         * report.cs: Add new warning.
7185
7186 2006-09-21  Martin Baulig  <martin@ximian.com>
7187
7188         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7189
7190 2006-09-21  Martin Baulig  <martin@ximian.com>
7191
7192         * generic.cs (GenericConstraints): New dummy class.
7193         (Constraints): Likewise.
7194         (TypeParameter): Likewise.
7195         (TypeParameterName): Likewise.
7196         (GenericMethod): Likewise.
7197
7198         * typemanager.cs (TypeManager.GetGenericArguments): New method.
7199
7200         * decl.cs: Merged with the gmcs version.
7201
7202 2006-09-21  Raja R Harinath  <rharinath@novell.com>
7203
7204         * generic.cs (TypeParameter): Implement IMemberContainer.
7205         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
7206
7207         * rootcontext.cs: Unify with gmcs version.
7208
7209         * report.cs: Unify with gmcs version.
7210         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7211         from gmcs/generics.cs.
7212         * generics.cs (TypeParameter): New dummy class.
7213
7214         * support.cs: Unify with gmcs version.
7215
7216 2006-09-20  Raja R Harinath  <rharinath@novell.com>
7217
7218         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7219         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7220
7221         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7222         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7223         * mcs.exe.sources: Add generic.cs.
7224
7225         * codegen.cs: Unify with gmcs version.
7226
7227         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7228         (EmitContext): Add GenericDeclContainer implementation.
7229         * decl.cs (MemberCore, DeclSpace): Likewise.
7230         * namespace.cs: Remove #ifdef GMCS_SOURCE.
7231
7232         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7233         MCS TypeManager has a corresponding dummy method.
7234
7235 2006-09-19  Martin Baulig  <martin@ximian.com>
7236
7237         * expression.cs: Completely merged with the gmcs version.
7238
7239 2006-09-19  Martin Baulig  <martin@ximian.com>
7240
7241         * expression.cs (Invocation): Merged with the gmcs version.
7242         (ArrayAccess.GetStoreOpcode): Likewise.
7243
7244 2006-09-19  Martin Baulig  <martin@ximian.com>
7245
7246         * typemanager.cs
7247         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7248         (TypeManager.IsGenericMethodDefinition): Likewise.
7249
7250 2006-09-19  Martin Baulig  <martin@ximian.com>
7251
7252         * typemanager.cs
7253         (TypeManager.IsEqual): Moved the gmcs implementation here.
7254         (TypeManager.DropGenericTypeArguments): Likewise.
7255         (TypeManager.DropGenericMethodArguments): Likewise.
7256         (TypeManager.GetTypeArguments): Moved here from gmcs.
7257         (TypeManager.HasGenericArguments): Likewise.
7258
7259 2006-09-19  Martin Baulig  <martin@ximian.com>
7260
7261         * expression.cs (Binary): Merged with the gmcs version.
7262
7263 2006-09-19  Martin Baulig  <martin@ximian.com>
7264
7265         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7266
7267 2006-09-19  Martin Baulig  <martin@ximian.com>
7268
7269         * typemanager.cs: Merged with the gmcs version.
7270
7271 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7272
7273         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7274         * driver.cs: Likewise.
7275
7276 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7277
7278         A fix for #79401
7279         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7280         only if parent type is class.
7281         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7282         update.
7283
7284 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7285
7286         * cs-parser.jay,
7287         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7288         keywords are used.
7289         * typemanager.cs(CSharpName): Converts NullType to null.
7290
7291 2006-09-15  Martin Baulig  <martin@ximian.com>
7292
7293         * typemanager.cs
7294         (TypeManager.GetMethodName): Added mcs implementation.
7295         (TypeManager.IsEqual): Likewise.
7296
7297         * ecore.cs
7298         (SimpleName.RemoveGenericArity): Added dummy implementation.
7299
7300         * pending.cs: Merged with the gmcs version.     
7301
7302 2006-09-15  Martin Baulig  <martin@ximian.com>
7303
7304         * statement.cs: Merge with the gmcs version.
7305
7306 2006-09-15  Martin Baulig  <martin@ximian.com>
7307
7308         * statement.cs (Switch): Merge with the gmcs implementation
7309         (without nullables), which is newer.
7310
7311 2006-09-15  Martin Baulig  <martin@ximian.com>
7312
7313         * statement.cs (Block.Variables): Make this public.
7314         (ToplevelBlock.Parameters): Make this a property.
7315         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7316
7317 2006-09-15  Martin Baulig  <martin@ximian.com>
7318
7319         * namespace.cs: Merge with the gmcs version.
7320
7321 2006-09-15  Martin Baulig  <martin@ximian.com>
7322
7323         * decl.cs (MemberName): Minor code cleanups.
7324
7325 2006-09-15  Martin Baulig  <martin@ximian.com>
7326
7327         * parameter.cs: Merge with the gmcs version.
7328
7329 2006-09-15  Martin Baulig  <martin@ximian.com>
7330
7331         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7332         and an error in mcs.
7333
7334 2006-09-15  Martin Baulig  <martin@ximian.com>
7335
7336         * flowanalysis.cs: Merged from GMCS; added the generics code into
7337         a `GMCS_SOURCE' conditional so we can share this file.
7338
7339 2006-09-08  Martin Baulig  <martin@ximian.com>
7340
7341         * typemanager.cs (TypeManager.interlocked_type): New public field.
7342         (TypeManager.int_interlocked_compare-exchange): New public field.
7343         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7344         enumerator types here and call InitGenericCoreTypes().
7345         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7346         after calling InitEnumUnderlyingTypes().
7347
7348         * rootcontext.cs
7349         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7350         `classes_second_stage'. 
7351
7352 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7353
7354         * assign.cs, ecore.cs, expression.cs: Share error message text.
7355         * class.cs (FieldMember.Define): Check for varible of static type.
7356         * driver.cs (LoadAssembly): Uses error output for errors.
7357         * statement.cs: Updated.
7358
7359 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7360
7361         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7362         type instance.
7363
7364 2006-09-07  Martin Baulig  <martin@ximian.com>
7365
7366         * driver.cs
7367         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7368
7369 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7370
7371         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7372         
7373 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7374
7375         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7376         #52019 and #79064, the use of the \uXXXX sequence in source code
7377         to represent unicode characters.
7378
7379 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7380
7381         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7382         support.
7383         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7384
7385 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7386
7387         * assign.cs: Catch attempts to assign to a method groups in += and
7388         report as 1656
7389
7390 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7391
7392         A fix for #79056
7393         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7394
7395 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7396
7397         * class.cs (Method.Define): Issue a warning when generic method looks like
7398         an entry point.
7399         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7400         as well.
7401
7402 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7403  
7404         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7405         looking for ctor.
7406         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7407         search all base interfaces as a member can be ambiguous.
7408         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7409         Constructor member type filter. 
7410         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7411         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7412         reporting for returned memberinfos.
7413         * report.cs: Updated.
7414         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7415         version to work on all runtimes.
7416         (TypeManager.RealMemberLookup): Removed members filtering.
7417
7418 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7419
7420         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7421         (PropertyExpr.EmitAssign): Likewise.
7422         * expression.cs (Indirection.EmitAssign): Likewise.
7423         (LocalVariableReference.EmitAssign): Likewise.
7424         (ParameterReference.EmitAssign): Likewise.
7425         (Invocation.EmitArguments): Likewise.
7426         (ArrayAccess.EmitAssign): Likewise.
7427         (IndexerAccess.EmitAssign): Likewise.
7428         (This.EmitAssign): Likewise.
7429         (ConditionalLogicalOperator.Emit): Likewise.
7430
7431         Fix #79026
7432         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7433         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7434         leave it in after returning it.
7435         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7436
7437 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7438
7439         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7440         message.
7441
7442 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7443
7444         Fix cs0146-3.cs and cs0146-4.cs.
7445         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7446         enclosing types don't depend on the current type.
7447
7448 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7449
7450         Fix #77963
7451         * class.cs (TypeContainer.DoDefineMembers): Use
7452         FindBaseMemberWithSameName on Parent, since we're interested in
7453         whether we hide inherited members or not.
7454         (FindBaseMemberWithSameName): Make slightly more robust.
7455
7456         Fix the non-generic testcase from #77396
7457         * decl.cs (DeclSpace.DeclContainer): Remove override.
7458
7459         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7460         declspaces for doppelgangers too.
7461         (UsingEntry): Implement IResolveContext.
7462         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7463         'this' as the resolve context.
7464         (LocalAliasEntry): Likewise.
7465
7466         Implement parts of #77403
7467         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7468         toplevel declaration space.  Each namespace declaration introduces
7469         a "partial" root declaretion space.
7470         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7471         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7472         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7473         from 'current_namespace.SlaveDeclSpace'.
7474         (namespace_declaration): Likewise.
7475         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7476         check.  It can't happen now.
7477         * decl.cs (DeclSpace.LookupType): Likewise.
7478         * driver.cs (MainDriver): Sanity check.
7479
7480 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7481
7482         * decl.cs (DeclSpace.FindNestedType): Remove.
7483         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7484         LookupTypeContainer to get the container of the nested type.
7485         * class.cs (TypeContainer.FindNestedType): Make non-override.
7486
7487 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7488
7489         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7490         * class.cs (TypeContainer.PartialContainer): ... here.
7491         (TypeContainer.AddBasesForPart): New helper.
7492         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7493         instead.
7494         * cs-parser.jay (current_class): Convert to DeclSpace.
7495         (struct_declaration, interface_declaration, class_declaration):
7496         Use AddBasesForPart instead of .Bases directly.
7497         * const.cs, iterators.cs: Update to changes.
7498
7499 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7500
7501         * class.cs (TypeContainer.AddMemberType): Rename from
7502         AddToTypeContainer.
7503         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7504         (AddTypeContainer): New.  Combine AddClassOrStruct and
7505         AddInterface.
7506         (AddPartial): Update.  Add 'is_partial' argument.
7507         * roottypes.cs: Update to changes.
7508         * cs-parser.jay (push_current_class): New helper for handling
7509         current_container and current_class.
7510         (struct_declaration, interface_declaration, class_declaration):
7511         Use it.
7512
7513 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7514
7515         * roottypes.cs: Rename from tree.cs.
7516
7517         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7518         * tree.cs (Tree, ITreeDump): Remove types.
7519         * rootcontext.cs (tree, Tree): Remove fields.
7520         (root, ToplevelTypes): New.
7521         * *.cs: Update to rename.
7522
7523         * tree.cs (Tree.RecordDecl): Remove.
7524         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7525         namespace here.
7526         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7527
7528 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7529
7530         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7531         DoFlowAnalysis and OmitStructFlowAnalysis here.
7532         (ec.With): Rename from WithUnsafe and generalize.
7533         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7534         (ec.WithFlowAnalyis): New.
7535         * ecore.cs, expression.cs, statement.cs: Update.
7536
7537 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7538
7539         * statement.cs (Block.ResolveMeta): Simplify slightly.
7540
7541         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7542         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7543         check_state to flags.
7544         (CheckState, ConstantCheckState): Update.
7545         (InUnsafe): New read-only property.
7546         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7547         arbitrary flags.
7548         (WithUnsafe): New helper similar to WithCheckState.
7549         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7550         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7551
7552 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7553
7554         Make comparisons use the same IL irrespective of whether they're
7555         in a 'checked' or 'unchecked' context: one of the issues in #78899
7556         * codegen.cs (EmitContext.CheckState): Make read-only property.
7557         (EmitContext.ConstantCheckState): Likewise.
7558         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7559         helper that implement a save/restore stack for CheckState
7560         values.  This is the only way to change check-state.
7561         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7562         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7563         (CheckedExpr.EmitBranchable): New forwarding method.
7564         (UnCheckedExpr): Likewise.
7565         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7566         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7567         (Checked.Resolve, checked.DoEmit): Likewise.
7568
7569 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7570
7571         * anonymous.cs: Cache the resolved anonymous delegate, and return
7572         this so that the ResolveTopBlock is only triggered once, not
7573         twice.
7574
7575         Currently we trigger ResolvetopBlock twice due to a first pass of
7576         argument check compatibility, and a second pass that does the
7577         actual resolution.   
7578         
7579 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7580
7581         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7582         modifiers.
7583         * rootcontext.cs (Reset): Add helper_classes.
7584
7585 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7586
7587         A fix for #78860
7588         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7589         correctly.
7590
7591 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7592
7593         * statement.cs (Lock): Handle expressions of type
7594         TypeManager.null_type specially.  Fixes #78770
7595
7596 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7597
7598         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7599         to an event.
7600
7601 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7604         for accessors as well.
7605         * ecore.cs (EventExpr): Add AccessorTable.
7606
7607 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7608
7609         A fix for #78738
7610         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7611         for CS0122 where appropriate.
7612         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7613         level attributes.
7614         (Filter): Assembly can be null in the case of top level attributes.
7615
7616 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7617
7618         A fix for #78690
7619
7620         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7621         is done at global level.
7622
7623 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7624
7625         A fix for #77002, Implemented TypeForwarder support.
7626
7627         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7628         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7629         * typemanager.cs (): Add type_forwarder_attr_type.
7630
7631 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7632
7633         * report.cs: Add CS0469 warning.
7634
7635 2006-06-21  Martin Baulig  <martin@ximian.com>
7636
7637         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7638         the `try'-block, so we also report CS0016 etc. there.
7639
7640 2006-06-21  Martin Baulig  <martin@ximian.com>
7641
7642         * delegate.cs
7643         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7644
7645 2006-06-21  Martin Baulig  <martin@ximian.com>
7646
7647         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7648         also report CS1686 for parameters.
7649
7650 2006-06-21  Martin Baulig  <martin@ximian.com>
7651
7652         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7653         instead of an error if the value is not implicitly convertible to
7654         the switch types; fixes #77964.
7655
7656 2006-06-21  Raja R Harinath  <rharinath@novell.com>
7657
7658         Fix #78673
7659         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7660         FieldBuilder is null.
7661
7662         Fix #78662
7663         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7664         'left' and 'right' before error-checking.
7665
7666 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
7667
7668         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7669         Fixed bug #78601.
7670         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7671         (FieldExpr.DoResolve): likewise.
7672         (PropertyExpr.InstanceResolve): likewise.
7673         (EventExpr.InstanceResolve): likewise. 
7674
7675 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
7676
7677         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7678         attribute applicable tests for attribute argument.
7679
7680 2006-06-02  Raja R Harinath  <rharinath@novell.com>
7681
7682         Fix #78079
7683         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7684         (Binary.OverloadResolve_PredefinedIntegral): New.
7685         (Binary.OverloadResolve_PredefinedFloating): New.
7686         (Binary.OverloadResolve_PredefinedString): New.
7687         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7688         Follow the standard more closely, and treat numeric promotions in
7689         terms of overload resolution.
7690         (Binary.CheckShiftArguments): Simplify.
7691
7692 2006-06-01  Raja R Harinath  <rharinath@novell.com>
7693
7694         * flowanalysis.cs (MyBitVector): Simplify representation.
7695         (MyBitVector.Clone): Avoid allocating BitArray.
7696         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7697         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7698         (*): Update.  Change all references to MyBitVector.And and
7699         MyBitVector.Or to &= and |=.
7700
7701 2006-05-29  Raja R Harinath  <rharinath@novell.com>
7702
7703         Fix cs0231-[34].cs.
7704         * cs-parser.jay (formal_parameter_list): Extend the pattern below
7705         to param arguments too.
7706
7707 2006-05-26  Miguel de Icaza  <miguel@novell.com>
7708
7709         * cs-parser.jay: Catch another parsing form for arglist being
7710         followed by other arguments.  Fixes #78313.
7711
7712 2006-05-24  Raja R Harinath  <rharinath@novell.com>
7713
7714         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7715         checking of out parameters to ...
7716         (FlowBranchingToplevel.Merge): ... here.
7717         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7718         set, propagate the origin upward, and only complain if there was
7719         no other error.
7720         (FlowBranchingException.AddContinueOrigin): Likewise.
7721         (FlowBranchingException.AddReturnOrigin): Likewise.
7722         (FlowBranchingException.AddGotoOrigin): Likewise.       
7723
7724 2006-05-23  Raja R Harinath  <rharinath@novell.com>
7725
7726         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7727         unreachable, skip it.
7728         (FlowBranchingException.Merge): Always propagate jumps, even if
7729         the finally block renders subsequent code unreachable.
7730
7731 2006-05-18  Raja R Harinath  <rharinath@novell.com>
7732
7733         Fix #77601
7734         * statement.cs (Goto.Resolve): Move responsibility for resolving
7735         'goto' to FlowBranching.AddGotoOrigin.
7736         (Goto.SetResolvedTarget): New.  Callback to set the
7737         LabeledStatement that's the target of the goto.
7738         (Goto.DoEmit): Use Leave instead of Br when crossing an
7739         unwind-protect boundary.
7740         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7741         LookupLabel and adjust to new semantics.
7742         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7743         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7744         Goto.SetResolvedTarget to update target.
7745         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7746         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7747         AddBreakOrigin & co.  Delay propagation until ...
7748         (FlowBranchingException.Merge): ... this.
7749
7750         * statement.cs (Block.Resolve): Always depend on flow-branching to
7751         determine unreachability.  Kill workaround that originally emitted
7752         only one statement after an "unreachable" label (see infloop in
7753         test-515.cs).
7754
7755         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7756         This is still "wrong", but anything better would probably need a
7757         multi-pass algorithm.
7758         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7759         usage vector.  Force current usage vector to be reachable, to
7760         optimistically signify backward jumps.
7761         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7762         detected.
7763         (FlowBranchingLabeled.Merge): New.  If no backward jump was
7764         detected, return the original salted-away usage vector instead,
7765         updated with appropriate changes.  Print unreachable warning if
7766         necessary.
7767         * statement.cs (Block.Resolve): Don't print unreachable warning on
7768         a labeled statement.
7769
7770 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
7771
7772         * driver.cs: Pass filename without path to AssemblyBuilder's 
7773         AddResourceFile. Fixes bug #78407.
7774
7775 2006-05-17  Raja R Harinath  <rharinath@novell.com>
7776
7777         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7778         * flowanalysis.cs (FlowBranchingLabeled): ... here.
7779         (FlowBranching.MergeChild): Overwrite
7780         reachability information from Labeled branchings too.
7781
7782 2006-05-16  Raja R Harinath  <rharinath@novell.com>
7783
7784         * statement.cs (Goto.Resolve): Merge jump origins here ...
7785         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7786
7787         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7788         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
7789         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
7790         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7791         here, ...
7792         * statement.cs (Goto.Resolve): ... not here.
7793         (Goto.Emit): Remove CS1632 check.
7794
7795 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
7796
7797         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7798         error message.
7799
7800 2006-05-11  Raja R Harinath  <rharinath@novell.com>
7801
7802         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7803         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7804         (FlowBranchingException.Label): Likewise.
7805
7806         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
7807         given value.
7808         (MyBitVector.Or): Use it to avoid losing information (Count).
7809         (FlowBranching.MergeOrigins): Likewise.
7810
7811         * flowanalysis.cs (UsageVector.IsDirty): Remove.
7812         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7813         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7814         (UsageVector.ToString): Simplify.
7815         (UsageVector.MergeSiblings): Move here from ...
7816         (FlowBranching.Merge): ... here.
7817         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7818         not a MyBitVector.
7819
7820 2006-05-10  Raja R Harinath  <rharinath@novell.com>
7821
7822         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7823         null bitvector is treated as all-true.
7824
7825         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7826         (MyBitVector): Rationalize invariants.  'vector != null' implies
7827         that we have our own copy of the bitvector.  Otherwise,
7828         'InheritsFrom == null' implies all inherited bits are true.
7829
7830 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
7831
7832         * statement.cs (LocalInfo): Add IsConstant.
7833         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7834         local variable for constants.
7835
7836 2006-05-09  Raja R Harinath  <rharinath@novell.com>
7837
7838         * flowanalysis.cs (MyBitVector.Empty): New.
7839         (MyBitVector): Don't allow InheritedFrom to be null.
7840         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7841         (UsageVector, FlowBranching): Update to changes.
7842
7843         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7844         recursion.  The 'Parent == null' condition isn't sufficient for
7845         anonymous methods.
7846         (FlowBranching.AddBreakOrigin): Likewise.
7847         (FlowBranching.AddContinueOrigin): Likewise.
7848         (FlowBranching.AddReturnOrigin): Likewise.
7849         (FlowBranching.StealFinallyClauses): Likewise.
7850         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7851         (FlowBranching.CheckOutParameters): Likewise.
7852         (FlowBranchingToplevel): Terminate all the above recursions here.
7853         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7854         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7855
7856         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
7857         toplevel block.
7858         (FlowBranchingToplevel): New.  Empty for now.
7859         (FlowBranching.MergeTopBlock): Update.
7860         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7861         branching for the anonymous delegate.
7862         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7863
7864         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7865         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7866         information at the start of the merge.  Reorganize.
7867
7868 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7869
7870         * class.cs (MethodData.Define): Method cannot implement interface accessor.
7871
7872 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7873
7874         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7875         to newly introduced ctor.
7876
7877         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7878         message to one place.
7879         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7880         global namespace.
7881
7882 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7883
7884         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7885
7886         * ecore.cs (Expression.ResolveAsConstant): Updated.
7887
7888         * statement.cs (ResolveMeta): Updated.
7889
7890 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7891
7892         * cs-parser.jay: __arglist cannot be used in initializer.
7893
7894 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7895
7896         A fix for #77879
7897         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7898         private types.
7899
7900 2006-05-05  Raja R Harinath  <rharinath@novell.com>
7901
7902         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7903         (LabeledStatement): Add 'name' parameter.
7904         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7905         (Block.AddLabel): Update to changes.
7906         * cs-parser.jay (labeled_statement): Likewise.
7907
7908         * flowanalysis.cs (BranchingType.Labeled): New.
7909         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7910         (FlowBranchingLabeled): New.  Does nothing for now, but will
7911         eventually handle 'goto' flows.
7912         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7913         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7914         that's terminated ...
7915         (Block.Resolve): ... here.
7916
7917         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7918         (UsageVector.MergeFinallyOrigins): Likewise.
7919         (FlowBranching.InTryOrCatch): Likewise.
7920         (FlowBranching.AddFinallyVector): Likewise.
7921         (FlowBranchingException): Update to changes.
7922
7923         Fix #78290
7924         * statement.cs (Return.Resolve): Move error checking to ...
7925         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7926         (FlowBranchingException): Handle return origins like break and
7927         continue origins.
7928         (FlowBranching.UsageVector.CheckOutParameters): Remove.
7929
7930 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7931
7932         A fix for #76122
7933         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7934         filter.
7935
7936 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7937
7938         A fix for #77543
7939         * class.cs (MethodData.Define): Do public accessor check only when method
7940         implements an interface.
7941
7942 2006-05-04  Raja R Harinath  <rharinath@novell.com>
7943
7944         Remove special handling of 'break'
7945         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7946         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
7947         (UsageVector.Break): Remove.
7948         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7949         reachability.
7950         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7951
7952         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7953         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
7954
7955 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7956
7957         A fix for #75726
7958         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7959         be the interface member.
7960
7961 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7962
7963         A fix for #60069
7964         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7965         for emitting small (int) values.
7966
7967 2006-05-03  Raja R Harinath  <rharinath@novell.com>
7968
7969         Fix #59427
7970         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7971         control-flow passes through the 'finally' after merging-in all the
7972         control-flows from 'try' and the 'catch' clauses.
7973
7974         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7975         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
7976         always true at the only non-recursive entry point.
7977         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7978         FlowBranchingBreakable.
7979         (FlowBranchingLoop): Remove.
7980         * statement.cs (Return.DoResolve): Update to changes.
7981
7982         Fix #76471, #76665
7983         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7984         (FlowBranching.CreateBranching): Handle it: create a
7985         FlowBranchingContinuable.
7986         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7987         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7988         except that it handles the 'continue' command.
7989         (FlowBranching.UsageVector.MergeOrigins): Rename from
7990         MergeBreakOrigins.
7991         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7992         except that it overrides AddContinueOrigin.
7993         (FlowBranchingException): Override AddContinueOrigin, similar to
7994         AddBreakOrigin.
7995         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7996         Create a new branching around the embedded statement.
7997         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
7998         control flow after the embedded statement.
7999         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8000
8001         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8002         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8003         FlowBranchingBreakable.
8004         (FlowBranchingSwitch): Remove.
8005
8006         Fix test-503.cs
8007         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8008         error reporting to ...
8009         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8010         Rename from 'AddBreakVector'.  Add new location argument.  Return
8011         a bool indicating whether the 'break' crosses an unwind-protect.
8012         (FlowBranchingException.AddBreakOrigin): Add.
8013         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8014         flowbranching after updating with the effects of the 'finally'
8015         clause.
8016         (FlowBranchingBreakable): New common base class for
8017         FlowBranchingLoop and FlowBranchingSwitch.
8018
8019         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8020         embedded statement.
8021         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8022
8023 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8024
8025         * statement.cs (Do.Resolve): If the loop is infinite, set the
8026         barrier.
8027         (While.Resolve, For.Resolve): Set a barrier after the embedded
8028         statement.  There's no direct control flow that goes from the end
8029         of the embedded statement to the end of the loop.
8030         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8031         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8032         above ensure that the reachability is correctly computed.
8033
8034         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8035         (UsageVector.MergeBreakOrigins): If the current path is
8036         unreachable, treat it as if all parameters/locals are initialized.
8037         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8038         infinite loops before merging-in break origins.
8039
8040         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8041         (Reachability.Reachable): Split part into ...
8042         (Reachability.Unreachable): ... this.  Simplify.
8043         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8044
8045         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8046         (Reachability.SetThrowsSometimes): Likewise.
8047         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8048         TriState.Always, use corresponding property.
8049         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8050         (Block.Resolve): Likewise.  Remove some redundant checks.
8051
8052 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8053
8054         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8055         (Reachability.Meet): Don't bother checking AlwaysThrows --
8056         barrier is always set.
8057         (FlowBranchingBlock.Merge): Likewise.
8058
8059 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8060
8061         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8062         checks for unreachable.
8063
8064 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8065
8066         A fix for #77980
8067         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8068
8069         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8070         whether field is really assigned.
8071
8072 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8073
8074         * flowanalysis.cs (Reachability): Make 4-argument constructor
8075         private.
8076         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8077         (Reachability.Always): Rename from the highly misleading
8078         'Reachability.Never'.
8079         (FlowBranching.Merge): Update to changes.  Mark an impossible
8080         situation with a 'throw'.
8081         (*): Update to changes.
8082
8083 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8084
8085         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8086         Remove 'Undefined'.
8087         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8088         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8089         (*): Update to changes.
8090         * statement.cs: Update to changes.
8091
8092 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8093
8094         A fix for #78049
8095         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8096
8097 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8098
8099         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8100         dummy UsageVector.
8101
8102         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8103         argument to two arguments: an usage-vector and a bool.  Move call
8104         to FlowBranching.Merge () ...
8105         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8106
8107         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8108         handling of loop and switch reachability to ...
8109         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8110
8111 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8112
8113         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8114         handling to FlowBranchingLoop.InLoop.
8115         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8116
8117 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
8118
8119         A fix for #78115
8120         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8121         anonymous method is allowed from AnonymousContainer here.
8122
8123         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8124
8125 2006-04-24  Raja R Harinath  <rharinath@novell.com>
8126
8127         Fix #78156
8128         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8129
8130 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
8131
8132         A fix for #49011.
8133         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8134         (DoubleConstant.Reduce): Ditto.
8135
8136 2006-04-23  Raja R Harinath  <rharinath@novell.com>
8137
8138         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8139         Remove 'lvalue_right_side' argument.  Move parts to ...
8140         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8141         (LocalVariable.DoResolveLValue): ... these.
8142
8143 2006-04-21  Raja R Harinath  <rharinath@novell.com>
8144
8145         Fix cs1655.cs
8146         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8147         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8148         (LocalVariableReference.DoResolveBase): Use it to implement new
8149         CS1655 check.
8150         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8151         (Argument.Resolve): Simplify.  Move CS1510 check ...
8152         * ecore.cs (Expression.ResolveLValue): ... here.
8153         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8154         (PropertyExpr.DoResolveLValue): Likewise.
8155         (FieldExpr.Report_AssignToReadonly): Likewise.
8156         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
8157         LValueMemberAccess or LValueMemberOutAccess on instance depending
8158         on it.
8159         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8160         DoResolve as appropriate.
8161
8162 2006-04-20  Raja R Harinath  <rharinath@novell.com>
8163
8164         Fix #75800
8165         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8166         implicit conversions on 'out' and 'ref' arguments.
8167
8168         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8169         improve clarity.  Remove dead code.
8170
8171         Fix #66031
8172         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8173         (Catch.Resolve): Resolve VarBlock if it exists.
8174
8175 2006-04-19  Miguel de Icaza  <miguel@novell.com>
8176
8177         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8178         twice, this was some residual code, the enumerator was emitted
8179         properly in the two branche of if later.
8180
8181 2006-04-19  Raja R Harinath  <rharinath@novell.com>
8182
8183         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
8184         cast is never an lvalue.
8185         (Cast.DoResolve, Cast.ResolveRest): Combine.
8186         (Argument.Emit): Simplify slightly.  Move 'Expr is
8187         IMemoryLocation' check ...
8188         (Argument.Resolve): ... here.
8189         (Argument.Error_LValueRequired): Remove.  Inline into only user.
8190
8191         Simplifications.  Fix cs0191-2.cs
8192         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8193         CS1649 and CS1651 to ...
8194         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
8195         the actual selection of the error code and message to a lookup
8196         table.  Add a dummy return value to simplify callsites.
8197         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8198         readonly fields of other instances of the same type.  Move CS0197
8199         warning from ...
8200         * expression.cs (Argument.Resolve): ... here.  Simplify code.
8201         Ensure that ec.InRefOutArgumentResolving is only set during LValue
8202         resolution of an out or ref argument.  The code simplification
8203         above uses this invariant.
8204
8205 2006-04-18  Raja R Harinath  <rharinath@novell.com>
8206
8207         Possibly fix #77752.  Fix cs1690-[4-7].cs.
8208         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8209         CheckMarshallByRefAccess.  Drop parameter.
8210         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
8211         warning.
8212         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8213         InstanceExpression.
8214         * report.cs (AllWarnings): Add CS1690.
8215         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8216         for ref access too.
8217         (LocalVariableReference.DoResolveBase): Update.
8218
8219 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8220
8221         * class.cs (MethodOrOperator): Moved common parts from method class.
8222         detect obsolete attributes.
8223         (Method.Define): Simplified as it reuses code from base.
8224         (Constructor.ValidAttributeTargets): Fixed issue found during
8225         refactoring.
8226         (Destructor.ValidAttributeTargets): Fixed issue found during
8227         refactoring.
8228         (Operator): Finished refactoring set off by #78020. Operator class is now
8229         ordinary method class.
8230
8231         * anonymous.cs: Updated.
8232
8233         * decl.cs (DeclSpace): Add IsGeneric
8234
8235 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8236
8237         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8238
8239 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8240
8241         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8242         detect obsolete attributes.
8243         (Method.CreateEmitContext): Moved to MethodOrOperator.
8244
8245 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8246
8247         A fix for #78048.
8248         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8249         customized exception to make crash detection easier.
8250         (MethodOrOperator): Started to work on new base class for methods and
8251         operators.
8252         (Method): Derives from MethodOrOperator.
8253         (Constructor.Emit): Emits its own attributes.
8254         (AbstractPropertyEventMethod.Emit): Ditto.
8255         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8256         patch.
8257         (Operator.Emit): It's temporary more tricky than should be.
8258         
8259         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8260
8261         * report.cs (InternalErrorException): Add ctor with inner exception.
8262
8263 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8264
8265         A fix for #76744.
8266         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8267         only not visible.
8268
8269 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8270
8271         A fix for #77916.
8272         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8273         array.
8274
8275 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8276
8277         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8278         attribute is present and Guid not.
8279         (Interface.ApplyAttributeBuilder): Ditto.
8280
8281         * attribute.cs: Add error message.
8282
8283 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8284
8285         A fix for #78020.
8286
8287         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8288         sources (it's composite) so hold them in extra array as they are used in
8289         Emit phase only. It worked in the previous versions by mistake.
8290         (Attribute.Emit): Emit attribute for more owners when exist.
8291
8292         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8293         it has now different behaviour.
8294
8295 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8296
8297         * constant.cs (Constant.IsDefaultInitializer): New method.
8298
8299         * class.cs: Updated.
8300
8301         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8302         re-initialize default values. It saves KBs almost for every assembly.
8303         Thanks Zoltan for the idea.
8304         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8305         (ArrayCreation.DoResolve): Resolve only once.
8306         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8307         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8308
8309 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8310
8311         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8312         From #77961.
8313
8314 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8315
8316         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8317         in an embedded statement too.
8318
8319 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8320
8321         Fix #77958
8322         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8323
8324 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8325
8326         A fix for #77966.
8327
8328         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8329         was not specified.
8330
8331         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8332
8333 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8334
8335         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8336         phase.
8337
8338         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8339         LocalTemporary change.
8340
8341         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8342         TypeContainer.
8343         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8344         initializers optimization.
8345         (ClassOrStruct.TypeAttr): Moved from modifiers.
8346         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8347         (FieldBase.ResolveInitializer): Resolves initializer.
8348         (FieldBase.HasDefaultInitializer): New property.
8349
8350         * cs-parser.jay: Removed message.
8351
8352         * expression.cs (CompilerGeneratedThis): New specialization.
8353
8354         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8355
8356 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8357
8358         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8359
8360 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8361
8362         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8363         be now EnumConstants only.
8364
8365 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8366
8367         * attribute.cs, driver.cs: Reset more caches.
8368
8369 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8370
8371         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8372
8373 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8374
8375         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8376         for easier reuse. Updated all overrides.
8377         (IntegralConstant): New base class for all integral constants.
8378         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8379         of the constant range, report custom error.
8380         (UIntConstant.Reduce): Fixed uint conversion.
8381
8382         * ecore.cs, literal.cs: Reduce updates.
8383
8384 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8385
8386         A fix for #75813.
8387
8388         * class.cs (Constructor.Define): Removed extra if for default ctors.
8389         A patch from Atsushi Enomoto.
8390
8391 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8392
8393         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8394         GetAttributableValue.
8395
8396         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8397         when required.
8398
8399         * convert.cs (ImplicitConversionRequired): Error message moved to
8400         DoubleLiteral.
8401
8402         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8403         automatic implicit conversion of an output value.
8404         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8405
8406         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8407         conversion.
8408         (TypeOf.GetAttributableValue): Add extra handling for object type.
8409
8410         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8411         special error message.
8412
8413 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8414
8415         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8416         InternalCall.
8417         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8418         compatible with MS runtime.
8419
8420 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8421
8422         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8423         attribute arguments here.
8424
8425         * class.cs (Indexer.Define): The check was moved to attribute class.
8426
8427 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8428
8429         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8430         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8431         easier.
8432
8433 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8434
8435         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8436         mcs to keep code differences small.
8437         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8438         * typemanager.cs (parameter_default_value_attribute_type): New.
8439         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8440         CS1908 check.
8441
8442 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8443
8444         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8445
8446 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8447
8448         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8449
8450         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8451         the blocks too.
8452
8453 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8454
8455         * doc-bootstrap.cs : fix build.
8456
8457 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8458
8459         * expression.cs (StringConcat.Append): Issue a warning when empty string
8460         is going to append.
8461
8462 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8463
8464         * assign.cs (CompoundAssign.ResolveSource): Removed.
8465
8466         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8467         clean up.
8468
8469         * class.cs (TypeContainer.FindMethods): Removed.
8470         (TypeContainer.CheckMemberUsage): Made static.
8471
8472         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8473
8474         * constant.cs (CheckRange): Removed unused type argument.
8475         (CheckUnsigned): Removed unused type argument.
8476
8477         * cs-parser.jay: Updated after MemberAccess clean up.
8478         Uses Length for empty string test.
8479
8480         * cs-tokenizer.cs: Uses Length for empty string test.
8481         (IsCastToken): Made static.
8482         (is_hex): Made static.
8483         (real_type_suffix): Made static.
8484
8485         * decl.cs (SetupCache): Made static.
8486         (OnGenerateDocComment): Removed unused ds argument.
8487
8488         * delegate.cs (VerifyDelegate): Removed unused argument.
8489
8490         * doc.cs: Uses Length for empty string test.
8491
8492         * driver.cs: Uses Length for empty string test.
8493
8494         * enum.cs (IsValidEnumType): Made static
8495
8496         * expression.cs (EnumLiftUp): Removed unused argument.
8497         (ResolveMethodGroup): Ditto.
8498         (BetterConversion): Ditto.
8499         (GetVarargsTypes): Ditto.
8500         (UpdateIndices): Ditto.
8501         (ValidateInitializers): Ditto.
8502         (MemberAccess.ctor): Ditto.
8503         (GetIndexersForType): Ditto.
8504
8505         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8506
8507         * iterators.cs: Updated after MemberAccess clean up.
8508
8509         * location.cs: Uses Length for empty string test.
8510
8511         * namespace.cs: Uses Length for empty string test.
8512
8513          * report.cs (CheckWarningCode): Made static.
8514
8515         * statement.cs (LabeledStatement): Removed unused argument.
8516
8517         * typemanager.cs (FilterNone): Removed.
8518
8519 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8520
8521         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8522         obsolete.
8523
8524         * class.cs: Updated.
8525
8526 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8527
8528         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8529
8530 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8531
8532         A fix for #77822.
8533
8534         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8535         reporting, it's more tricky than I thought.
8536
8537 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8538
8539         A fix for #77816.
8540
8541         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8542         host container.
8543         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8544         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8545         Add more error reporting; Fixed issue with params.
8546
8547         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8548
8549         * cs-parser.jay: AnonymousMethod requires host container.
8550
8551         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8552
8553 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8554
8555         * class.cs: Change 'TypeContainer ds' constructor argument to
8556         'DeclSpace parent'.  Some classes were missed below due to
8557         different naming convention.
8558
8559         * class.cs (MemberCore.Parent): Delete.  This makes the
8560         ParentContainer changes below enforceable by the compiler.
8561
8562         Treat pointers to enclosing declaration space as 'DeclSpace', not
8563         'TypeContainer'.
8564         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8565         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8566
8567         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8568         of TypeContainer.
8569         (Block.AddThisVariable): Likewise.
8570         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8571         (AbstractPropertyEventMethod.Emit): Likewise.
8572         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8573         (GetMethod.Define, SetMethod.Define): Likewise.
8574         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8575         (DelegateMethod.EmitMethod): Likewise.
8576
8577         Fix regression test-partial-13.cs.
8578         Rationalize use of PartialContainer.  Ensure that the partial
8579         class semantics can be tied to type-correctness, i.e., any
8580         violation will cause a compile error.
8581         * class.cs, const.cs: Access all fields that belong to class
8582         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8583         Resolve()-like functions still use 'Parent'.
8584
8585         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8586         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8587         (PropertyMethod.CheckModifiers): Remove unused argument.
8588         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8589         DeclSpace.
8590
8591 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8592
8593         Make semantics of PartialContainer simpler.
8594         * decl.cs (DeclSpace.IsPartial): Remove.
8595         * class.cs (TypeContainer.IsPartial): Likewise.
8596         (TypeContainer..ctor): Set PartialContainer to point to self.
8597         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8598         (TypeContainer.FindNestedType): Likewise.
8599         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8600
8601 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8602
8603         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8604
8605 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8606
8607         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8608         classes.
8609
8610 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8611
8612         * class.cs (Operator.Define): An error for base conversion was not
8613         reported correctly.
8614
8615 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8616
8617         * iterator.cs : yield break is allowed in try statement which has
8618           catch clauses. Fixed bug #77767.
8619
8620 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8621
8622         A fix for #77593, #77574.
8623
8624         * class.cs (MethodCore.CheckBase): Another if for operator.
8625
8626 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8627
8628         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8629         were not resolved
8630
8631         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8632         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8633         conversion test.
8634         
8635         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8636         not needed.
8637
8638         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8639         Updated after another emitcontext usage was clean up. It should help us to
8640         synchronize with gmcs easier.
8641
8642 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
8643
8644         A fix for #77353.
8645
8646         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8647         (Event.Define): ditto
8648         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8649
8650         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8651         Removed redundant code and set NewSlot for Invoke method too.
8652
8653         * parameter.cs (Parameters.ctor): Add custom, type ctor.
8654         (Parameters.MergeGenerated): New method. Use this method when you merge
8655         compiler generated argument with user arguments.
8656
8657 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
8658
8659         * attribute.cs (ResolveAsTypeTerminal): Removed.
8660
8661         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8662         specialization for predefined types; 30% speed up.
8663         Finally placed obsolete check to right place.
8664         (Expression.ResolveType): Removed.
8665
8666         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8667         Updated after ResolveType was removed.
8668
8669         * expression.cs (Cast.ctor): Check void cast.
8670         (Binary.ResolveAsTypeTerminal): Is never type.
8671         (Conditional.ResolveAsTypeTerminal): Is never type.
8672
8673         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8674
8675 2006-03-01  Raja R Harinath  <rharinath@novell.com>
8676
8677         Fix #77679.
8678         * expression.cs (ParameterReference.DoResolveBase): Change return
8679         type to bool.
8680         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8681         Update.
8682
8683         Fix #77628.
8684         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8685
8686         Fix #77642.
8687         * typemanager.cs (GetFullNameSignature): Don't nullref on
8688         protected accessors.
8689
8690 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
8691
8692         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8693         these two separated members to simplify the code.
8694         (Attribute.Resolve): Refactored to use new fields and methods.
8695         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8696         implemented obsolete attribute checking.
8697         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8698         implemented obsolete checking again. It look line never ending quest ;-)
8699         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8700
8701         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8702
8703         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8704
8705         *class.cs (Property.Define): Add RegisterProperty call.
8706
8707         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8708         argument groups (only 2).
8709
8710         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8711         encoding expression to arguments.
8712         (Expression.ExprClassToResolveFlags): Just turned to property.
8713
8714         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8715         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8716         optimized as well as implemented support for zero-length attributes.
8717
8718         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8719         Add caching of PropertyInfo's.
8720
8721 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8722
8723         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8724         error multiple times.
8725
8726 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8727
8728         New partial class implementation.
8729         A fix for #77027, #77029, #77403
8730
8731         * attribute.cs (Attributable): Made attributes protected.
8732
8733         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8734         the replacements of ClassPart and PartialContainer.
8735         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8736         (TypeContainer.AddInterface): Ditto.
8737         (TypeContainer.AddPartial): The main method for partial classes. It checks
8738         for errors and merges ModFlags and attributes. At the end class is added to
8739         partial_parts list.
8740         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8741         required here.
8742         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8743         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8744         from the rest of partial classes.
8745         (TypeContainer.GetClassBases): Simplified.
8746         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8747         DefineType.
8748         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8749         (TypeContainer.HasExplicitLayout): Uses Flags now.
8750         (PartialContainer): Removed.
8751         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8752         (StaticClass): Was merged with Class.
8753         (Class.GetClassBases): class and static class bases are verified here.
8754         (Class.TypeAttr): Added static attributes when class is static.
8755         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8756         (MemberBase): In some cases we need to call parent container for partial
8757         class. It should be eliminated but it's not easy now.
8758
8759         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8760
8761         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8762         partial classed to accumulate class comments.
8763         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8764
8765         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8766
8767         * driver.cs (MainDriver): Tree.GetDecl was removed.
8768
8769         * modifiers.cs (Modifiers): Add partial modifier.
8770
8771         * tree.cs (Tree.decl): Removed.
8772         (RootTypes): Started to use this class more often for root types
8773         specializations.
8774
8775 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8776
8777         A fix for #77615
8778
8779         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8780         external interface does not have an attribute.
8781
8782 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8783
8784         Another prerequisites for new partial classs implementation.
8785         
8786         * attribute.cs (Attribute.Equal): Implemented.
8787         (Attribute.Emit): Changed as attributes can be applied more than twice.
8788         (Attributes.Emit): Check for duplicate attributes here.
8789
8790         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8791         as a parameter, clean-up.
8792
8793 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8794
8795         A fix for #77485
8796
8797         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8798         contains obsolete attribute check which can in some cases look for base
8799         type of current class which is not initialized yet.
8800         (TypeContainer.BaseType): Replacement of ptype.
8801
8802         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8803
8804 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8805
8806         First of prerequisites for new partial classs implemention.
8807         
8808         * attribute.cs (Attributable): Extended by ResolveContext;
8809         Attributes finally have correct context for resolving in all cases.
8810         (AttachTo): Attribute owner is assigned here.
8811
8812         * codegen.cs (IResolveContext): Introduce new interface to hold
8813         all information needed in resolving phase.
8814         (EmitContext): Implements IResolveContext; more clean-up needed here.
8815         
8816         * decl.cs (MemberCore): Implemented IResolveContext.
8817
8818         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8819         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8820         parameter.cs, statement.cs, tree.cs, typemanager.cs:
8821         Refactored to use new IResolveContext instead of EmitContext; cleanup
8822
8823 2006-02-06  Miguel de Icaza  <miguel@novell.com>
8824
8825         * codegen.cs (EmitScopeInitFromBlock): check here the
8826         capture_context, there is no need to make two calls to the
8827         EmitContext. 
8828
8829         * anonymous.cs: Add some debugging messages that might help me
8830         track other instances of this problem in the future (the
8831         regression of test 467).
8832
8833         * cs-parser.jay: track the variable block, as we need to initalize
8834         any captured variables declared in this block for the "catch"
8835         portion of the "Try" statement.
8836
8837         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8838         scope initialization for captured variables. 
8839
8840         Also, move the emit for the variables after the block location has
8841         been marked.
8842
8843 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
8844
8845         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8846
8847 2006-02-02  Miguel de Icaza  <miguel@novell.com>
8848
8849         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8850         commit yesterday, the initialization for the roots is necessary.
8851         What is not necessary is the scope activation.
8852
8853 2006-02-02  Raja R Harinath  <rharinath@novell.com>
8854
8855         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8856         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8857         CS0206 checks.
8858         (Argument.Resolve): Remove CS0206 checks.
8859
8860 2006-02-01  Miguel de Icaza  <miguel@novell.com>
8861
8862         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8863         scopes for all the roots, the scopes will now be emitted when the
8864         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
8865
8866         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8867         code.  This reduces a lot of existing cruft.
8868         
8869         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8870         that the ScopeInfo is generated as we enter the scope, not at the
8871         time of use, which is what we used to do before.
8872
8873         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8874         every time a Block is about to be emitted if we have a
8875         CaptureContext. 
8876
8877 2006-02-01  Raja R Harinath  <rharinath@novell.com>
8878
8879         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8880         (Reset): Update.
8881         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8882
8883         * typemanager.cs (cons_param_array_attribute): Make private.
8884         (Reset): Set it to null.
8885         (InitCoreHelpers): Don't initialize it.
8886         (ConsParamArrayAttribute): New.  Initialize it as needed.
8887         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8888
8889 2006-01-31  Miguel de Icaza  <miguel@novell.com>
8890
8891         * expression.cs: There might be errors reported during the
8892         selection of applicable methods.  If there are errors, do not
8893         continue execution as it will lead the compiler to crash.
8894
8895 2006-01-30  Miguel de Icaza  <miguel@novell.com>
8896
8897         * expression.cs: Member access is not allowed on anonymous
8898         methods.  Fixes #77402.
8899
8900 2006-01-30  Raja R Harinath  <rharinath@novell.com>
8901
8902         Fix #77401
8903         * cs-parser.jay (VariableDeclaration): Don't set
8904         current_array_type to null.
8905         (field_declaration, event_declaration, declaration_statement):
8906         Set it to null here.
8907
8908 2006-01-28  Raja R Harinath  <harinath@gmail.com>
8909
8910         * typemanager.cs (GenericParameterPosition): New.
8911         * doc.cs: Use it.
8912
8913 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
8914
8915         * doc.cs : To process "include" elements, first we should create
8916           another list than XmlNodeList, because it could result in node
8917           removal, which could result in that the XmlNodeList gives up
8918           yielding next node.
8919
8920           (Also made code identical to gmcs again.)
8921
8922 2006-01-25  Miguel de Icaza  <miguel@novell.com>
8923
8924         * ecore.cs: Introduce an error report that we were not catching
8925         before, if not silent, we must report the error.  Gonzalo ran into
8926         it.
8927
8928 2006-01-23  Miguel de Icaza  <miguel@novell.com>
8929
8930         A fix for bug: #76957
8931         
8932         * iterators.cs (MoveNextMethod.CreateMethodHost): call
8933         ComputeMethodHost before creating the method, this is a new
8934         requirement. 
8935
8936         * anonymous.cs (AnonymousContainer): Now we track all the scopes
8937         that this method references (RegisterScope).  The actual scope
8938         where the method is hosted is computed with the ComputeMethodHost
8939         before we create the method.
8940
8941         Moved the Deepest routine here.
8942
8943         (AnonymousContainer.ComputeMethodHost): New routine used to
8944         compute the proper ScopeInfo that will host the anonymous method.
8945
8946         (ScopeInfo): Deal with multiple roots.  The problem was that we
8947         did not have a unique root where all ScopeInfos could be hanged
8948         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
8949         of roots.  
8950
8951         Remove AdjustMethodScope which is now computed at the end.  Remove
8952         LinkScope which did a partial link, instead link all ScopeInfos
8953         before code generation from the new "LinkScopes" routine. 
8954
8955         Simplify all the Add* routines as they no longer need to maintain
8956         the tree, they just need to record that they are using variables
8957         from a ScopeInfo.
8958
8959         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8960         routines to produce the forest of ScopeInfo trees.
8961
8962         * class.cs (TypeContainer.AppendMethod): This is just like
8963         AddMethod, but ensures that an interface implementation method
8964         (IEnumerable.XXX) is not inserted at the beginning of the queue of
8965         methods, but at the end.
8966
8967         We use this functionality to ensure that the generated MoveNext
8968         method in the iterator class is resolved/emitted before the
8969         enumerator methods created.   
8970
8971         This is required because the MoveNext method computes the right
8972         ScopeInfo for the method.  And the other methods will eventually
8973         need to resolve and fetch information computed from the anonymous
8974         method. 
8975
8976 2006-01-21  Raja R Harinath  <harinath@gmail.com>
8977             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
8978
8979         Fix rest of #76995.
8980         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8981         the 'aliases' hash.
8982         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8983         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8984
8985 2006-01-18  Raja R Harinath  <rharinath@novell.com>
8986
8987         Fix #76656, cs0231-2.cs.
8988         * cs-parser.jay (formal_parameter_list): Make error case catch
8989         more issues.
8990         (parenthesized_expression_0): Add CS1026 check.
8991         (invocation_expression): Remove unused { $$ = lexer.Location }.
8992
8993 2006-01-17  Raja R Harinath  <rharinath@novell.com>
8994
8995         Fix #76824.
8996         * cs-parser.jay (statement_expression): Don't list out the
8997         individual statement-expressions.  Convert syntax error into
8998         CS0201 check.
8999
9000 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9001
9002         Fix #76874.
9003         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9004         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9005         CheckIntermediateModification.
9006         (FieldExpr.DoResolve): Add new two-argument version that
9007         allows us to resolve the InstanceExpression as an lvalue.
9008         The one-argument variant is now just a wrapper.
9009         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9010         Resolve the lhs as an lvalue if the it has a value type.
9011         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9012         from Assign.DoResolve.
9013         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9014         resolved as an lvalue.
9015         (PropertyExpr.DoResolve): Update.
9016         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9017         has a value type.  Move CS1612 check here from
9018         CheckIntermediateModification.
9019         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9020         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9021         'right_side' of a ResolveLValue on an 'out' argument.
9022         (EmptyExpression.LValueMemberAccess): New.  Used as the
9023         'right_side' of a propagated ResolveLValue on a value type.
9024         (LocalVariableReference.DoResolveBase): Recognize
9025         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9026         Add CS1654 check.
9027         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9028         EmptyExpression.Null.
9029
9030 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9031
9032         * typemanager.cs : added IsGenericParameter(). In mcs it always
9033           return false.
9034         * doc.cs : for generic parameters, use GenericParameterPosition,
9035           not FullName.
9036
9037 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9038
9039         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9040
9041 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9042
9043         This fixes the problem where we used ldfld instead of ldflda to
9044         load the "THIS" pointer on captured parameters, when THIS is a
9045         value type.  See bug #77205.
9046         
9047         * iterators.cs (CapturedThisReference.Emit): Pass false to
9048         EmitThis (we do not need the address).
9049
9050         * codegen.cs (EmitThis): it needs to know whether we need the
9051         address of `this' or not.  This is used by value types.  
9052
9053         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9054         every other call passes false.
9055
9056 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9057
9058         Fix #77221.
9059         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9060         GetOverride.
9061         * expression.cs (Invocation.OverloadResolve): Update.
9062         (Invocation.DoResolve): Avoid double resolution of invocation.
9063
9064 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9065
9066         Fix #77180.
9067         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9068         unary negation of floating point types as 0-expr; negation cannot
9069         overflow in floating point types.
9070
9071         Fix #77204.
9072         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9073         on operands of 'void' type.
9074
9075         Fix #77200.
9076         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9077         and ExclusiveOr for boolean constants too.
9078
9079 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9080
9081         Fix #75636.
9082         * expression.cs (Invocation.OverloadResolve): Replace reflected
9083         override methods with their base virtual methods, rather than
9084         skipping over them.
9085         * typemanager.cs (TypeManager.GetOverride): New.
9086
9087 2006-01-05  Jb Evain  <jbevain@gmail.com>
9088
9089         * class.cs (Property.Define, Indexer.Define): do not tag the
9090         properties as SpecialName | RTSpecialName.
9091
9092 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9093
9094         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9095         doing a low-level comparission of parameter types.  It was lacking
9096         a check for __argslist. 
9097
9098 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9099
9100         * expression.cs (ParameterReference.DoResolveBase): Allow
9101         reference parameters if they are local to this block. 
9102
9103         This allows the ref and out parameters of a delegate to be used in
9104         an anonymous method, for example:
9105
9106         delegate void set (out int x);
9107
9108         set s = delegate (out int x){
9109                 x = 0;
9110         };
9111
9112         This is used by functionality introduced late in the C# language.
9113         
9114         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9115         method that take ref and out parameters. 
9116
9117         Fixes #77119 which was a late change in the spec.
9118
9119 2005-12-23  Miguel de Icaza  <miguel@novell.com>
9120
9121         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9122         parent if its the same scope.  Fixes #77060.
9123
9124 2005-12-21  Miguel de Icaza  <miguel@novell.com>
9125
9126         * driver.cs: Report the case of no source files and no -out:
9127         argument provided.
9128
9129 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9130
9131         Fix #77035.
9132         * expression.cs (ComposedCast.GetSignatureForError): Define.
9133
9134 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9135
9136         Fix #76995
9137
9138         * namespace.cs (NamespaceEntry): Add extern_aliases as a
9139         ListDictionary, to contain the ExternAliasEntry entries (in
9140         addition to the NamespaceEntry.aliases hashtable). This field is
9141         shared between the original entry and its doppelganger (bodyless 
9142         copy of it).
9143         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9144         extern_aliases field.
9145         (NamespaceEntry.Lookup): Move the IsImplicit check after the
9146         lookup in extern_aliases.
9147
9148 2005-12-16  Raja R Harinath  <rharinath@novell.com>
9149
9150         Fix #77006.
9151         * class.cs (TypeContainer.Mark_HasEquals): New.
9152         (TypeContainer.Mark_HasGetHashCode): New.
9153         (ClassPart): Override them.
9154         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9155
9156         Fix #77008.
9157         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9158         'parent' argument to the base constructor.
9159
9160         Remove all mention of TypeContainer from decl.cs.
9161         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9162         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9163         (DeclSpace.DeclSpace): Likewise.
9164         (DeclSpace.DefineMembers): Remove unused argument.
9165         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
9166         debugging check -- we don't care if the debug code throws an
9167         InvalidCastException instead of an InternalErrorException.
9168         * class.cs (TypeContainer.DefineMembers): Update to changes.
9169         (TypeContainer.DoDefineMembers): Likewise.
9170         (TypeContainer.GetMethods): Likewise.
9171         (PropertyMember.Define): Likewise.
9172         (MemberBase.Parent): New property that forwards to
9173         MemberCore.Parent, but ensures that we get a TypeContainer.
9174         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9175         (RootContext.PopulateTypes): Likewise.  Remove special case code
9176         for !RootContext.StdLib: DefineMembers is idempotent.
9177
9178 2005-12-14  Miguel de Icaza  <miguel@novell.com>
9179
9180         * convert.cs (ExplicitConversionCore): Check the return value from
9181         ExplicitConversionCore which can return null on failure.  Fixes #76914
9182
9183 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
9184
9185         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9186
9187 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
9188
9189         * doc.cs : The search for referenced namespace was insufficient to
9190           get global one as it used to do. Fixed bug #76965.
9191
9192 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
9193
9194         * doc.cs : check name in cref in the last phase that whether it is
9195           namespace or not.
9196
9197 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9198
9199         * cs-tokenizer.cs : reverted the latest change: it somehow broke
9200           Mono.C5.
9201
9202 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9203
9204         * doc.cs : so it turned out that we cannot skip override check for 
9205           interface members. Fixed bug #76954.
9206
9207 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9208
9209         * cs-tokenizer.cs : fixed bug #75984:
9210           - #warning and #error should not be handled when the source line
9211             is disabled.
9212           - #line is not checked strictly when the source line is disabled.
9213           - #define and #undef is on the other hand checked strictly at any
9214             state.
9215
9216 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
9217
9218         * cs-tokenizer.cs : missing Location (actually, filename) in one of
9219           CS1027 report.
9220
9221 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9222
9223         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9224
9225         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9226         event initializers.
9227         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9228         (FieldBase.Initializer): Initializer is now optional.
9229         (EventField.Define): Only event field can have initializer.
9230
9231         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9232
9233         * const.cs (Const): Reuse initializer.
9234
9235         * cs-parser.jay: Updated after FieldBase changes.
9236         Added current_array_type to simplify array initializers.
9237
9238         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9239
9240         * expression.cs, iterators.cs: Updated.
9241
9242         * namespace.cs (NamespaceEntry): Made UsingFound private.
9243
9244 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9245
9246         * parameterCollection.cs: Obsolete, removed.
9247         * parser.cs: Obsolete, removed.
9248
9249 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9250
9251         Fix #76849.
9252         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9253
9254         * enum.cs (Enum.Define): Set obsolete context here.
9255
9256 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9257
9258         * doc.cs :
9259           - FindDocumentedMember() now expects 1) paramList as null
9260             when "we don't have to check the number of parameters" and
9261             2) Type.EmptyTypes when "there is no arguments".
9262           - Introduced FoundMember struct to hold the exact type which was
9263             used to find the documented member (the above change broke
9264             test-xml-044; it might be better just to use DeclaringType than
9265             what MS does, like this change does, but it depends on usage.)
9266
9267 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9268
9269         * doc.cs : documented member might be from DeclaringType for nested
9270           types. Fixed bug #76782.
9271
9272 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9273
9274         * anonymous.cs: Have the param code handle leaving copies on the
9275         stack etc. Allows anonymous params to take part in the assignment
9276         code (++, +=, etc). Fixes bug #76550
9277
9278         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9279         it down to the anon code.
9280
9281         * iterators.cs: Use dummy var here
9282
9283         * codegen.cs: Handle new vars
9284
9285 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9286
9287         Fix #76849.
9288         * class.cs (MethodData.Define): Set proper Obsolete context.
9289
9290         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9291         obsolete context.
9292         (FieldExpr.DoResolve): Ditto.
9293
9294 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9295
9296         Fix #76849.
9297         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9298         parent is not obsolete.
9299
9300 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9301
9302         * doc.cs : (FindDocumentedMember) find parameterless members first
9303           and get CS0419 in the early stage. Fixed first case of bug #76727.
9304
9305 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9306
9307         Fix #76859.
9308         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9309         no error was reported.
9310
9311         *expression.cs (Binary.DoResolve): left can be null.
9312
9313 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9314
9315         Fix #76783.
9316         * class.cs (MethodData.Emit): Parameters should be labeled first.
9317
9318 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9319
9320         Fix #76761.
9321         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9322
9323 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9324
9325         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9326
9327         * class.cs (MethodCore): Parameter clean up.
9328         (IMethodData): Added ParameterInfo.
9329         (MethodData): Parameter clean up.
9330         (Indexer.Define): Parameter clean up.
9331
9332         * anonymous.cs,
9333         * codegen.cs,
9334         * cs-parser.jay,
9335         * decl.cs,
9336         * doc.cs,
9337         * ecore.cs,
9338         * flowanalysis.cs,
9339         * iterators.cs,
9340         * pending.cs,
9341         * statement.cs,
9342         * typemanager.cs: Parameter clean up.
9343
9344         * delegate.cs (Define): Get rid of duplicated code.
9345
9346         * expression.cs (ParameterReference): Removed useless parameters
9347         and simplified.
9348         (Invocation): Ditto.
9349
9350         * parameter.cs (ParamsParameter): New class, params specialization.
9351         (ArglistParameter): Attemp to separate arglist.
9352         (Parameter): Refactored to be reusable and faster.
9353         (Parameter.Modifier): Made understandable.
9354         (Parameters): Changed to be used as a class for `this' assembly
9355         parameters. Refactored to use new specialized classes.
9356
9357         * support.cs (ParameterData): Added Types property.
9358         (InternalParameters): Deleted.
9359
9360 2005-08-20  Martin Baulig  <martin@ximian.com>
9361
9362         Merging this patch from GMCS to fix #75867.
9363
9364         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9365         scope if we don't already have it.
9366
9367 2005-11-17  Martin Baulig  <martin@ximian.com>
9368
9369         * anonymous.cs
9370         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9371         inherit the scope from our parent.  Fixes #76653.
9372
9373 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9374
9375         * doc.cs : the previous patch does not actually fix the bug.
9376           PropertyInfo override check is now implemented and really fixed it.
9377         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9378
9379 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9380
9381         * doc.cs : apply "override filter" also to properties.
9382           Fixed bug #76730.
9383
9384 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9385
9386         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9387           no need to check overrides. For classes, omit those results from 
9388           interfaces since they must exist in the class. Fixed bug #76726.
9389
9390 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9391
9392         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9393           with different parameters. Fixed the second problem in #76685.
9394
9395 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9396
9397         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9398           get expected 'protected' access in CheckValidFamilyAccess()).
9399           Fixed bug #76692.
9400
9401 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9402
9403         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9404           Fixed bug #76705.  CS1569 was incorrectly commented out.
9405
9406 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9407
9408         * doc.cs : use Invocation.IsOverride() to do real override check.
9409         * expression.cs : made Invocation.IsOverride() internal.
9410
9411 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9412
9413         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9414           TypeBuilder.FindMembers() and filter overriden base members out.
9415           Fixed bug #76990.
9416
9417 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9418
9419         * doc.cs : ref/out parameters are represented as '@' (instead of
9420           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9421
9422 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9423
9424         * doc.cs : when there was no '.' in cref to methods in doc comment,
9425           then parameters were missing in the output. Fixed bug #76691.
9426
9427 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9428
9429         * driver.cs : don't output docs when there is an error.
9430           Fixed bug #76693.
9431
9432 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9433
9434         * doc.cs :
9435           Now it should detect indexers. Fixed primary concern in bug #76685.
9436           Fixed CS0419 message to not show the identical member signature in
9437           the message.
9438
9439 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9440
9441         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9442           instead of Type.FindMembers() since it does not handle events.
9443           Fixed bug #71604.
9444
9445 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9446
9447         * codegen.cs: Fixed typo (speficied -> specified).
9448
9449 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9450
9451         Fix #76369.
9452         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9453
9454 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9455
9456         * attribute.cs: Changed error message.
9457
9458         * cs-tokenizer.cs: One more check.
9459
9460 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9461
9462         * statement.cs (Block.Resolve): Ignore empty statement.
9463
9464 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9465
9466         * report.cs: Made error/warning methods more strict to avoid
9467         their misuse.
9468
9469         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9470         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9471         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9472         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9473
9474 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9475
9476         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9477         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9478
9479         * class.cs (TypeContainer.IsComImport): New property.
9480         (Constructor.Define): Create proper ctor for ComImport types.
9481
9482         * expression.cs (New.CheckComImport): Fixed.
9483
9484 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9485
9486         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9487         that a parameter has been captured does not mean that we do not
9488         have to do the rest of the processing.  This fixes the second part
9489         of #76592.  If there was another anonymous method capturing
9490         values in the past, the Scope would never be set for the second
9491         method that captured the same parameter.
9492
9493         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9494         properly manipulate the stack.   Second part of fix for #76592.
9495
9496         * expression.cs (New): Add support for invoking "new" on
9497         interfaces that have been flagged with the ComImport attribute and
9498         the CoClass.  Fixes #76637 
9499
9500         * statement.cs (Try.DoEmit): When a variable is captured, do not
9501         try to emit the vi.LocalBuilder variable as it has been captured.
9502         Create a temporary variable and store the results on the
9503         FieldBuilder.  Fixes #76642
9504
9505 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9506
9507         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9508
9509         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9510
9511         * expression.cs (Binary.DoResolve): Added && optimalization.
9512     
9513         * typemanager.cs (AddUserType): Removed useless argument.
9514
9515 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9516
9517         * statement.cs (Block.variables): Uses ListDictionary.
9518
9519 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9520
9521         Fix #75969.
9522         * class.cs (PartialContainer.EmitType): Customized to emit
9523         security attributes.
9524         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9525         for partial classes.
9526
9527 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9528
9529         Fix #76599.
9530         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9531         access has to be fixed.
9532         
9533         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9534
9535 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9536
9537         Fix #76590.
9538         * ecore.cs (NullCast.Reduce): Implemented.
9539
9540         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9541         constant type.
9542         
9543         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9544         properly.
9545         (Foreach.Resolve): Catch null properly.
9546
9547 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9548  
9549         * cs-tokenizer.cs: Warning text fix.
9550
9551         * driver.cs: AllWarningNumbers exposed on public interface.
9552
9553         * report.cs (): Reviewed warning numbers.
9554         (IsValidWarning): Use binary search.
9555
9556 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9557  
9558         * driver.cs: Implemeted resource visibility.
9559         (Resources): New class for code sharing between /res: and
9560         /linkres:
9561  
9562 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9563
9564         Fix #76568.
9565         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9566         folding.
9567         
9568         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9569         contants only.
9570         
9571         * ecore.cs (NullCast): Child is contant only.
9572         
9573         * literal.cs (NullLiteral.Reduce): null can be converted to any
9574         reference type.
9575
9576 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9577
9578         * driver.cs: Use Encoding.Default as default code page instead
9579           of ISO-28591.
9580
9581 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9582
9583         Fix #76085.
9584         * expression.cs (Invocation.Error_InvalidArguments): Handle
9585         __arglist parameters.
9586         (Invocation.VerifyArgumentsCompat): Likewise.
9587         * support.cs (ReflectionParameters.GetSignatureForError): Print
9588         __arglist parameters.
9589         (InternalParamters.GetSignatureForError): Likewise.
9590         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9591
9592 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9593
9594         * attribute.cs (GetPropertyValue): Made public.
9595
9596         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9597         Resolve.
9598         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9599         attribute.
9600         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9601         is not defined.
9602         
9603         * driver.cs: Reflect method name change.
9604         
9605         * statement.cs (Try.Resolve): Warn when try has both general
9606         exception handlers.
9607         
9608         * typemanager.cs: runtime_compatibility_attr_type new predefined
9609         type.
9610
9611 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9612
9613         Fix #76419.
9614         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9615         treat it as an empty parameter list.
9616
9617 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9618
9619         Fix #76271.     
9620         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9621         ResolveAsTypeStep silent.
9622         * statement.cs (Block.AddConstant): Mark block as used.
9623         (Block.ResolveMeta): Avoid piling on error messages
9624         if a constant initializer resolution fails.
9625
9626 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9627
9628         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9629         Remove.
9630         (NamespaceEntry.VerifyAllUsing): New.
9631         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9632         behaviour.  Delegates actual resolution of alias to ...
9633         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9634         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9635         Update.
9636         * driver.cs (Driver.MainDriver): Update.
9637         
9638         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9639         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9640         property.
9641         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9642         Remove.
9643         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9644         RootNamespace.DefineNamespacesForAll.
9645
9646 2005-10-24  Raja R Harinath  <harinath@gmail.com>
9647
9648         * typemanager.cs (assemblies, external_aliases, modules)
9649         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9650         (ComputeNamespaces, GetRootNamespace): Remove extra staging
9651         overhead.  Move resposibility ...
9652         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
9653         * driver.cs, attribute.cs, codegen.cs: Update to changes.
9654
9655 2005-10-23  Raja R Harinath  <harinath@gmail.com>
9656
9657         * namespace.cs (RootNamespace.all_namespaces): Renamed from
9658         cached_namespaces.  Improve usage.
9659         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9660         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9661         Move from GlobalRootNamespace and simplify.
9662         (RootNamespace.Global): Make instance variable.
9663         (RootNamespace.RootNamespace): Add "alias name" parameter.
9664         (GlobalRootNamespace): Simplify drastically.
9665         (Namespace.Lookup): Don't use GetNamespace.
9666         * typemanager.cs (GetRootNamespace): Rename from
9667         ComputeNamespaceForAlias.
9668         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9669
9670 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9671
9672         * anonymous.cs (AnonymousContainer): Don't crash when container
9673         doesn't exist.
9674
9675 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9676
9677         * expression.cs (Binary.DoResolve): Warn when comparing same
9678         values.
9679
9680 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9681
9682         Fix #76486.
9683         * expression.cs (Binary.DoResolve): It looks like there are no
9684         convetsion rules in enum context.
9685
9686 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9687
9688         Add support for extern alias qualifiers.
9689         * typemanager.cs: Move some LookupTypeReflection code
9690         to namespace.cs, to have cleaner code. Added some methods
9691         to help us keep track of the extern aliased references.
9692         * driver.cs: Add suport for extern alias assemblies on command
9693         line and check for their warnings/errors. Also keep track of the
9694         extern aliased assemblies.
9695         * namespace.cs: Move the global functionality of Namespace
9696         to GlobalRootNamespace/RootNamespace. Now the global namespace
9697         is GlobalRootNamespace.Globa. Also the code moved from 
9698         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
9699         Finally added LocalAliasEntry (AliasEntry before) and
9700         ExternAliasEntry, to handle alias statements.
9701         * cs-parser.jay: Add support in the grammar for extern alias
9702         statement.
9703         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
9704         Update callings to Namespace (now in GlobalRootNamespace).
9705
9706 2005-10-18  Raja R Harinath  <rharinath@novell.com>
9707
9708         Fix #76371.
9709         * class.cs (TypeContainer.DefineType): Move updating of
9710         topological sort earlier in the code.
9711         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9712
9713 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
9714
9715         Fix #76273.
9716         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9717         
9718         * constant.cs (Constant.TryReduce): Moved from Cast class.
9719         (Reduce): Made little bit more OO and fixed missing conversions.
9720         
9721         * ecore.cs (Reduce): Implemented.
9722         (Binary.EnumLiftUp): New method to upgrade values to enum values.
9723         
9724         * literal.cs (Reduce): Implemented.
9725         
9726         * class.cs: Reverted Miguel's wrong commit.
9727
9728 2005-10-14  Miguel de Icaza  <miguel@novell.com>
9729
9730         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9731
9732 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
9733
9734         * cs-parser.jay, expression.cs : CS0214 was missing error location
9735           for constants. Fixed bug #76404.
9736
9737 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
9738
9739         Fix #76370.
9740         * convert.cs (ExplicitConversionCore): Fixed object->enum
9741         conversion.
9742
9743 2005-10-10  Raja R Harinath  <rharinath@novell.com>
9744
9745         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9746         InstanceExpression.
9747         (PropertyExpr.EmitCall): Likewise.
9748         * expression.cs (Invocation.EmitArguments): Handle case where
9749         arguments == null.
9750         (Invocation.EmitCall): Avoid allocating temporary variable if
9751         there are no arguments.
9752
9753 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9754
9755         Fix #76323.
9756         * convert.cs (ImplicitConversionStandard): Move conversion of
9757         void* to arbitrary pointer types ...
9758         (ExplicitConversionStandard): .. here.
9759         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9760         error to always print typenames.
9761
9762 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9763
9764         * convert.cs (GetConversionOperator): Rename from
9765         GetConversionOperators.  Move operator selection code from ...
9766         (UserDefinedConversion): ... here.
9767
9768 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
9769
9770         * convert.cs (ExplicitConversionCore): Removed duplicate enum
9771         conversion.
9772
9773 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
9774
9775         * assign.cs (Assign.DoResolve): Error method changed.
9776
9777         * cfold.cs (DoConstantNumericPromotions): Error method changed.
9778         
9779         * const.cs (ResolveValue): Reset in_transit immediately.
9780         
9781         * constant.cs: Error method changed.
9782         
9783         * convert.cs: Removed useless location parameter.
9784         (ExplicitNumericConversion): Don't do double enum check.
9785         (ExplicitConversionCore): Renamed from ExplicitConversion.
9786         (ExplicitUnsafe): Extracted from ExplicitConversion.
9787         (ExplicitConversion): Uses for error reporting.
9788         
9789         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9790         error messages.
9791         (ResolveBoolean): Uses common error method.
9792         (CastToDecimal): Get rid of ec.
9793         (CastFromDecimal): Optimized.
9794         (ConvCast): Get rid of ec.
9795         
9796         * enum.cs (ResolveValue): Reset in_transit immediately.
9797         (Emit): Return after first error.
9798         
9799         * expression.cs: Convert changes.
9800         
9801         * literal.cs: Error method changed.
9802         
9803         * statement.cs: Error method changed.
9804
9805 2005-10-03  Raja R Harinath  <rharinath@novell.com>
9806
9807         * support.cs (SeekableStreamReader.Position): Don't error out when
9808         the requested position is just beyond the end of the current
9809         buffered data.
9810
9811 2005-09-28  Raja R Harinath  <rharinath@novell.com>
9812
9813         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
9814         try to keep in sync with the byte count of the underlying Stream.
9815         However, this limits us to a window size of 2048 characters: i.e.,
9816         the maximum lookahead of our lexer/parser can be 2048 characters.
9817
9818 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
9819
9820         Fix #76255.
9821         * driver.cs: Fix compilation files with full root path.
9822
9823 2005-09-25  Miguel de Icaza  <miguel@novell.com>
9824
9825         * report.cs (SymbolRelatedToPreviousError): Format the output so
9826         it does not use an open parenthesis that is never closed. 
9827
9828         * driver.cs: Follow coding guidelines
9829
9830 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9831
9832         Fix #72930.
9833         * const.cs (Const.ResolveValue): Check for assigning non-null
9834         value to reference type.
9835
9836 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9837
9838         * anonymous.cs: Implemented ExprClassName.
9839         
9840         * assign.cs (Assign.DoResolve): Don't chrash when type is not
9841         delegate.
9842         
9843         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9844         check.
9845         
9846         * class.cs (StaticClass.DefineContainerMembers): Report protected
9847         members as error.
9848         
9849         * codegen.cs: if(ed) PRODUCTION.
9850         
9851         * convert.cs (Error_CannotImplicitConversion): Better error
9852         distinction.
9853         
9854         * cs-parser.jay: More error checks.
9855         
9856         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9857         
9858         * driver.cs (CSCParseOption): Enabled wrong option check.
9859         
9860         * ecore.cs (Expression.ExprClassName): Turned to property.
9861         (MemberExpr.CheckIntermediateModification): For checking boxed
9862         value types     modification.
9863         
9864         * statement.cs (Fixed.Resolve): Expression type must be
9865         convertible to fixed type.
9866         (CollectionForeach.GetEnumeratorFilter,TryType):
9867         Small refactoring for easier error checking.
9868
9869 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
9870
9871         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9872         attributes.
9873         
9874         * class.cs (GeneratedBaseInitializer): New class for customization
9875         compiler generated initializers.
9876         (MemberBase.DoDefine): Check Obsolete attribute here.
9877         (FieldMember.DoDefine): Ditto.
9878         
9879         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9880         constants.
9881         
9882         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9883         (MemberCore.GetObsoleteAttribute): Removed argument.
9884         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9885         (MemberCore.CheckObsoleteType): New helper.
9886         
9887         * delegate.cs,
9888         * enum.cs,
9889         * statement.cs: Updates after MemberCore changes.
9890         
9891         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9892         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9893         
9894         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9895         obsolete attribute for compiler construct.
9896         (As.DoResolve): Cache result.
9897         
9898         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9899
9900 2005-09-26  Raja R Harinath  <rharinath@novell.com>
9901
9902         Fix #76133.
9903         * expression.cs (This.VerifyFixed): In a value type T, the type of
9904         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
9905         value type R, 'this' is treated as a value parameter.
9906
9907 2005-09-22  Miguel de Icaza  <miguel@novell.com>
9908
9909         * statement.cs (Lock): Use the TemporaryVariable class instead of
9910         manually using local variables as those do not work when variables
9911         are captured.
9912
9913         * ecore.cs: Moved the TemporaryVariable class from being a nested
9914         class inside Foreach to be a public class that can be employed in
9915         other places. 
9916
9917 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
9918
9919         * cs-parser.jay: interface_accessors replaced by
9920         accessor_declarations.
9921
9922         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9923         location.
9924         
9925         * statement.cs (GotoCase.Resolve): Convert null constant to
9926         null case.
9927         (SwitchLabel.ResolveAndReduce): Ditto.
9928         (SwitchLabel.NullStringCase): Custom null stamp.
9929         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9930         
9931         typemanager.cs (CSharpSignature): Don't skip first argument
9932         for full names.
9933
9934 2005-09-18  Miguel de Icaza  <miguel@novell.com>
9935
9936         * driver.cs: Set InEmacs based on the environment variable EMACS. 
9937
9938         * location.cs (InEmacs): in this mode, do not report column
9939         location as it confuses Emacs.
9940
9941 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
9942
9943         * cfold.cs, constant.cs, convert.cs, ecore.cs,
9944         expression.cs, iterators.cs, literal.cs: Store constants and
9945         literals location.
9946         
9947         * class.cs (MemberBase.ShortName): Pass location.
9948         
9949         * cs-parser.jay: Some location fixes.
9950         
9951         * ecore.cs (Expression.Location): Made virtual.
9952
9953 2005-09-05  Miguel de Icaza  <miguel@novell.com>
9954
9955         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9956         if the underlying types are the same, otherwise we need to produce
9957         code that will do the proper cast.
9958
9959         This was exposed by Marek's constant rewrite which produced
9960         invalid code for the call site:
9961
9962         enum X : long { a }
9963         void Method (X v) {}
9964
9965         Method ((X) 5)
9966
9967         This fixes test-49.cs
9968
9969 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9970
9971         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9972           Type/Object should be allowed as well. Fixed bug #75968.
9973
9974 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9975
9976         * expression.cs : (Binary.DoResolve): when one is enum constant and
9977           another is constant 0, then return enum one *as enum type*.
9978           Fixed bug 74846.
9979
9980 2005-09-02  Raja R Harinath  <rharinath@novell.com>
9981
9982         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9983         internal.
9984
9985         Fix #75941.
9986         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9987         flow-branching for LocalVariableReferences in case we were invoked
9988         from a MemberAccess.
9989         * expression.cs (LocalVariableReference.VerifyAssigned): New.
9990         Carved out of ...
9991         (LocalVariableReference.DoResolveBase): ... this.
9992         (MemberAccess.Resolve): Do the check that was disabled during
9993         SimpleNameResolve.
9994
9995 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9996
9997         * class.cs :
9998           (PartialContainer.Create): check abstract/sealed/static strictly
9999           but abstract/sealed can exist only at one side. Fixed bug #75883.
10000
10001 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10002
10003         Fix #75945.
10004         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10005         specified, don't default to UnmanagedType.I4.
10006
10007 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10008
10009         * expression.cs : conditional operator should check possibly
10010           incorrect assign expression. Fixed bug #75946.
10011
10012 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10013
10014         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10015           Reverting the change. gmcs is much complex than mcs on this matter.
10016
10017 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10018
10019         * cs-tokenizer.cs : To read another token ahead of the actual 
10020           consumption, use new SavedToken and cache token instead of moving
10021           back the stream with SeekableStreamReader (it seemed problematic).
10022         * cs-parser.jay,
10023           driver.cs : Thus use StreamReader directly.
10024         * support.cs : Thus removed SeekableStreamReader.
10025
10026 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10027
10028         Fix #75934.
10029         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10030         (ScopeInfo.EmitScopeType): Use it to construct field names from
10031         names of captured locals.
10032
10033         Fix #75929.
10034         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10035         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10036         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10037         (ExplicitConversion): Remove enum cases already handled by
10038         implicit conversion.  Move implicit conversion check to the beginning.
10039         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10040         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10041         Don't treat System.Enum as a struct.
10042
10043 2005-08-30  Jb Evain  <jbevain@gmail.com>
10044
10045         * attribute.cs: handles as expression in parameters.
10046
10047 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10048
10049         Fix #75802.
10050         * class.cs (TypeContainer.VerifyClsName): Don't use a
10051         PartialContainer when verifying CLS compliance.
10052         (AbstractPropertyEventMethod): Set Parent here, ...
10053         (PropertyMethod): ... not here.
10054
10055 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10056
10057         * attribute.cs : escaped attribute name should not be allowed to be
10058           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10059
10060 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10061
10062         Fix #75927.
10063         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10064         when converting a long constant to unsigned long.
10065         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10066         detect where IsApplicable and VerifyArgumentsCompat disagree.
10067
10068 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10069         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10070
10071         Fix #75848.
10072         * class.cs (TypeContainer.CanElideInitializer): New helper.
10073         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10074         can safely emitting the initializer of a field.
10075
10076 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10077
10078         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10079           allowed inside a switch (without loop). Fixed bug #75433.
10080
10081 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10082
10083         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10084         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10085
10086 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10087
10088         * driver.cs : kinda reverting the default encoding changes (not exact 
10089           revert since I noticed that "codepage:reset" might not work fine).
10090
10091 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10092
10093         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10094           Location. Now getter and setter store location correctly.
10095           (errors/cs0111-12.cs now reports the expected location.)
10096
10097 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10098
10099         * driver.cs : Use default encoding on the environment.
10100           Removed (now that) extra parameter for SeekableStreamReader.
10101         * support.cs : (SeekableStreamReader) third .ctor() argument for
10102           StreamReader is not required (always true). preamble size could
10103           be acquired in simpler and safe way.
10104
10105 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10106
10107         * cs-parser.jay: report CS0642 at warning level 3
10108           and report CS0642 for an if else statement also
10109           fixes bug #74745. Patch by John Luke (and a bit
10110           modified by me).
10111           Removed extra CS0642 warning check for "while",
10112           "for" and "fixed".
10113         * statement.cs: In Block.Resolve(), CS0642 check
10114           is reimplemented to check a sequence of an empty
10115           statement and a block.
10116
10117           Both fix bug #66777.
10118
10119 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
10120
10121         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10122         detection until I fix it.
10123         
10124         * cs-tokenizer.cs: Changed error message.
10125         
10126         * cs-parser.jay: Fixed 2 error locations.
10127         
10128         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10129         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10130         properties.
10131         
10132         * enum.cs (GetSignatureForError): Fixed.
10133         
10134         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10135         method detection.
10136         
10137         * class.cs,
10138         * typemanager.cs (RegisterProperty): Removed.
10139         
10140         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10141
10142 2005-08-24  Raja R Harinath  <rharinath@novell.com>
10143
10144         Fix #75874.
10145         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10146         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10147
10148 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10149
10150         * expression.cs : tiny fix is required for not warning positive ulong.
10151           See test-441.cs.
10152
10153 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10154
10155         * expression.cs : add CS0652 check for constant and integral
10156           expression. Fixed bug #53974.
10157
10158 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10159
10160         * expression.cs : in DoNumericPromotions(), check if there is implicit
10161           conversion overload for string (to check CS0034). Fixed bug #52492.
10162
10163 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10164
10165         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10166
10167 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10168
10169         * ecore.cs : report location when it is *not* Null.
10170
10171 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10172
10173         * codegen.cs,
10174           ecore.cs,
10175           flowanalysis.cs,
10176           expression.cs:
10177           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10178           correctly. Fixed bug #75721.
10179
10180 2005-08-23  Raja R Harinath  <rharinath@novell.com>
10181
10182         * support.cs (SeekableStreamReader.Position): Avoid an expensive
10183         loop that performs 'min (pos, char_count)'.
10184
10185         Fix #75862.
10186         * expression.cs (Unary.ResolveOperator): Don't discard implicit
10187         converted value in Operator.OnesComplement.
10188
10189 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
10190
10191         * anonymous.cs: If the anon method is pulled into a helper class,
10192         it needs to be `internal' not `private'. Fixes runtime behavior on
10193         msft. bug #75704
10194
10195 2005-08-20  Martin Baulig  <martin@ximian.com>
10196
10197         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10198         scope if we don't already have it.
10199
10200         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10201         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10202         fixes #75867.
10203
10204 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
10205
10206         Fix #75803
10207         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10208         is a partial class.
10209
10210 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
10211
10212         The big constants rewrite
10213         Fix #75746, #75685 and more
10214         As a side effect saved 1MB for MWF ;-)
10215         
10216         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10217         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10218         enum based for corlib compilation.
10219         
10220         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10221         subtractions.
10222         
10223         * class.cs (FixedField.Define): Use ResolveAsConstant.
10224         
10225         * const.cs (IConstant): Interface constants and enums.
10226         (Const.ResolveValue): New method for constant resolvning.
10227         (ExternalConstant): Constants from imported assemblies.
10228         
10229         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10230         conversion; like enums.
10231         (Constant.ToType): Converts this constant to different type.
10232         (Constant.Increment): Adds 1.
10233         
10234         * convert.cs (ImplicitConversionRequired): Simplified.
10235         
10236         * cs-parser.jay: Create EnumMember directly.
10237         
10238         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10239         
10240         * doc.cs (GenerateEnumDocComment): Removed.
10241         
10242         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10243         (ConvertIntLiteral): Removed.
10244         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10245         
10246         * enum.cs (EnumMember): Implement IConstant.
10247         (Enum.IsValidEnumConstant): Removed.
10248         (Enum.GetNextDefaultValue): Removed.
10249         (Enum.FindMembers): Updated.
10250         (Enum.GenerateDocComment): Iterate enum members.
10251         
10252         * expression.cs (Cast.TryReduce): Handle enums correctly.
10253         (New.Constantify): Made public.
10254         (MemberAccess.DoResolve): Removed contant specific if(s).
10255         
10256         * literal.cs (NullLiteral): Implement new abstract methods.
10257         
10258         * statement.cs (GotoCase.Resolve): Use new constant methods.
10259         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10260         
10261         * typemanager.cs (LookupEnum): Removed.
10262         (IsEnumType): Fixed to work with corlib.
10263         (RegisterConstant): Removed.
10264         (LookupConstant): Removed.
10265         (GetConstant): Changed to work with IConstant.
10266
10267 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10268
10269         * location.cs : Fixed overflown (>255) column number.
10270
10271 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10272
10273         First cut of the qualified-alias-member feature.
10274         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10275         token.
10276         * cs-parser.jay (DOUBLE_COLON): New token.
10277         (namespace_or_type_name): Add rule for recognizing
10278         qualified-alias-members.
10279         (primary_expression): Likewise.
10280         (element_access): Allow QualifiedAliasMember as a possible
10281         type-bearing expression.
10282         (local_variable_type, local_variable_pointer_type): Likewise.
10283         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10284         aliases in the current and enclosing namespace declarations.
10285         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10286         * decl.cs (MemberName.is_double_colon): New.
10287         (MemberName.MemberName): Add new constructor for alias-member.
10288         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10289         * expression.cs (QualifiedAliasMember): New expression type.
10290
10291 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10292
10293         * location.cs : it borked when no argument was specified.
10294
10295 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10296
10297         * location.cs : tiny ToString() format fix.
10298
10299 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10300
10301         * statement.cs : oops, it was missing.
10302
10303 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10304
10305         A set of fixes for precise line/column location.
10306
10307         * location.cs :
10308           "token" field now holds a file/line "delta", a line number offset 
10309           from the segment, and a column number. See also:
10310           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10311           December/009508.html
10312           Removed static IsNull. Use instance IsNull property instead.
10313         * cs-tokenizer.cs :
10314           For some tokens it stores Location. For Identifier it stores
10315           LocatedToken which is a pair of string name and location.
10316           Column numbers are adjusted only at getChar().
10317         * report.cs :
10318           Use Location.ToString() for reporting (it now contains column).
10319         * cs-parser.jay :
10320           Largely modified to use LocatedToken instead of
10321           string (IDENTIFIER), and to acquire Location from some tokens.
10322         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10323           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10324           codegen.cs :
10325           Now MemberName holds Location. DeclSpace.ctor() receives Location
10326           as a parameter. Removed extra parameters to all derived classes.
10327           Replaced Location.IsNull() with instance property.
10328         * assign.cs, expression.cs :
10329           Added .ctor() overload that omits Location.
10330         * attribute.cs :
10331           Added "nameEscaped" flag that indicates the identifier was escaped
10332           in the source file. This fixes bug #57047.
10333
10334 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10335
10336         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10337         New method, looking for lo-case imported cls type.
10338
10339         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10340         here.
10341
10342         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10343
10344         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10345
10346         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10347         all_imported_types.
10348         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10349
10350         Optimized to save 3.5 MB for SWF compilation.
10351
10352 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10353
10354         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10355         (PartialContainer.Create): Moved logic AddToContainer.
10356         (PartialContainer.MarkForDuplicationCheck): Shares name.
10357         
10358         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10359         place.
10360         
10361         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10362         initialization.
10363         (Namespace.GetSignatureForError): New method.
10364         
10365         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10366         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10367
10368 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10369
10370         Fix #75669.
10371         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10372         member lookup rather than qualifier_type, since qualifier_type can
10373         be null.
10374
10375 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10376
10377         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10378         enum member.
10379
10380 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10381
10382         * statement.cs: Copy the local exception into the exception
10383         captured local.  Fixes 75674
10384
10385 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10386
10387         Fix #75658.
10388         * expression.cs (Invocation.OverloadResolve): Don't report error
10389         CS1501 if error CS1502 has been reported.
10390         (New.DoResolve): Delegate CS1501 reporting to
10391         Invocation.OverloadResolve.
10392
10393         Fix #75656.
10394         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10395         invariant-meaning-in-block property in an enclosing block if
10396         necessary.
10397
10398 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10399
10400         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10401         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10402         (Switch.CheckSwitch): Just save 50kb for SWF.
10403
10404 2005-07-27  Martin Baulig  <martin@ximian.com>
10405
10406         * anonymous.cs (CaptureContext.AddField): Added
10407         `AnonymousContainer am' argument; compute its toplevel scope if
10408         it's not already computed.  Fixes #75649.
10409
10410 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10411
10412         Fix #75628.
10413         * class.cs (Constructor.Emit): Reset block to null if the block
10414         resolve fails.
10415
10416 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10417
10418         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10419
10420 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10421
10422         * class.cs (MethodData.Define): Check whether accessor implementing
10423         interface is public.
10424
10425         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10426
10427 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10428
10429         Fix #57245
10430         * namespace.cs (LookupType): Moved same type check to...
10431         
10432         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10433         with the same name.
10434
10435 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10436
10437         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10438         already found a typebuilder.
10439         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10440         MemberNames, not strings.
10441
10442         * const.cs (Error_ExpressionMustBeConst): 
10443         Rename from Error_EpressionMustBeConst.
10444         * const.cs, class.cs, statement.cd: Update.
10445
10446 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10447
10448         Fix #65573
10449
10450         * const.cs (Const.LookupConstantValue): Report missing contant expression
10451         everytime.
10452         (Error_EpressionMustBeConstant): Only one error method.
10453
10454         * class.cs, statement.c: Updated.
10455
10456 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10457
10458         * statement.cs (Block.Flags): Add back HasVarargs.
10459         (Block.flags): Make protected.
10460         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10461
10462         * typemanager.cs (types, typecontainers, user_types): Remove.
10463         (UserTypes, TypeContainers): Likewise.
10464         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10465         (CleanUp, Reset): Update.
10466         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10467         (GetNestedType): Use Type.GetNestedType.
10468         (CoreLookupType): Take two arguments, the namespace and the
10469         basename of the type.  Update to use the Namespace.Lookup
10470         mechanism.
10471         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10472         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10473         string concatenation and substring matches.
10474         * class.cs, enum.cs, delegate.cs: Update to changes.
10475
10476 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10477
10478         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10479         Expression and made virtual.
10480
10481         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10482         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10483
10484         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10485
10486         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10487         error message.
10488
10489         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10490         change.
10491
10492 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10493
10494         Fix #57707
10495         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10496         AssemblyCultureAttribute is not used on executable.
10497
10498         * rootcontext.cs,
10499         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10500
10501 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10502
10503         Fix #60638.
10504         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10505         New.  Reports CS0252/CS0253.
10506         Mostly taken from preliminary patch by Duncak Mak.
10507         (Binary.DoResolveOperator): Store results of operator lookup.
10508         Use them to detect if we need to warn about unintended reference
10509         comparisons.
10510
10511 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10512
10513         Fix #72969.
10514         * namespace.cs (Namespace.Lookup): Add back location parameter.
10515         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10516         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10517
10518         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10519         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10520         (Namespace.LookupType): ... this.
10521         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10522         of namespaces.
10523         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10524         purported to handle pointers.
10525         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10526         CoreLookupType.
10527
10528 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10529
10530         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10531         type as namespace.
10532
10533 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10534
10535         * namespace.cs (Namespace.Lookup): Drop location parameter.
10536         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10537         (NamespaceEntry.Lookup): ... this.
10538         (NamespaceEntry.Error_AmbiguousTypeReference):
10539         Move here from DeclSpace.
10540         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10541         names ...
10542         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10543         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10544         Move to NamespaceEntry.
10545         * delegate.cs, expression.cs: Update to changes.
10546
10547 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10548
10549         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10550         CheckAttributeType and refactored.
10551         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10552         ResolveAsTypeTerminal error handling.
10553         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10554         handling.
10555         (GetSignatureForError): Print errors in same way.
10556
10557         * class.cs,
10558         * codegen.cs: Reflect attribute GetSignatureForError change.
10559
10560         * ecore.cs,
10561         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10562
10563         * namespace.cs (UsingEntry): Refactored to make fields private.
10564
10565         * assign.cs,
10566         statement.cs: Error_UnexpectedKind has extra parameter.
10567
10568 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10569
10570         * ecore.cs (IAlias): Remove.
10571         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10572         that implement the interface.
10573         * namespace.cs (Namespace): Likewise.
10574         (Namespace.declspaces): Renamed from 'defined_names'.
10575         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10576         DeclSpace instead of an IAlias.
10577         * tree.cs (Tree.AddDecl): Update.
10578
10579 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10580
10581         * statement.cs (Block.Flags); Remove HasVarargs.
10582         (Block.HasVarargs): Move to ToplevelBlock.
10583         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10584         (Block.Variables): Make protected.  Initialize variable hashtable
10585         if necessary.
10586         (Block.AddVariable): Update.
10587         (Block.Resolve): Update to changes.
10588         (ToplevelBlock.HasVarargs): New boolean.
10589         (ToplevelBlock.ThisVariable): Move here from Block.
10590         (ToplevelBlock.AddThisVariable): Likewise.
10591         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10592         * expression.cs (This.ResolveBase): Update to changes.
10593         (ArglistAccess.DoResolve): Likewise.
10594
10595 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10596
10597         Fix #75321
10598         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10599
10600         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10601         not used and not used & assigned.
10602         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10603
10604 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10605
10606         Fix #75053
10607         * expression.cs (Is.DoResolve): null is never provided type.
10608
10609 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10610
10611         Fix #52496
10612         * cs-parser.jay: Less strict event error rule to catch more errors.
10613
10614 2005-07-08  Martin Baulig  <martin@ximian.com>
10615
10616         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10617         gettter (allowed) or setter (not allowed).
10618
10619         * class.cs (Accessor): Implement IIteratorContainer.
10620         (Accessor.Yields): New public field.
10621         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10622         per-accessor basis.
10623
10624         * cs-parser.jay
10625         (get_accessor_declaration, set_accessor_declaration): Set the
10626         `yields' flag on the accessor, not the property.
10627         (property_declaration): Do the iterators check on a per-accessor
10628         basis and not for the whole property.
10629
10630 2005-07-08  Martin Baulig  <martin@ximian.com>
10631
10632         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10633         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10634
10635 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10636
10637         Fix #74975
10638         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10639         (ExtractSecurityPermissionSet): Cope with self referencing security
10640         attributes properly.
10641
10642         * driver.cs (SetOutputFile): Made public property OutputFile.
10643
10644 2005-07-07  Raja R Harinath  <rharinath@novell.com>
10645
10646         Fix #75486.
10647         * class.cs (TypeContainer.first_nonstatic_field): Rename from
10648         has_nonstatic_fields.  Make into a FieldBase pointer.
10649         (TypeContainer.AddField): Add CS0282 check.
10650         (TypeContainer.EmitType): Update.
10651
10652 2005-07-06  Miguel de Icaza  <miguel@novell.com>
10653
10654         * cs-tokenizer.cs (consume_identifier): Do not create strings to
10655         compare if they start with __.
10656
10657 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10658
10659         * statement.cs (Switch.SwitchGoverningType): Only look at
10660         UserCasts that don't need implicit standard conversions to one of
10661         the allowed switch types (Fixes test-322.cs).
10662         (LocalInfo.Resolve): Re-enable sanity-test.
10663
10664 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
10665
10666         * cs-tokenizer.cs (consume_identifier): Detect double undescores
10667         
10668         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10669         
10670         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10671
10672 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10673
10674         Fix #75472.
10675         * ecore.cs (SimpleName.GetSignatureForError): Add.
10676         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10677         (MemberAccess.GetSignatureForError): Add.
10678
10679 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
10680  
10681         The big error and warning messages review.
10682         
10683         * anonymous.cs,
10684         * assign.cs,
10685         * attribute.cs,
10686         * class.cs,
10687         * codegen.cs,
10688         * convert.cs,
10689         * cs-parser.jay,
10690         * cs-tokenizer.cs,
10691         * decl.cs,
10692         * delegate.cs,
10693         * doc.cs,
10694         * driver.cs,
10695         * ecore.cs,
10696         * enum.cs,
10697         * expression.cs,
10698         * flowanalysis.cs,
10699         * iterators.cs,
10700         * literal.cs,
10701         * location.cs,
10702         * modifiers.cs,
10703         * namespace.cs,
10704         * parameter.cs,
10705         * pending.cs,
10706         * report.cs,
10707         * rootcontext.cs,
10708         * statement.cs,
10709         * support.cs,
10710         * tree.cs,
10711         * typemanager.cs: Updated.
10712         
10713         * class.cs: (MethodCore.SetYields): Moved here to share.
10714         (PropertyMethod.Define): Moved iterator setup here.
10715         
10716         * iterators.cs: Add orig_method to have full access to parent
10717         container.
10718
10719 2005-07-05  Raja R Harinath  <rharinath@novell.com>
10720
10721         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10722         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10723         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10724         variable of struct type.
10725         * expression.cs (Unary.ResolveOperator): Update to change.
10726         (Indirection.VerifyFixed): Likewise.
10727         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10728         (ParameterReference.VerifyFixed): Value parameters are fixed.
10729         (This.VerifyFixed): Treat 'this' as a value parameter.
10730         * statement.cs (LocalInfo.IsFixed): Remove.
10731
10732 2005-07-01  Martin Baulig  <martin@ximian.com>
10733
10734         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10735         `ec.EmitThis ()' to get the correct scope.
10736
10737 2005-07-01  Martin Baulig  <martin@ximian.com>
10738
10739         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10740         instance is a ParameterReference; fixes #75299.
10741
10742 2005-07-01  Martin Baulig  <martin@ximian.com>
10743
10744         Reverted Marek's latest patch (r46725):
10745         - it contains structural changes which are neither mentioned in
10746           the ChangeLog nor explained anywhere; for example the additional
10747           argument of EmitContext's and Iterator's .ctor's and the
10748           TypeContainer.DefineMembers() change.
10749         - structural changes like this should go in in seperate patches
10750           and not be hidden in a huge patch which just seems to affect
10751           warnings and errors.
10752           a big and hard to understand patch.
10753         - it breaks iterators and causes regressions, for instance in
10754           test-iter-03.cs.      
10755
10756 2005-06-30  Raja R Harinath  <rharinath@novell.com>
10757
10758         Fix #75412.
10759         * expression.cs (Indexers.map): Remove.
10760         (Indexers.Append): Filter out inaccessible setters and getters.
10761         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10762
10763         Fix #75283.
10764         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
10765         Refactored from ...
10766         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10767         (FieldExpr.Emit, PropertyExpr.Emit): Update.
10768         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10769         * expression.cs (Invocation.EmitCall): Add CS0120 check.
10770
10771 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
10772
10773         Fix #75322
10774         * class.cs (FieldBase.GetInitializerExpression): One more field
10775         for backup.
10776
10777 2005-06-28  Miguel de Icaza  <miguel@novell.com>
10778
10779         * pending.cs: Do not define a proxy if the base method is virtual,
10780         it will be picked up by the runtime (bug 75270).
10781
10782 2005-06-08  Martin Baulig  <martin@ximian.com>
10783
10784         The big Iterators rewrite :-)
10785
10786         * iterators.cs: Rewrite this to use the anonymous methods framework.
10787
10788         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10789         before the TypeContainers; see 2test-21.cs.
10790
10791         * class.cs
10792         (TypeContainer.DefineType): Don't create a new EmitContext if we
10793         already have one (this only happens if we're an Iterator).
10794         (TypeContainer.Define): Also call Define() on all our iterators.
10795         (Method.CreateEmitContext): Added support for iterators.
10796
10797         * anonymous.cs
10798         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10799         (AnonymousContainer.CreateMethodHost): Moved here from
10800         AnonymousMethod and made abstract.
10801         (AnonymousContainer.CreateScopeType): New abstract method.
10802         (AnonymousContainer.IsIterator): New public property.
10803         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10804         get the ScopeTypeBuilder rather than manually defining it here. 
10805         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10806         iterators here.
10807
10808         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10809         before RootContext.DefineTypes().
10810
10811         * codegen.cs (EmitContext.RemapToProxy): Removed.
10812         (EmitContext.CurrentAnonymousMethod): Changed type from
10813         AnonymousMethod -> AnonymousContainer.
10814         (EmitContext.ResolveTopBlock): Protect from being called twice.
10815         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10816         (EmitContext.EmitThis): Removed the iterators hacks; use the
10817         anonymous methods framework for that.
10818
10819         * statement.cs
10820         (ToplevelBlock.Container): Make this a property, not a field.
10821         (ToplevelBlock.ReParent): New public method; move the
10822         ToplevelBlock into a new container.
10823         (Foreach.TemporaryVariable): Simplify.
10824
10825 2005-06-05  Martin Baulig  <martin@ximian.com>
10826
10827         * statement.cs (LocalInfo.CompilerGenerated): New flag.
10828         (Block.AddTemporaryVariable): New public method; creates a new
10829         `LocalInfo' for a temporary variable.
10830         (Block.EmitMeta): Create the LocalBuilders for all the temporary
10831         variables here.
10832         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10833         non-iterator variables.
10834
10835 2005-06-05  Martin Baulig  <martin@ximian.com>
10836
10837         * statement.cs (Foreach.TemporaryVariable): Create the
10838         LocalBuilder in the Emit phase and not in Resolve since in some
10839         situations, we don't have an ILGenerator during Resolve; see
10840         2test-19.cs for an example.
10841
10842 2005-06-04  Martin Baulig  <martin@ximian.com>
10843
10844         **** Merged r45395 from GCS ****
10845
10846         The big Foreach rewrite - Part II.
10847
10848         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10849         with `PropertyInfo ienumerator_getcurrent'.
10850
10851         * codegen.cs (VariableStorage): Removed.
10852
10853         * statement.cs
10854         (Foreach): Derive from Statement, not ExceptionStatement.
10855         (Foreach.CollectionForeach): New nested class.  Moved all the code
10856         dealing with collection foreach here.
10857         (Foreach.ForeachHelperMethods): Removed.
10858         (Foreach.TemporaryVariable): Implement IMemoryLocation.
10859
10860 2005-05-23  Martin Baulig  <martin@ximian.com>
10861
10862         * statement.cs (Try.DoResolve): Don't create a `finally' if we
10863         don't need to.  Fix #75014.
10864
10865 2005-05-20  Martin Baulig  <martin@ximian.com>
10866
10867         Merged r44808 from GMCS.
10868
10869         * class.cs (TypeContainer.CircularDepException): Removed.
10870         (TypeContainer.DefineType): Removed the `InTransit' stuff.
10871         (TypeContainer.CheckRecursiveDefinition): Check for circular class
10872         (CS0146) and interface (CS0529) dependencies here.
10873
10874 2005-06-21  Raja R Harinath  <rharinath@novell.com>
10875
10876         * expression.cs (Invocation.EmitCall): Fix initialization
10877         'this_call' to reflect current behaviour.  Fix indentation.
10878
10879         * convert.cs (FindMostEncompassedType): Add two trivial special
10880         cases (number_of_types == 0 || number_of_types == 1).
10881         (FindMostEncompasingType): Likewise.
10882
10883 2005-06-17  Raja R Harinath  <rharinath@novell.com>
10884
10885         Some cleanups preparing for the fix of #75283.
10886         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10887         error testing.
10888         (EventExpr.InstanceResolve): Likewise.
10889         (EventExpr.DoResolve): Remove redundant checks.
10890
10891 2005-06-10  Duncan Mak  <duncan@novell.com>
10892
10893         * cs-tokenizer.cs (process_directives): New flag for controlling
10894         the processing of preprocessor directives.
10895         (x_token): After seeing a '#', return Token.NONE instead of going
10896         to handle_preprocessing_directive() when not processing
10897         directives. This avoids unnecessary processing during the token peek in
10898         is_punct().
10899
10900         This fixes #74939.
10901
10902         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10903         the existing error reporting methods instead of Report.Error.
10904
10905         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10906         after Raja's rewrite.
10907
10908 2005-06-08  Miguel de Icaza  <miguel@novell.com>
10909
10910         * class.cs: Small fix.
10911
10912 2005-06-08  Raja R Harinath  <rharinath@novell.com>
10913
10914         Fix #75160.
10915         * class.cs (GetPartialBases): Fix return value check of
10916         part.GetClassBases.
10917
10918 2005-06-07  Raja R Harinath  <rharinath@novell.com>
10919
10920         Ensure that partial classes are registered in their enclosing
10921         namespace.  Initial part of fix of #75160.
10922         * tree.cs (Tree.RecordDecl): Add new namespace argument.
10923         Register declspace with namespace here, not in
10924         DeclSpace.RecordDecl.
10925         * cs-parser.jay: Pass namespace to RecordDecl.
10926         * class.cs (PartialContainer.Create): Likewise.
10927         (ClassPart.DefineType): New sanity-check.  Throws an exception if
10928         called.
10929         * decl.cs (Declspace.RecordDecl): Remove.
10930         * namespace.cs (NamespaceEntry.DefineName): Remove.
10931
10932 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
10933
10934         * rootcontext.cs: Reset TargetExt as well.
10935
10936 2005-06-03  Raja R Harinath  <rharinath@novell.com>
10937
10938         * ecore.cs (Expression.Resolve): Emit CS0654 error when
10939         -langversion:ISO-1.
10940
10941 2005-06-02  Raja R Harinath  <rharinath@novell.com>
10942
10943         Fix #75080, cs0119.cs.
10944         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
10945         of ...
10946         (Expression.Resolve): ... this.  Use it.  Remove bogus code
10947         allowing ExprClass.Type and ExprClass.Namespace for
10948         ResolveFlags.VariableOrValue.
10949         (Expression.Resolve) [1-argument variant]: Change default resolve
10950         flags based on language version.
10951         (Expression.Error_UnexpectedKind): Use a simple string array
10952         rather than an ArrayList.
10953         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10954         not ExprClass.Type.
10955         (TypeOfVoid.DoResolve): Likewise.
10956         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
10957         flags argument -- it always has the same value.
10958
10959 2005-05-31  Raja R Harinath  <rharinath@novell.com>
10960
10961         Fix #75081.
10962         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10963         Use it in the error message.
10964         * assign.cs, expression.cs, statement.cs: Update.
10965
10966 2005-05-30  Raja R Harinath  <rharinath@novell.com>
10967
10968         Fix #75088.
10969         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10970         the "almostMatchedMember" case too.
10971         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10972         that failed the accessibility checks to 'almost_match'.
10973
10974 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
10975
10976         * attribute.cs: Use internal MethodBuilder methods to set
10977         ExactSpelling and SetLastError on PInvoke methods, instead
10978         of passing them via charset.  Fixes #75060.
10979
10980 2005-05-27  Raja R Harinath  <rharinath@novell.com>
10981
10982         * parameter.cs (Parameter): Remove TODO comment.
10983         (Parameter.DefineParameter): Remove Location parameter.
10984         (Parameters.LabelParameters): Likewise.
10985         * class.cs (Constructor.Emit): Update to change.
10986         (MethodData.Emit): Likewise.
10987         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
10988         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10989
10990 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
10991
10992         * parameter.cs,
10993           Removed Parameters.Location and added Parameter.Location instead.
10994           Removed Location parameter from Emit() and GetSignature().
10995         * anonymous.cs,
10996           class.cs,
10997           cs-parser.jay,
10998           delegate.cs,
10999           iterators.cs,
11000           statement.cs :
11001           Modified all related calls.
11002
11003 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11004
11005         Improve user-defined conversion handling.
11006         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11007         applicable operators.
11008         (AddConversionOperators): New.  Helper for GetConversionOperators.
11009         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11010         there is only one most encompassed/encompassing type.
11011         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11012         "applicable operator" handling.
11013         (UserConversion): Move cache here from GetConversionOperators.
11014         Directly cache the chosen operator, rather than the whole
11015         MethodGroup.
11016         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11017         case.  Allow conversion of decimal to sbyte and byte too.
11018         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11019         New static methods.  Used to avoid allocating EmptyExpressions in
11020         convert.cs.
11021
11022 2005-05-24  Duncan Mak  <duncan@novell.com>
11023
11024         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11025         another class, used in Convert.ExplicitNumericConversion.
11026         (CastToDecimal): New class, similar to above, but casts to
11027         System.Decimal, used in Convert.ImplicitNumericConversion and also
11028         in explicit convesion from double/float to decimal.
11029
11030         * convert.cs (ImplicitNumericConversion): Handle implicit
11031         conversions to System.Decimal.
11032         (ExplicitNumericConversion): handle explicit conversions to
11033         System.Decimal.
11034
11035         This fixes #68711.
11036         
11037 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11038
11039         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11040         know the type at this stage, just break through.   Fixes #75008 
11041
11042 2005-05-19  Martin Baulig  <martin@ximian.com>
11043
11044         * delegate.cs
11045         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11046         to disable error reporting.
11047
11048         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11049         here since we don't want to report an error; see the new test-336.cs.
11050
11051 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11052
11053         * statement.cs (ToplevelBlock.GetParameterReference)
11054         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11055         Move here from class Block.
11056         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11057         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11058
11059 2005-05-18  Martin Baulig  <martin@ximian.com>
11060
11061         Fix #74978.
11062
11063         * flowanalysis.cs
11064         (FlowBranching.Reachability): Add non-static public And() and Or()
11065         methods.
11066         (FlowBranchingSwitch): New class; do the `break_origins' thing
11067         like in FlowBranchingLoop.
11068         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11069         reachability, not just locals and parameters.
11070         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11071         switch; MergeBreakOrigins() now takes care of that.
11072
11073 2005-05-18  Martin Baulig  <martin@ximian.com>
11074
11075         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11076         a loop and may leave it, reset the barrier; fixes #74974.
11077
11078 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11079         
11080         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11081         is back.
11082         
11083         * cs-parser.jay: Catch more lexical errors.
11084         
11085         * report.cs: Add one more Error method.
11086         
11087         * rootcontext.cs,
11088         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11089
11090 2005-05-17  Martin Baulig  <martin@ximian.com>
11091
11092         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11093         #70970. 
11094
11095 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11096
11097         Fix test-382.cs.  Emit values of decimal constants.
11098         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11099         Carved out of ...
11100         (TypeContainer.AddField): ... this.
11101         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11102         with initializers to include 'Const's.
11103         (ClassPart.RegisterFieldForInitialization): Forward to
11104         PartialContainer.
11105         * const.cs (Const.Const): Pass initializer to base class.
11106         (Const.Define): In case of decimal constants, register them for
11107         initialization in a static constructor.
11108
11109 2005-05-14  Martin Baulig  <martin@ximian.com>
11110
11111         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11112         do not call ResolveUnreachable() on unreachable statements in
11113         here, see the comment in the source code.
11114
11115 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11116
11117         Fix #74934.
11118         * expression.cs (BinaryResolveOperator): If one of the operands of
11119         an equality comparison is 'null' and the other is a pointer type,
11120         convert the null to a NullPointer.
11121         * convert.cs (ImplicitReferenceConversion): If the expression is a
11122         NullLiteral and the target type is a pointer type, return a
11123         NullPointer instead.
11124         (ImplicitConversionStandard): Likewise.
11125
11126 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
11127         
11128         * cs-parser.jay: Set readonly context based on special constructs.
11129         
11130         * expression.cs (LocalVariableReference.DoResolveBase): Improved
11131         readonly variable error handling.
11132         
11133         * rootcontext.cs (EmitCode): Don't verify members when error
11134         occurred.
11135         
11136         * statement.cs (LocalInfo): Add reaodnly context information.
11137         (SetReadOnlyContext, GetReadOnlyContext): New methods.
11138
11139 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11140
11141         * statement.cs (Block.Resolve): Revert change below.  Modify fix
11142         for #74041 to initialize 'resolved' to false only for explicit
11143         blocks.  Fixes #74873.
11144
11145 2005-05-12  Raja R Harinath  <harinath@gmail.com>
11146
11147         Fix #74920.
11148         * typemanager.cs (unmanaged_enclosing_types): New.
11149         (IsUnmanagedType): Avoid infloops by using
11150         'unmanaged_enclosing_types' to talk with recursive invocations.
11151
11152 2005-05-13  Martin Baulig  <martin@ximian.com>
11153
11154         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11155         instance variable, not a local.  Fix #74873.
11156         (Block.ResolveUnreachable): Set it to true here.
11157
11158 2005-05-11  Duncan Mak  <duncan@novell.com>
11159
11160         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11161         continuing to process for 'arg'.
11162         (handle_preprocessing_directive): Check the argument of the #endif
11163         directive and report error CS1025 if there are any trailing
11164         characters.
11165
11166         According to the C# spec, having even whitespace after the #endif
11167         directive is illegal; however, because we call arg.TrimEnd ()
11168         beforehand, we have the same behavior as csc, allowing whitespace
11169         after the directive.
11170
11171         Fixes #74892.
11172
11173 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
11174
11175         Fix #74863.
11176         
11177         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11178         (Constructor.GetObsoleteAttribute): Implemented correctly.
11179
11180 2005-05-10  Martin Baulig  <martin@ximian.com>
11181
11182         * support.cs (ReflectionParameters.ParameterModifier): Use
11183         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11184         and `ParameterAttributes.In'.  Fixes #74884.
11185
11186 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
11187
11188         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11189         
11190         * expression.cs (Argument.GetParameterModifier): Turned to property.
11191         (Invocation.Error_InvalidArguments): Add more descriptive errors.
11192         
11193         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11194         its C# equivalent.
11195         
11196 2005-05-09  Raja R Harinath  <rharinath@novell.com>
11197
11198         Fix #74852.
11199         * decl.cs (MemberCache.AddMethods): Register override methods,
11200         rather than non-override methods.
11201         * typemanager.cs (RegisterOverride): New.
11202         (IsOverride): Update.
11203
11204 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
11205
11206         Fix #73105.
11207         
11208         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11209         recursive declaration.
11210         
11211         * statement.cs (Block.ResolveMeta): Report any error in resolving.
11212         
11213 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
11214
11215         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11216         
11217         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11218
11219 2005-05-05  Raja R Harinath  <rharinath@novell.com>
11220
11221         Fix #74797.
11222         * decl.cs (DeclSpace.FamilyAccessible): 
11223         Use TypeManager.IsNestedFamilyAccessible.
11224
11225         Fix reopened #64812.
11226         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11227         internal'.
11228
11229 2005-05-04  Raja R Harinath  <rharinath@novell.com>
11230             Abin Thomas  <projectmonokochi@rediffmail.com>
11231             Anoob V E  <projectmonokochi@rediffmail.com>
11232             Harilal P R  <projectmonokochi@rediffmail.com>
11233
11234         Fix #64812.
11235         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11236         allow access to all static members.
11237
11238 2005-05-04  Martin Baulig  <martin@ximian.com>
11239
11240         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11241
11242 2005-05-04  Martin Baulig  <martin@ximian.com>
11243
11244         Fix #74655.
11245
11246         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11247         section at the end; make things work if `default' is not the last
11248         section.        
11249
11250 2005-05-04  Martin Baulig  <martin@ximian.com>
11251
11252         Fix #70400.
11253
11254         * statement.cs (Switch): Replaced the `got_default' field with a
11255         `default_section' one.
11256         (Switch.CheckSwitch): Set `default_section' here.
11257         (Switch.Resolve): If we're a constant switch and the constant is
11258         not found, use the default section.
11259
11260 2005-05-03  Martin Baulig  <martin@ximian.com>
11261
11262         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11263
11264         * statement.cs (Foreach.ArrayForeach): New nested class.
11265         (Foreach.TemporaryVariable): New nested class.
11266         (Foreach.EmitArrayForeach): Removed; this is now in the new
11267         ArrayForeach class.
11268
11269 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11270
11271         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11272         more conservative.
11273         (VerifyPendingMethods): Revert change below.
11274
11275         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11276         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11277         that used to trigger warning -28.  Remove warning -28.
11278         * expression.cs (Invocation.OverloadResolve): Use
11279         TypeManager.IsOverride to distinguish override methods.
11280
11281         Fix #74773.
11282         * pending.cs (VerifyPendingMethods): If a base type implements the
11283         requested interface, don't bother checking individual methods of
11284         the base type.  As a side-effect, this prevents the creation of
11285         unnecessary proxies.
11286
11287 2005-05-02  Martin Baulig  <martin@ximian.com>
11288
11289         Fix #70182.
11290
11291         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11292         Also `And' the locals if the old vector is null.
11293         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11294         null; in this case we basically reset all the variables.        
11295
11296 2005-05-02  Martin Baulig  <martin@ximian.com>
11297
11298         Fix #74529.
11299
11300         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11301         Added `FlowBranching branching' argument; always `and' the
11302         variables instead of `or'ing them unless we're an infinite loop.
11303
11304         * statement.cs (While.Resolve): Create a new sibling unless we're
11305         infinite.       
11306
11307 2005-05-02  Martin Baulig  <martin@ximian.com>
11308
11309         Fix #70140.
11310
11311         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11312         arguments; use it instead of creating a new TopLevelBlock.
11313         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11314         our ConstructorInitializer.
11315
11316         * statement.cs
11317         (TopLevelBlock.TopLevelBranching): New public property.
11318         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11319         and create our `TopLevelBranching'.
11320
11321         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11322         anonymous method host, use `block.TopLevelBranching' rather than
11323         creating a new branching.
11324
11325 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11326
11327         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11328         a ScopeInfo, if any of the current children is a child of the new
11329         entry, move those children there.
11330
11331 2005-04-30  Martin Baulig  <martin@ximian.com>
11332
11333         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11334         at the beginning of a SwitchSection.  Fix #73335.
11335
11336 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11337
11338         Fix #74378
11339         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11340         
11341         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11342         (FieldExpr.DoResolve): Obsolete members are ignored for field
11343         initializers.
11344         
11345 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11346
11347         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11348         of arrays detection.
11349
11350         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11351         verification.
11352         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11353
11354         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11355         arrays report.
11356
11357 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11358
11359         * cs-parser.jay: Use the prefered version of -unsafe in error
11360         message.
11361
11362 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11363
11364         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11365         circumstances.
11366
11367 2005-04-20  John Luke  <john.luke@gmail.com>
11368
11369         * driver.cs: fix typo in error message, --outout to --output
11370
11371 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11372
11373         * codegen.cs (InRefOutArgumentResolving): New field.
11374         
11375         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11376         fields outside contructor.
11377         
11378         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11379         
11380 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11381
11382         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11383         parameter code was not completed ever, so it was not as up-to-date
11384         as local variables.  Must finish it.
11385
11386         The bug fix was to compare the Toplevel of the block, not the
11387         current block.  Thanks for Ben for pointing this out. 
11388
11389 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11390
11391         * decl.cs (AddMethods): Use the declaring type of the problem
11392         method to determine if we want to squash a warning.
11393
11394 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11395
11396         * attribute.cs: Removed debug output.
11397
11398         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11399         
11400         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11401         Report.Stderr.
11402         
11403 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11404
11405         Fix #74481.
11406         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11407         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11408         all null comparisons against reference types.
11409
11410 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11411
11412         Fix# 74565
11413         * class.cs (TypeContainer.CircularDepException) New nested
11414         exception class.
11415         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11416         (TypeContainer.DefineType): Removed error, reset InTransit before
11417         exit.
11418         (Class.DefineType): Throw exception when is in Transit.
11419         Catch exception and report error.
11420         (Struct.DefineType): Throw exception when is in Transit.
11421         Catch exception and report error.
11422         (Interface.DefineType): Throw exception when is in Transit.
11423         Catch exception and report error.
11424
11425         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11426         handle nested exception handlers.
11427
11428         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11429         a catch.
11430
11431         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11432         InFinally and InCatch storage.
11433
11434         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11435         (Catch.Resolve): Set and Restore ec.InCatch.
11436         (Try.Resolve): Set and Restore ec.InFinally.
11437         (Try.HasCatch): True when try has catch.
11438
11439 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11440
11441         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11442           for the same event member, so exclude such cases from warning 419.
11443           Fixed bug #74633.
11444
11445 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11446
11447         * expression.cs (Binary.ResolveOperator): Apply patch from John
11448         Luke to fix bug 59864: operators &, | and ^ on enumerations
11449         require that the same enum type on both sides.
11450
11451         * driver.cs: Add warnings to old flag usage, this is to assist
11452         people who produce Makefiles and hope that the Makefiles will be
11453         used on Windows.
11454
11455         * class.cs (TypeContainer.EmitType): Moved the definition of the
11456         special $PRIVATE$ field from the resolve phase to the Emit phase.
11457         During resolve we do not know if we are a struct with
11458         HasExplicitLayout, we know this only after the attributes for the
11459         type are emitted.
11460
11461         Set the FieldOffset to zero on the dummy field that we create for
11462         the class.   Fixes 74590.
11463
11464 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11465
11466         Fix #73834.
11467         * ecore.cs (PropertyExpr.resolved): New.
11468         (DoResolve): Use it to handle a case of double resolution here.
11469         Handle a case of identical-name-and-type-name.
11470         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11471         resolution by storing the results of expression resolution back
11472         into the "probes" array.
11473
11474 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11475
11476         Fix cs0208-7.cs and cs0208-8.cs.
11477         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11478         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11479         error reporting to point out the reason a struct is not unmanaged.
11480
11481 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11482
11483         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11484           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11485
11486 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11487
11488         Fix #74528.
11489         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11490         IdenticalNameAndTypeName here.
11491         (EventExpr.InstanceResolve): Likewise.
11492
11493 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11494
11495         C# 2.0 DefaultCharSetAttribute implementation
11496         
11497         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11498         which allows us to set GlobalNamespace for every resolve.
11499         (Attribute.ResolveArguments): Cut from Resolve.
11500         (Attribute.GetCharSetValue): Returns CharSet named argument.
11501         (Attribute.DefinePInvokeMethod): Gets default charset from
11502         module settings.
11503         (GlobalAttribute.ResolveAsTypeStep): Override.
11504         (GlobalAttribute.ResolveArguments): Override.
11505         
11506         * class.cs (TypeAttr): Is protected.
11507         
11508         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11509         (ModuleClass.DefaultCharSetType): New memeber.
11510         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11511         
11512         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11513         charset from module.
11514         
11515         * delegate.cs (TypeAttr): Override.
11516         (Delegate.DefineType): Use this TypeAttr.
11517         
11518         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11519         at very early stage (before types are defined) to resolve model
11520         module attributes. It will probably not work with corlib but it
11521         should be ok.
11522         
11523         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11524         charset from module.
11525         
11526         * typemanager.cs (default_charset_type): New type.
11527
11528 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11529
11530         * decl.cs (MemberCache.AddMethods): Don't warn if
11531         System.Object.Finalize has buggy MethodAttributes.
11532
11533         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11534         removed below.
11535
11536 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11537
11538         * doc.cs : detect ambiguous reference to overloaded members.
11539           Fixed bug #71603. MS 1.1 csc does not detect it.
11540
11541 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11542
11543         * doc.cs : delegates must not be referenced with parameters.
11544           Fixed bug #71605.
11545
11546 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11547
11548         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11549
11550 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11551
11552         * driver.cs (MainDriver): Stop processing if the CLS stage found
11553         errors. 
11554
11555         (CompilerCallableEntryPoint.InvokeCompiler): Always
11556         reset after execution;   Take a TextWriter argument for the
11557         output.
11558
11559         * report.cs: Use the error stream instead of hardcoding stderr. 
11560
11561 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11562
11563         * class.cs: Reduce code paths to test, too small of an
11564         optimization to make it worth the extra testing.  Always perform
11565         it. 
11566
11567 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11568
11569         Fix #74510.
11570         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11571         operators that had errors reported on them.
11572
11573 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11574
11575         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11576         argument types.
11577         (Attribute.Resolve): Add named argument type checking.
11578         
11579         * class.cs (FixedField.Define): Use IsPrimitiveType
11580         
11581         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11582         
11583         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11584         unsafe parameter types.
11585         
11586         * statement.cs (Using.ResolveExpression): Add better error description.
11587         
11588         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11589         
11590 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11591
11592         Fix #74484.
11593         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11594         AttributeUsageAttribute in the emitcontext of the attribute class,
11595         not in the emitcontext of the attributable entity it was attached to.
11596         * cs-parser.jay: Use 'current_class', not 'current_container',
11597         when creating a GlobalAttribute.
11598
11599 2005-04-08  Alp Toker  <alp@atoker.com>
11600
11601         * pending.cs: The fix to #58413 failed to compile methods implementing
11602         interfaces with/without params modifiers and vice versa, even though
11603         params modifiers aren't part of the signature. Make the modifier check
11604         less strict as in csc.
11605
11606 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11607             Anoob V E  <projectmonokochi@rediffmail.com>
11608             Harilal P R  <projectmonokochi@rediffmail.com>
11609
11610         Fix #58413.
11611         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11612         modifiers of pending methods.
11613         (PendingImplementation.PendingImplementation): Initialize it.
11614         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11615         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11616         with ParameterData.  Add check for modifiers.
11617         * class.cs (MethodData.Define): Update to changes.
11618
11619 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11620
11621         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11622
11623 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11624
11625         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11626         property.
11627         
11628         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11629         
11630         * rootcontext.cs,
11631         * typemanager.cs: Registered RequiredAttributeAttribute.
11632         
11633 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11634
11635         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11636         Warning CS0169 is back at level 3.
11637         (IMethodData.SetMemberIsUsed): New method.
11638         
11639         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11640         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11641         
11642         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11643
11644         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11645         contants.
11646         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11647         is used.
11648         
11649         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11650         is used.
11651         
11652         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11653         to avoid the problems with nested types.
11654
11655 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
11656             Anoob V.E  <projectmonokochi@rediffmail.com>
11657             Harilal P.R  <projectmonokochi@rediffmail.com>
11658             Raja R Harinath  <rharinath@novell.com>
11659
11660         Fix #73820.
11661         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11662         attribute.
11663         * typemanager (GetConstructor): Make public.
11664
11665 2005-04-05  John Luke  <john.luke@gmail.com>
11666             Raja R Harinath  <rharinath@novell.com>
11667
11668         Fix #62232.
11669         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11670         struct too.  Return false quicker in a few cases.
11671         (VerifyUnManaged): Use it.
11672
11673 2005-04-05  Raja R Harinath  <rharinath@novell.com>
11674
11675         Fix #74041.
11676         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11677         not 'unreachable_seen'.
11678
11679 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
11680
11681         * attribute.cs (Attribute.GetValue): Removed unused.
11682         
11683         * codegen.cs (CodeGen.TrimExt): Removed unused.
11684         
11685         * cs-parser.jay (output): Removed unused.
11686         
11687         * cs-tokenizer.cs (hex_digits): Removed unused.
11688         
11689         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11690         
11691         * expression.cs (Indirection.LoadExprValue): Removed unused.
11692         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11693         
11694         * iterators.cs (Iterator.param_types): Removed unused.
11695         
11696         * statement.cs (Goto.block): Removed unused.
11697         (ToplevelBlock.did): Removed unused.
11698         (Switch.ResolveConstantSwitch): Removed unused.
11699
11700 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
11701
11702         * rootcontext.cs: Allow mcs to bootstrap with the compilation
11703         resetting thingy.
11704
11705 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11706
11707         Fix #74232 and cs0208-3.cs.
11708         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11709         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11710         unmanaged type.  Don't use FieldBuilders when 't' is a
11711         TypeBuilder.  Use ModFlags and MemberType fields.
11712         * class.cs (MemberBase.member_type): Rename from MemberType.
11713         (MemberBase.MemberType): New property.  Determines member_type on
11714         demand.
11715         (MemberBase.DoDefine): Don't initialize MemberType here.
11716         (FieldMember.Define): Likewise.
11717
11718 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
11719
11720         Fix #74241
11721         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11722         Attributes are emitted there.
11723         
11724 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11725
11726         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11727         keyword in 'partial enum' too.
11728         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11729         is not allowed).
11730         Report from Kamil Skalski <nazgul@omega.pl>.
11731
11732         Fix #74309.
11733         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11734         have partial containers too.
11735
11736         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11737         in block' checks to Block.CheckInvariantMeaningInBlock.
11738         * statement.cs (Block.GetKnownVariableInfo): Make private.
11739         (Block.IsVariableUsedInChildBlock): Remove.
11740         (Block.IsVariableUsedInBlock): Likewise.
11741         (Block.CheckInvariantMeaningInBlock): New.  Show location of
11742         conflicting declaration.
11743         (Block.AddVariable): Make error messages less long-winded and more
11744         specific.  Show location of conflicting declaration.
11745         * parameter.cs (Parameters.Location): New readonly property.
11746
11747 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11748
11749         Clean up semantics of invoking ResolveMemberAccess.
11750         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11751         can have an instance, ensure that we pass in a non-TypeExpression
11752         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
11753         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11754         argument.  Update to changes and simplify.
11755         (FieldExpr.Emitinstance): Remove CS0120 check.
11756         (PropertyExpr.EmitInstance): Likewise.
11757         * expression.cs (Argument.Resolve): Likewise.
11758         (Invocation.DoResolve): Update to changes in semantics of
11759         InstanceExpression.
11760
11761 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
11762
11763         Fix #74241
11764         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11765         customization.
11766         
11767         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11768
11769 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11770
11771         Fix difference in behaviour with commandline invocation.
11772         * driver.cs (Driver.Reset): New.
11773         (CompilerCallableEntryPoint): Call it.
11774
11775         * statement.cs (If.Resolve): Avoid spurious "uninitialized
11776         variable" warnings if the boolean expression failed to resolve.
11777
11778 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
11779
11780         * attribute.cs: Fix the union of several permissions when some of them
11781         are unrestricted (so the result isn't an unrestricted permission set).
11782         Fix #74036.
11783
11784 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11785
11786         * ecore.cs (MemberExpr): New class.  Convert from interface
11787         IMemberExpr.
11788         (MemberExpr.ResolveMemberAccess): Refactor and move here from
11789         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
11790         error checks.
11791         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11792         (MethodGroupExpr.IsExplicitImpl): Remove.
11793         (Expression.GetFieldFromEvent): Remove.
11794         (SimpleName.MemberStaticCheck): Remove.
11795         (SimpleName.DoSimpleNameResolve): Update to changes.
11796         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11797         (MemberAccess.IdenticalNameAndTypeName): Remove.
11798         (MemberAccess.error176): Move to MemberExpr.
11799         (MemberAccess.DoResolve): Update to changes.
11800         (BaseAccess.DoResolve): Likewise.
11801
11802 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
11803
11804         C# 2.0 Conditional attribute class implementation
11805         
11806         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11807         Analyzes class whether it has attribute which has ConditionalAttribute
11808         and its condition is not defined.
11809         
11810         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11811         (Class.IsExcluded): New method. Search for at least one defined
11812         condition in ConditionalAttribute of attribute class.
11813
11814 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11815
11816         * ecore.cs (PropertyExpr): Derive from Expression, not
11817         ExpressionStatement.
11818         (PropertyExpr.EmitStatement): Remove.
11819
11820 2005-03-29  Raja R Harinath  <rharinath@novell.com>
11821
11822         Fix #74060.
11823         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11824         internal field "value__" of an enum be private.  The examples for
11825         "value__" that I found on MSDN all used FieldAttributes.Private.
11826
11827         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11828         Don't mention IL method attribute names.
11829
11830         Fix #47991.  Remove a TODO.
11831         * statement.cs (Block.Toplevel): Make into a field.
11832         (Block.Parameters): Move into ToplevelBlock.
11833         (Block.known_variables): Rename from child_variable_names.
11834         (Block.Block): Remove variants that take Parameters.  Initialize
11835         'Toplevel' with the immediately surrounding toplevel block.
11836         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
11837         LocalInfo parameter.
11838         (Block.GetKnownVariableInfo): New.
11839         (Block.IsVariableNameUsedInChildBlock): Update.
11840         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
11841         the block, even though it may not be in scope.
11842         (Block.AddVariable): Remove Parameters parameter.  Use
11843         Toplevel.Parameters instead.
11844         (Block.AddConstant): Remove Parameters parameter.
11845         (Block.GetParameterReference): Update to use Toplevel.Parameters.
11846         (Block.IsParamaterReference): Likewise.
11847         (Block.IsLocalParameter): Likewise.  Simplify a lot.
11848         (ToplevelBlock.Parameters): New.  Moved from Block.
11849         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
11850         initialize Parameters to a non-null value.
11851         * cs-parser.jay: Update to changes.
11852         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11853         simple names that mean different things in the same block.  Use
11854         Block.IsVariableNameUsedInBlock.
11855
11856 2005-03-28  Raja R Harinath  <rharinath@novell.com>
11857
11858         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11859         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11860         GetTypeHandle.  It is possible for a reflected type to derive from
11861         a TypeBuilder (e.g., int[] derives from the TypeBuilder
11862         System.Array during mscorlib compilation).
11863         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11864         contain a method_hash, don't create one either.  Don't create a
11865         deep copy of the base cache's method_hash.
11866         (MemberCache.SetupCache): Rename back from DeepCopy.
11867         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11868         already initialized.  If we see an override function, add its
11869         underlying base virtual function to the member_hash too.
11870
11871         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11872
11873 2005-03-26  Raja R Harinath  <harinath@acm.org>
11874
11875         Fix #73038.
11876         * assign.cs (Assign.DoResolve): When the RHS of an assignment
11877         fails to resolve, ensure that the LHS is still resolved as an
11878         lvalue.
11879
11880 2005-03-25  Raja R Harinath  <harinath@acm.org>
11881
11882         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11883         ec.ContainerType.
11884         (Enum.current_ec): Remove.
11885         (Enum.LookupEnumValue): Remove EmitContext argument.
11886         Just uses the one created during DefineType.
11887         (Enum.FindMembers): Update.
11888         * expression.cs (MemberAccess.DoResolve): Update.
11889
11890 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
11891
11892         * assign.cs (Assign.DoResolve): Check for CS1717 when
11893         source and target are same (uses Equals).
11894
11895         * expression.cs (LocalVariableReference, ParameterReference,
11896         This): Implemented Equals, GetHashCode.
11897
11898         * statement.cs (Block.GetParameterReference): Removed useless
11899         local variable.
11900
11901 2005-03-22  Raja R Harinath  <rharinath@novell.com>
11902
11903         Fix cs0128.cs
11904         * statement.cs (Block.AddVariable): Ensure that we skip implicit
11905         blocks before deciding whether the error is cs0136 or cs0128.
11906
11907         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11908         (using_alias_directive, using_namespace_directive): Pass
11909         MemberName, not an expression to Namespace.UsingAlias and
11910         Namespace.Using.
11911         (MakeName): Use the MemberName of the namespace.
11912         * namespace.cs (Namespace.MemberName): New.
11913         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11914         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11915         Likewise.
11916         * decl.cs (MemberName.Name): Make readonly.
11917         (MemberName.FromDotted): New "constructor".
11918         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11919         (MemberCore.Name): Compute from MemberName on demand.
11920         (MemberCore.SetMemberName): Provide a way to change the
11921         MemberName.
11922         (MemberCore.AddToContainer): Don't take a fullname parameter.
11923         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11924         fully qualified name of the container to the member name.
11925         (TypeContainer.AddToTypeContainer): Use a fully qualified name
11926         only if the type is a member of the root container.
11927         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11928         MemberName.Left rather than searching for an embedded ".".
11929         (PartialContainer.CreatePart): Update to changes in RootContext.
11930         (MemberBase.ShortName): Turn into a property.  Use
11931         MemberCore.SetMemberName.
11932         (MemberBase.ExplicitInterfaceName): Remove.
11933         (MemberBase.UpdateMemberName): Remove.
11934         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11935         (PropertyBase.SetMemberName): New override.
11936         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11937         (Tree.GetDecl): New.
11938         (Tree.AllDecls): Rename from Decls.
11939         * attribute.cs, enum.cs, report.cs: Update to changes.
11940         * driver.cs (MainDriver): Use MemberName.FromDotted on
11941         RootContext.MainClass.
11942
11943 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
11944
11945         * class.cs (FixedField.Define): Check for CS1664 and more sanity
11946         checks.
11947
11948         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11949
11950 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
11951
11952         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11953         property accessor modifiers.
11954
11955         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11956         fixed buffer attribute (CS1716).
11957         (PropertyMethod.HasCustomAccessModifier): When property accessor
11958         has custom modifier.
11959
11960         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11961         modifiers.
11962         (PropertyExpr.DoResolveLValue): Add CS0272.
11963
11964 2005-03-17  Miguel de Icaza  <miguel@novell.com>
11965
11966         * convert.cs: When converting to a pointer, use the proper Conv.U
11967         or Conv.I depending on the source data type.
11968
11969         * cs-tokenizer.cs: Make the size for large decimal constants,
11970         fixes #72957.
11971
11972 2005-03-17  Martin Baulig  <martin@ximian.com>
11973
11974         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11975         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
11976
11977 2005-03-17  Martin Baulig  <martin@ximian.com>
11978
11979         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11980         to bool so we can return an error condition.
11981         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11982         returned an error.
11983
11984 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
11985
11986         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11987         attributes.
11988
11989 2005-03-16  Raja R Harinath  <rharinath@novell.com>
11990
11991         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11992         Refactor to avoid traversing the list of assemblies, and to avoid
11993         string concatenation.
11994         * typemanager.cs (guid_attr_type): Remove.
11995         (negative_hits, pointers, references): Remove hashes.
11996         (type_hash): New.
11997         (GetConstructedType): New.  Uses type_hash to handle constructed
11998         types (arrays, references, pointers).
11999         (GetReferenceType, GetPointerType): Use it.
12000         (GetNestedType): New.  Uses type_hash to handle nested types of
12001         reflected types.
12002         (LookupType, LookupTypeDirect): Remove.
12003         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12004         'types' hash and LookupTypeReflection directly.
12005         (params_string, params_object): Use GetConstructedType.
12006         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12007         top-level types.
12008         (Namespace.Lookup): Use cached_types.
12009         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12010         provided by old TypeManager.LookupType.
12011         * rootcontext.cs (MakeFQN): Remove.
12012         * decl.cs (DeclSpace.MakeFQN): Likewise.
12013         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12014         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12015         TypeManager.GetConstructedType.
12016         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12017
12018 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12019
12020         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12021         indexers.
12022
12023         * cs-parser.jay: Reports CS1527 for any namespace element.
12024
12025         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12026         Added CS0407.
12027
12028         * expression.cs (ParameterReference.IsAssigned): Changed error to
12029         CS0269.
12030         (Error_WrongNumArguments): Moved CS0245 detection here.
12031
12032         * statement.cs (Return.Resolve): Add CS1622 report.
12033
12034 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12035
12036         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12037
12038 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12039
12040         * attribute.cs expression.cs: Get rid of some allocations.
12041
12042 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12043
12044         * doc.cs : just eliminate the latest change.
12045
12046 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12047
12048         * doc.cs : commented out the latest change. It breaks xml-030.cs
12049
12050 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12051
12052         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12053           fail. So invoke CreateType() in FindDocumentedType().
12054
12055 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12056
12057         * cs-tokenizer.cs : added IsKeyword().
12058         * doc.cs : Detect keyword incorrectly used as identifier.
12059           Allow identifiers prefixed by @.
12060
12061 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12062
12063         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12064         It caused exception in namespace resolving (again!).
12065         
12066         * class.cs (Class.ctor): Removed exit.
12067         (PropertyMethod.ctor): ditto.
12068         
12069         * codegen.cs (Codegen.Reset): Reset static data.
12070         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12071         
12072         * cs-tokenizer.cs (Cleanup): Removed.
12073         
12074         * driver.cs (GetSystemDir): Rewrote to one line command.
12075         It caused problem with unloaded dynamic modules.
12076         (UnixParseOption): Removed Exit.
12077         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12078         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12079         Now can be mcs used as library.
12080         
12081         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12082         empty location.
12083         
12084         * location.cs (Reset): Reset static data.
12085         
12086         * namespace.cs (Reset): Reset static data.
12087         
12088         * report.cs (Report.Reset): Reset static data.
12089         
12090         * rootcontext.cs (RootContext.Reset): Reset static data.
12091         
12092         * tree.cs (RootTypes.ctor): Use Location.Null
12093         
12094         * typemanager.cs (TypeManager.Reset): Reset static data.
12095         (CoreLookupType): Removed Exit.
12096         (TypeHandle.Reset): Reset static data.
12097         
12098 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12099
12100         Fix #73516.
12101         * typemanager.cs (ComputeNamespaces): Import namespaces from
12102         referenced modules too.
12103
12104 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12105
12106         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12107         than '.'.
12108
12109 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12110
12111         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12112         enclosing DeclSpace.  This ensures that a name-lookup populates
12113         more caches and there are fewer 'TypeExpression's.  Carve out
12114         nested type lookup into ...
12115         (LookupNestedTypeInHierarchy): ... this.
12116
12117 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12118
12119         Clean up a few partial-class semantics.  
12120         Fixes test-357.cs and cs1618-2.cs.
12121         * cs-parser.jay (struct_declaration): Use 'current_class' as
12122         parent of newly-created struct.  Remove call to Register ().
12123         Use 'pop_current_class' to complete handing the current struct.
12124         (interface_declaration): Likewise.
12125         (class_declaration): Likewise.
12126         (enum_declaration): Use 'current_class' as parent of newly created
12127         enum.
12128         (delegate_declaration): Likewise.
12129         (pop_current_class): New function.  This is used to handle closing
12130         up the 'current_class' and 'current_container', and pointing them
12131         to the enclosing class/container.
12132         (CSharpParser): Initialize 'current_class' too.
12133         * decl.cs (MemberCore): Add check for invariant: a partial
12134         container is not a parsed entity, and thus does not enclose any
12135         parsed members.
12136         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12137         (DeclSpace.BaseTypeExpr): Use it.
12138         (DeclSpace.LookupType): Add check for invariant.
12139         * class.cs (TypeContainer): Add check for invariant: a nested
12140         class should have the same NamespaceEntry as its enclosing class.
12141         (TypeContainer.EmitFieldInitializers): Make virtual.
12142         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12143         MemberCore.
12144         (TypeContainer.Register): Remove.
12145         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12146         null.  Use TypeResolveEmitContext for resolving base types and
12147         interfaces.  Move initialization of Parts.TypeBuilder here from
12148         ...
12149         (TypeContainer.DefineNestedTypes): ... here.
12150         (PartialContainer): Take a Namespace not a NamespaceEntry.
12151         (PartialContainer.Create): Don't use Register.  Call the
12152         appropriate Add... function directly.
12153         (ClassPart): Take both the PartialContainer and the enclosing
12154         class as constructor arguments.
12155         (ClassPart.EmitFieldInitializers): Override.
12156         (ClassPart.PartFindNestedTypes): Remove.
12157         (FieldBase.GetInitializerExpression): Resolve the initializer
12158         expression in the emit context of the enclosing class.
12159         * tree.cs (RootTypes): Remove Register ().
12160         
12161 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
12162
12163         * cs-parser.jay: Removed CS0134.
12164         
12165         * driver.cs: Removed CS1901.
12166         
12167         * expression.cs (SizeOf.DoResolve): Don't report CS0233
12168         for predefined types.
12169
12170 2005-03-07  Duncan Mak  <duncan@novell.com>
12171
12172         * codegen.cs (Save):  Catch UnauthorizedAccessException as
12173         well. Fixes bug #73454.
12174
12175 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
12176
12177         * cs-tokenizer.cs (xtoken): Add CS1035.
12178         
12179         * class.cs (MethodData.Define): Add CS0683.
12180         (FieldMember.ctor): Add CS0681.
12181
12182 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12183
12184         * ecore.cs (SimpleName.DoResolve): Rename from
12185         SimpleName.DoResolveAllowStatic.
12186         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12187         Pass 'intermediate' flag to MemberStaticCheck.
12188         (SimpleName.MemberStaticCheck): Skip "static check" only in case
12189         of "intermediate" lookups via MemberAccess.
12190         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
12191         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12192
12193 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12194
12195         Fix #73394.
12196         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12197         slipped in because of variable names that are identical to a
12198         builtin type's BCL equivalent ('string String;', 'int Int32;').
12199         (PropertyExpr.EmitInstance): Likewise.
12200
12201 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
12202
12203         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12204         
12205         * report.cs (warning_ignore_table): Made public.
12206
12207 2005-03-04  Raja R Harinath  <rharinath@novell.com>
12208
12209         Fix #73282.
12210         * class.cs (MethodData.Emit): Pass 'container' to
12211         container.GetObsoleteAttribute instead of 'container.Parent'.
12212
12213 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
12214
12215         * cs-parser.jay: Add 1534 error test.
12216
12217         * iterators.cs (Yield.CheckContext): Add error 1629.
12218         (Iterator.ctor): Save unsafe modifier.
12219         (MoveNextMethod.DoEmit): Restore unsafe context.
12220
12221         * namespace.cs (UsingAlias): Better error message.
12222
12223 2005-03-03  Dan Winship  <danw@novell.com>
12224
12225         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12226         the warning message [#73219]
12227
12228 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12229
12230         Fix compile with MCS 1.0.0.0.
12231         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12232         w_restore to not depend on string constant folding.
12233
12234 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12235
12236         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12237         CS0246 check to users who passed 'silent = false'.
12238         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12239         check.
12240         (SimpleName.SimpleNameResolve): Update.
12241         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12242         (MemberAccess.IdenticalNameAndTypeName): Update.
12243         * doc.cs (FindDocumentedTypeNonArray): Update.
12244
12245 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12246
12247         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12248         * parameters.cs (ComputeAndDefineParameters): Remove.
12249         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12250         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12251         Use GetParameterInfo.
12252
12253 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12254
12255         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12256
12257 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12258
12259         Unify DeclSpace.LookupType and DeclSpace.FindType.
12260         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12261         is in charge of defining nested types on demand.
12262         (DeclSpace.LookupType): Use it when the current_type is a
12263         TypeBuilder.  Use LookupTypeDirect for reflected types.
12264         (DeclSpace.FindType): Remove.
12265         (DeclSpace.LookupInterfaceOrClass): Likewise.
12266         (DeclSpace.DefineTypeAndParents): Likewise.
12267         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12268         DeclSpace.LookupType.
12269         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12270         * typemanager.cs (LookupType): Simplify.
12271         (AddUserType): Remove type from negative_hits.
12272         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12273         * class.cs (TypeContainer.FindMembers): Move handling of nested
12274         types ...
12275         (TypeContainer.FindMembers_NestedTypes): ... here.
12276         (TypeContainer.FindNestedType): Implement override.
12277         (ClassPart.FindNestedType): Delegate to PartialContainer.
12278         (ClassPart.PartFindNestedType): Looks up the nested types of the
12279         part alone.
12280
12281 2005-03-02  Martin Baulig  <martin@ximian.com>
12282
12283         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12284         static constructor in static classes.
12285
12286 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12287
12288         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12289         sizeParamIndex is not specified.
12290
12291 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12292
12293         Fix #73117
12294         * report.cs (WarningMessage.IsEnabled): Missing null check.
12295
12296 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12297
12298         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12299         in the fields and not in the properties.
12300
12301 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12302
12303         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12304         fields as well.
12305
12306 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12307
12308         * attribute.cs: Small refactoring (improved robustness).
12309         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12310         (ValidateGuid): Removed.
12311         (Resolve): Removed referenced to above mentioned.
12312         (GetAttributeUsage): Made private and changed to work without
12313         class assistance.
12314         (GetIndexerAttributeValue): Don't crash.
12315         (GetConditionalAttributeValue): Ditto.
12316         (GetClsCompliantAttributeValue): Ditto.
12317         (ExtractSecurityPermissionSet): All attributes exceptions are
12318         error 648.
12319         (GetPropertyValue): New helper.
12320         (GetMethodImplOptions): New method.
12321         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12322         some missing properties.
12323         
12324         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12325         (Method.ApplyAttributeBuilder): Updated.
12326         
12327         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12328         exception.
12329
12330 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12331
12332         Fix #73052.
12333         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12334         non-simple types (array, pointer, reference).
12335
12336 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12337
12338         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12339
12340         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12341         for operators.
12342         (Method.CheckBase): Catch wrong destructor here.
12343         (MethodData.Define): Add errors 550, 668.
12344
12345         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12346
12347         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12348
12349         * pending.cs (VerifyPendingMethods): Add error 551.
12350
12351         * typemanager.cs (CSharpName): Next error report helper.
12352
12353 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12354
12355         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12356         attributes. Removed useless attribute double check.
12357         It saves almost 2MBs for corlib.
12358
12359 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12360
12361         Fix #72924.
12362         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12363         called twice in case of error.
12364
12365 2005-02-23  Chris Toshok  <toshok@ximian.com>
12366
12367         Fix compiler portions of #72827.
12368         * statement.cs (Block.Emit): call Begin/EndScope on the
12369         EmitContext instead of the ILGenerator.
12370
12371         * codegen.cs (EmitContext.BeginScope): new method, call
12372         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12373         we have one.)
12374         (EmitContext.BeginScope): same, but EndScope and CloseScope
12375
12376         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12377         offset and call the superclass's OpenScope(int) with it.
12378         (SymbolWriter.CloseScope): get the current il
12379         offset and call superclass's CloseScope(int) with it.
12380
12381 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12382
12383         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12384         CS1677 for out and ref as well.
12385
12386         * class.cs (Method.Define): Add error CS1599 detection.
12387         
12388         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12389         
12390         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12391         
12392         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12393         
12394         * support.cs.cs (ModifierDesc): New helper method.
12395
12396 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12397             Abin Thomas  <projectmonokochi@rediffmail.com>
12398             Anoob V E  <projectmonokochi@rediffmail.com>
12399             Harilal P R  <projectmonokochi@rediffmail.com>
12400
12401         Fix #57851, #72718.
12402         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12403         MemberLookup (used for error reporting) actually returns a result.
12404         Fix error report number (122, not 112).
12405
12406 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12407             Anoob V E  <projectmonokochi@rediffmail.com>
12408             Harilal P R  <projectmonokochi@rediffmail.com>
12409
12410         Fix #71134.
12411         * pending.cs (PendingImplementation.GetAbstractMethods):
12412         Find NonPublic members too.
12413
12414 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12415
12416         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12417         Fixed error 217.
12418         
12419         * class.cs (MethodCore.CheckMethodAgainstBase):
12420         Add error 239 report.
12421
12422 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12423
12424         Fix #68955.
12425         * expression.cs (Invocation.IsApplicable): Make public.
12426         (Invocation.IsParamsMethodApplicable): Likewise.
12427         * delegate.cs (Delegate.VerifyApplicability): Don't use
12428         Invocation.VerifyArgumentCompat for parameter applicability
12429         testing.  Use Invocation.IsApplicable and
12430         Invocation.IsParamsMethodApplicable.
12431
12432 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12433
12434         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12435         
12436         * class.cs (Operator.Define): Add error 217 report.
12437         
12438 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12439
12440         * namespace.cs (UsingEntry.Resolve): Undo change below.
12441
12442 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12443
12444         Fix #72756.
12445         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12446         disable the error message when the extended MemberLookup also
12447         fails.
12448         (Expression.MemberLookupFinal): Update.
12449         (SimpleName.DoSimpleNameResolve): Update.
12450         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12451         Don't use MemberLookupFinal.
12452         (New.DoResolve): Update.
12453         (BaseAccess.CommonResolve): Update.
12454
12455 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12456
12457         Fix #72732.
12458         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12459         occured previously, don't resolve again.
12460
12461 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12462
12463         Fix #69949
12464         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12465         argument. Call ResolveAttributeUsage for unresolved.
12466         when types doesn't match ctor arguments.
12467         
12468         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12469         for nested attribute classes.
12470         (Class.attribute_usage): Removed.
12471         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12472         for attribute class.
12473         
12474         * ecore.cs (IsAttribute): Removed.
12475         
12476         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12477         
12478         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12479         now normal types.
12480         (attribute_types): Removed.
12481         (EmitCode): Global attributes are emited as the latest.
12482
12483 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12484
12485         * class.cs (EmitFieldInitializers): Don't emit field initializer
12486         for default values when optimilization is on.
12487         
12488         * constant.cs (Constant.IsDefaultValue): New property.
12489         
12490         * driver.cs: Add /optimize handling.
12491         
12492         * constant.cs,
12493         * ecore.cs,
12494         * literal.cs: Implement new IsDefaultValue property.
12495         
12496         * rootcontext.cs (Optimize): New field, holds /optimize option.
12497
12498 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12499
12500         Fix crasher in re-opened #72347.
12501         * namespace.cs (Namespace.Lookup): Return null if
12502         DeclSpace.DefineType returns null.
12503
12504         Fix #72678.
12505         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12506
12507 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12508
12509         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12510         now returns null if it cannot resolve to an lvalue.
12511         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12512         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12513         returned null.  Remove check for SimpleName.
12514         (EventExpr.DoResolveLValue): New.
12515         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12516         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12517         error from ...
12518         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12519         avoid CS0131 error.
12520         (Unary.ResolveOperator): Move CS0211 check ...
12521         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12522         CS0131 error.
12523         (Unary.DoResolveLValue): Simplify.
12524         (AddressOf.DoResolveLValue): New.
12525         (ArrayAccess.DoResolveLValue): New.
12526
12527 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12528
12529         * attribute.cs (Attribute.Resolve): Add arguments casting for
12530         when types doesn't match ctor arguments.
12531
12532 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12533
12534         Fix parts of #63202.
12535         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12536         lookup of operator in base type.  Ensure that all checks happen
12537         when the operator resolves to an "op_..." method.
12538
12539 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12540
12541         Fix #71992.
12542         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12543         'ignore_cs0104' parameter.  Pass it to ...
12544         (NamespaceEntry.Lookup): ... this.
12545         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12546         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12547         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12548         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12549         Update.  Request that cs0104 errors be ignored.
12550         (ComposedCast.ResolveAsTypeStep): Update.
12551
12552 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12553
12554         Fix #59209.
12555         * expression.cs (Invocation.BetterFunction): Remove support for
12556         comparing virtual functions and their overrides.
12557         (Invocation.IsOverride): New.
12558         (Invocation.OverloadResolve): Don't consider 'override' functions
12559         during candidate selection.  Store them in a lookaside list.
12560         If the selected method is a 'virtual' function, use the list to
12561         find any overrides that are closer to the LHS type.
12562
12563 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12564
12565         * expression.cs (New.DoResolve): Add complex core type reduction.
12566         (New.Constantify): Converts complex core type syntax like 'new int ()'
12567         to simple constant.
12568         
12569 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12570
12571         * decl.cs (EntryType.EntryType): New constructor to create an
12572         updated copy of a cache entry.
12573         (MemberCache.AddMethods): Use it.
12574         (MemberCache.ClearDeclaredOnly): Remove.
12575         (MemberCache.MemberCache): Update.
12576
12577 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12578
12579         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12580         variable.  This one is represents the actual low-level declaration
12581         of the method, as opposed to the semantic level `IsStatic'.   
12582
12583         An anonymous method which is hosted into a static method might be
12584         actually an instance method.  IsStatic would reflect the
12585         container, while MethodIsStatic represents the actual code
12586         generated.
12587
12588         * expression.cs (ParameterReference): Use the new MethodIsStatic
12589         instead of IsStatic.
12590
12591         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12592         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12593         set on the current EmitContext. 
12594
12595         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12596         resolve our casted expression as an LValue.  This triggers the
12597         proper LValue processing that is later required by Assign.
12598
12599         This fixes 72347.
12600
12601         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12602
12603 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12604
12605         C# 2.0 Fixed buffer implementation
12606
12607         * anonymous.cs: Update after RegisterHelperClass renaming.
12608
12609         * attribute.cs (AttributeTester.fixed_buffer_cache):
12610         Cache of external fixed buffers.
12611         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12612         implementation if field is fixed buffer else null.
12613
12614         * class.cs
12615         (TypeContainer.AddField): Accept FieldMember instead of Field.
12616         (FieldBase.IsFieldClsCompliant): Extracted code from
12617         VerifyClsCompliance descendant customization.
12618         (FixedField): New class handles fixed buffer fields.
12619         (FixedFieldExternal): Keeps information about imported fixed
12620         buffer.
12621         (IFixedField): Make access to internal or external fixed buffer
12622         same.
12623
12624         * cs-parser.jay: Add fixed buffer parsing.
12625
12626         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12627         buffer.
12628
12629         * expression.cs (Indirection): Extended implementation to accept
12630         fixed buffer field.
12631         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12632         (ElementAccess.MakePointerAccess): Get type as parameter.
12633         (DoResolve): Add fixed buffer field expression conversion.
12634         (DoResolveLValue): Ditto.
12635         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12636         (ArrayPtr): Derives from FixedBufferPtr.
12637         (ArrayPtr.Emit): Add extra emit for array elements.
12638
12639         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12640
12641         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12642         for compiler generated types.
12643         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12644
12645         * statement.cs (Fixed): Refactored to be easier add fixed buffer
12646         and consume less memory.
12647         (Fixed.Resolve): Add fixed buffer case.
12648
12649         * typemanager.cs (compiler_generated_attr_ctor,
12650         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12651         (HasElementType): Add our own implementation to work on every
12652         runtime.
12653
12654 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12655
12656         * anonymous.cs (CaptureContext): Track whether `this' has been
12657         referenced.   
12658
12659         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
12660         only captured `this' if it was implicitly done (instance
12661         methods/variables were used). 
12662
12663         * codegen.cs (EmitContext.CaptureThis): New method to flag that
12664         `this' must be captured.
12665
12666 2005-01-30  Miguel de Icaza  <miguel@novell.com>
12667  
12668         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12669         is null it means that there has been no need to capture anything,
12670         so we just create a sibling.
12671
12672         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12673
12674         Just a partial fix.  The other half is fairly elusive.
12675         
12676 2005-02-10  Raja R Harinath  <rharinath@novell.com>
12677
12678         Fix #52586, cs0121-4.cs.
12679         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
12680         and return a hashtable.
12681         (MemberCache.ClearDeclaredOnly): New.
12682         (MemberCache.MemberCache): Update to change.  Make a deep copy of
12683         the method_hash of a base type too.
12684         (MemberCache.AddMethods): Adapt to having a deep copy of the base
12685         type methods.  Overwrite entries with the same MethodHandle so
12686         that the ReflectedType is correct.  The process leaves in base
12687         virtual functions and their overrides as distinct entries.
12688         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
12689         matters since it was boxed in a ArrayList before.
12690         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12691         modifier.
12692         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
12693         case of a virtual function and its override (choose the overload
12694         as better).
12695         (Invocation.OverloadResolve): Avoid 'override' members during
12696         'applicable_type' calculation.
12697
12698 2005-02-09  Raja R Harinath  <rharinath@novell.com>
12699
12700         Combine two near-redundant caches.
12701         * typemanager.cs (method_params): Rename from method_internal_params.
12702         (TypeManager.GetParameterData): New.  Replace
12703         Invocation.GetParameterData.
12704         (TypeManager.LookupParametersByBuilder): Remove.
12705         * expression.cs (Invocation.method_parameter_cache): Remove.
12706         (Invocation.GetParameterData): Remove.
12707         Update to changes.
12708         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12709         Update to changes.
12710
12711 2005-02-08  Raja R Harinath  <rharinath@novell.com>
12712
12713         Fix #72015.
12714         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12715         TypeManager.multicast_delegate_type is null, resolve it by looking
12716         up "System.MulticastDelegate".
12717         * rootcontext.cs (RootContext.ResolveCore): Simplify.
12718
12719 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
12720             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
12721             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
12722
12723         Fix cs0164.cs.
12724         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12725         (LabeledStatement.AddReference): New.  Set 'referenced'.
12726         (Goto.Resolve): Use it.
12727
12728 2005-02-05  John Luke  <john.luke@gmail.com>
12729
12730         * driver.cs: remove duplicate -doc line in Usage ()
12731
12732 2005-02-04  Raja R Harinath  <rharinath@novell.com>
12733
12734         * location.cs (Location.AddFile): Fix CS2002 error report.
12735
12736 2005-02-02  Martin Baulig  <martin@ximian.com>
12737
12738         * delegate.cs (Delegate.DefineType): Report an internal error if
12739         TypeManager.multicast_delegate_type is null.  See bug #72015 for
12740         details.        
12741
12742 2005-02-02  Raja R Harinath  <rharinath@novell.com>
12743
12744         Fix a crasher in a variant of #31984.
12745         * const.cs (Constant.CheckBase): New override that defers the
12746         new-or-override check in case the base type hasn't been populated
12747         yet.
12748         (Constant.Define): Ensure the new-or-override check is performed.
12749
12750 2005-02-01  Duncan Mak  <duncan@ximian.com>
12751
12752         * const.cs (LookupConstantValue): Check that `ce' is not null
12753         before calling GetValue ().
12754
12755 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12756
12757         Fix test-334.cs (#69519).
12758         * cs-parser.jay (using_alias_directive): Pass in an expression to
12759         NamespaceEntry.UsingAlias.
12760         (using_namespace_directive): Pass in an expression to
12761         NamespaceEntry.Using.
12762         (namespace_name): Don't flatten to a string.
12763         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12764         (NamespaceEntry.AliasEntry.Resolve): Lookup using
12765         ResolveAsTypeStep.
12766         (NamespaceEntry.UsingEntry): Likewise.
12767         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12768         changes.
12769         (NamespaceEntry.LookupForUsing): Remove.
12770         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12771         names.
12772         (NamespaceEntry.Lookup): Remove support for dotted names.
12773
12774 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12775
12776         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12777         split into two.
12778         (NamespaceEntry.ImplicitParent): Compute on demand.
12779         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12780         parallels the current.
12781         (NamespaceEntry.LookupForUsing): Use it.
12782         (NamespaceEntry.Lookup): If the current namespace-entry is
12783         implicit, don't search aliases and using tables.
12784
12785 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12786
12787         Fix #31984.
12788         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12789         BaseCache here.
12790         (TypeContainer.BaseCache): Compute on demand.
12791         (TypeContainer.FindMembers): Define constants and types if they're
12792         not already created.
12793         (FieldMember.Define): Move resetting of ec.InUnsafe before error
12794         check.
12795         * const.cs (Constant.Define): Make idempotent.
12796
12797 2005-01-29  Miguel de Icaza  <miguel@novell.com>
12798
12799         * pending.cs: Produce better code (no nops produced by using Ldarg
12800         + value).
12801         
12802         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12803         i - 1' it should be arg + 1.
12804
12805         Fixes bug #71819.
12806
12807 2005-01-28  Raja R Harinath  <rharinath@novell.com>
12808
12809         * attribute.cs (Attribute.CheckAttributeType): Make private
12810         non-virtual.
12811         (Attribute.ResolveType): Make virtual.
12812         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12813         handling of RootContext.Tree.Types.
12814
12815 2005-01-27  Raja R Harinath  <rharinath@novell.com>
12816
12817         Update attribute-handling to use the SimpleName/MemberAccess
12818         mechanisms.
12819         * cs-parser.jay (attribute): Pass in an expression to the
12820         constructors of Attribute and GlobalAttribute.
12821         * attribute.cs (Attribute): Take an expression for the name.
12822         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
12823         passed in attribute name expression.
12824         (Attribute.CheckAttributeType): Use it.
12825         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12826         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12827         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
12828         argument to prevent error messages if the lookup fails.
12829
12830 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
12831
12832         * expression.cs (Indirection): Implemented IVariable interface
12833         to support indirection in AddressOf operator.
12834         (PointerArithmetic.Emit): Add optimalization for case where
12835         result can be precomputed.
12836
12837 2005-01-26  Martin Baulig  <martin@ximian.com>
12838
12839         * class.cs (TypeContainer.AttributeTargets): Return the correct
12840         AttributeTargets depending on our `Kind' instead of throwing an
12841         exception; fixes #71632.
12842
12843 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
12844
12845         Fix #71257
12846         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12847         constant members.
12848
12849 2005-01-25  Raja R Harinath  <rharinath@novell.com>
12850
12851         Fix #71602.
12852         * expression.cs (MemberAccess.DoResolve): Don't complain with
12853         cs0572 when the LHS of a member access has identical name and type
12854         name.
12855
12856 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
12857
12858         Fix #71651, #71675
12859         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12860         CreatePermission.
12861         Create custom PermissionSet only for PermissionSetAttribute.
12862
12863 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
12864
12865         Fix #71649
12866         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12867         delegates in static class.
12868
12869 2005-01-24  Martin Baulig  <martin@ximian.com>
12870
12871         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12872         merging an implicit block, just use its reachability.
12873
12874         * statement.cs (Block.Resolve): Make the unreachable code check
12875         work wrt. implicit blocks; see test-337 from #63842.
12876
12877 2005-01-21  Alp Toker  <alp@atoker.com>
12878  
12879         * cs-parser.jay: destructor_declaration's container is PartialContainer
12880         not Class when partial types are used, so use Kind prop instead of
12881         'is'.
12882         
12883 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
12884
12885         * cs-parser.jay: Improve error reporting when an interface
12886         declares new types.
12887
12888 2005-01-20  Dick Porter  <dick@ximian.com>
12889
12890         * support.cs: SeekableStreamReader fix from Sandor Dobos
12891         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12892         chars are read.  Fixes bug 70369.
12893
12894 2005-01-20  Raja R Harinath  <rharinath@novell.com>
12895
12896         * cs-parser.jay (catch_clause): Simplify current_block handling
12897         somewhat.
12898
12899 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
12900
12901         * convert.cs (ImplicitStandardConversionExists): Synchronize the
12902         code with ImplicitStandardConversion to handle the implicit
12903         conversion of method groups into valid delegate invocations. 
12904
12905         The problem is that in parameter handling we were using this code
12906         path.  Fixes bug #64698
12907
12908 2005-01-19  Raja R Harinath  <rharinath@novell.com>
12909
12910         * cs-parser.jay: Fix several infelicities.
12911         - Avoid assigning to the parser value stack.  Code like 
12912           '$3 = null' is unclean.  Synthesize a value for the code block
12913           instead. 
12914         - Avoid using oob_stack for storing location information.  Use ...
12915         (_mark_): ... this.  New (empty) rule.  Saves the current location
12916         in $$.
12917         (foreach_statement): Avoid using oob_stack for current_block
12918         handling.  Use technique used in for_statement and
12919         using_statement.  Synthesize a value for the code block to store
12920         additional intermediate information.
12921
12922 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
12923
12924         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12925         of a different type is only allowed to private fields of a
12926         containing type, not on fields of a base class.
12927
12928         See test-174.cs and error cs0122-9.cs
12929
12930 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12931
12932         Fix test-335.cs (bug #58126).
12933         * cs-parser.jay (argument): Split out non-expression parts of the
12934         rule into 'non_simple_argument'.
12935         (invocation_expression): Support parenthesized invocations with
12936         multiple arguments, and with single non-simple arguments.
12937
12938 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12939
12940         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12941         places.
12942
12943 2005-01-12  Raja R Harinath  <rharinath@novell.com>
12944
12945         Fix cs0038-1.cs, cs1640-6.cs.
12946         * ecore.cs (Expression.Resolve): Remove special-case for
12947         SimpleName in error-handling.
12948         (Expression.almostMatchedMembers): Relax access permission to
12949         protected.
12950         (Expression.MemberLookupFailed): Handle duplicates in
12951         almostMatchedMembers list.
12952         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12953         * expression.cs (New.DoResolve): Report CS1540 for more cases.
12954         * typemanager.cs (GetFullNameSignature): Use the MethodBase
12955         overload if the passed in MemberInfo is a MethodBase.
12956
12957 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
12958
12959         Fix #70749
12960         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12961         for non-CAS & merge permission sets properly.
12962
12963 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12964
12965         Improve standard-compliance of simple name and member access 
12966         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
12967         * ecore.cs (FullNamedExpression): New abstract base class 
12968         for Namespaces and TypeExpressions.
12969         (ResolveFlags.SimpleName): Remove.
12970         (SimpleName): Remove support for dotted names.
12971         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
12972         DeclSpace.FindType and DeclSpace.LookupType.
12973         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12974         (Expression.ExprClassName): Make member function.
12975         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12976         a namespace.  Remove creation of dotted "SimpleName"s.
12977         (MemberAccess.DoResolve): Likewise.
12978         * decl.cs (DeclSpace.Cache): Make private.
12979         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12980         (DeclSpace.FindType): Update.
12981         (DeclSpace.LookupType): Move here from RootContext.  Return a 
12982         FullNamedExpression.
12983         * namespace.cs (Namespace): Derive from FullNamedExpression
12984         so that it can be part of expression resolution.
12985         (Namespace.Lookup): Return an FullNamedExpression.
12986         (NamespaceEntry.LookupAlias): Lookup aliases only in current
12987         namespace.
12988         * rootcontext.cs (NamespaceLookup): Remove.
12989         (LookupType): Move to DeclSpace.
12990         * attribute.cs (CheckAttributeType): Update.
12991         * doc.cs (FindDocumentedType): Remove allowAlias argument.
12992         (FindDocumentedTypeNonArray): Likewise.
12993
12994 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12995
12996         Fix cs0509.cs, cs1632.cs.
12997         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12998         is the same as IsInterface.
12999         (TypeContainer.GetClassBases): Likewise.
13000         * statement.cs (LabeledStatement.ig): New field.
13001         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13002         label.
13003         (LabeledStatement.DoEmit): Check that the label was created with
13004         the same ILGenerator.
13005
13006 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13007
13008         Fix #71058
13009         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13010         accessors to its properties.
13011
13012         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13013         from accessors to property.
13014         
13015 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13016
13017         Fix #70722
13018         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13019         only for overrides.
13020         
13021 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13022
13023         * attribute.cs: Check for null and empty strings.  
13024
13025         I have lost another battle to Paolo.
13026
13027 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13028
13029         Fix #70942
13030         * class.cs (PropertyMethod): Set Parent field in ctors.
13031         (SetMethod.InternalParameters): Add unsafe switch hack.
13032         Override MarkForDuplicationCheck where it is appropriate.
13033
13034         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13035         It says whether container allows members with the same name.
13036         Base default is no.
13037         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13038         Removed is_method parameter.
13039
13040 2005-01-06  Duncan Mak  <duncan@ximian.com>
13041
13042         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13043         because the previous change led to incorrect reporting of CS1032
13044         ("Cannot define/undefine preprocessor symbols after first token in
13045         file"). Instead of using `tokens_seen' as the only flag that
13046         triggers CS1040, introduce `comments_seen'. This new flag is used
13047         to signify having seen comments on the current line, so it is
13048         unset after a newline.
13049
13050 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13051
13052         * doc.cs : When searching for a type, find nested type too.
13053           This fixes bug #71040.
13054
13055 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13056
13057         * doc.cs :
13058           - Warn missing member comment on those classes which also does not
13059             have doc comments. Fixed bug #71041.
13060           - Don't warn missing doc comment on default constructor.
13061             Fixed bug #71042.
13062
13063 2005-01-06  Duncan Mak  <duncan@ximian.com>
13064
13065         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13066         comments, set `tokens_seen' to true. This allows us to detect
13067         misplaced preprocessor directives (i.e. not at the beginning of
13068         the a line, nor after whitespaces). In that case, report error
13069         CS1040. This fixes bug #56460.
13070
13071         * cs-parser.jay (interface_member_declaration): Add checks for
13072         IsExplicitImpl, and report CS0541 error if an interface member is
13073         defined as an explicit interface declaration.
13074
13075 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13076
13077         Fix #70817
13078         * class.cs (PropertyMethod): Set Parent field in ctors.
13079         (SetMethod.InternalParameters): Add unsafe switch hack.
13080         
13081         * decl.cs (MemberCore.Parent): Cannot be readonly.
13082
13083 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13084
13085         * decl.cs (DeclSpace.ResolveType): Remove.
13086         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13087         Merge in code from ...
13088         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13089         * class.cs, enum.cs: Update to changes.
13090
13091 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13092
13093         * anonymous.cs: Ensure that we init the scope of our parent if it
13094         has not been initialized yet.
13095
13096 2004-12-30  Duncan Mak  <duncan@ximian.com>
13097
13098         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13099         if field.FieldBuilder is null. Fixes #70758.
13100
13101         * convert.cs: Fixed some typos and updated some of the comments.
13102         (ImplicitStandardConversionExists):
13103         (TryImplicitIntConversion): If `target_type' is an interface and
13104         the type of `ic' implements this interface, return true or a new
13105         BoxedCast instead of null. This fixes #70468.
13106
13107 2004-12-29  Duncan Mak  <duncan@ximian.com>
13108
13109         * expression.cs (Argument.Emit): Check that Expr is
13110         IMemoryLocation before casting to it, and report CS1510 otherwise.
13111
13112         This fixes #70402.
13113
13114 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
13115
13116         * statement.cs (Block.ThisVariable): remove the recursion here, to
13117         make the --profile more sane.
13118
13119 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
13120
13121         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13122         assembly, by JB Evain.
13123
13124 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13125
13126         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
13127           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13128         "parent" refers to enclosing type/class.  "base" refers to superclass.
13129
13130 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13131
13132         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13133         Ensure that we only have GlobalAttributes.
13134         * attribute.cs (Attribute.Emit): Make non-virtual.
13135         (GlobalAttribute.Emit): Remove.
13136         (Attribute.Resolve): Make virtual.
13137         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
13138         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13139         the argument. Don't create one.
13140         (Attribute.GetObsoleteAttribute): Likewise.
13141         (Attribute.GetClsCompliantAttributeValue): Likewise.
13142         * class.cs, decl.cs: Update to changes.
13143
13144 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
13145
13146         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13147         
13148         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13149         
13150         * statement.cs (Foreach.Resolve): Add error 186 report.
13151
13152 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
13153
13154         * expression.cs (Conditional.DoResolve): Add warning 429.
13155         
13156         * statement.cs (If.Resolve): Add warning 665.
13157
13158 2004-12-16  Raja R Harinath  <rharinath@novell.com>
13159
13160         New invariant: RootContext.Tree.Types.NamespaceEntry == null
13161         except when in the parser, and in GlobalAttribute.
13162         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13163         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13164         RootContext.Tree.Types.NamespaceEntry once work is done.
13165         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
13166         and resets RootContext.Tree.Types.NamespaceEntry.
13167
13168 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
13169
13170         * cs-parser.jay: Don't create a block for every variable.
13171
13172 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
13173
13174         * location.cs: Provide extra information.
13175
13176         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13177         variables from the captured environment, it is the ldarg_0.
13178
13179 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13180
13181         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13182         find a conclusion.
13183         
13184         * class.cs: Changed warning level for 169 to avoid developer
13185         displeasure from warning flooding. It will be changed back when they
13186         fix most of current BCL warnings.
13187         
13188         * RootContext.cs: Pushed default WarningLevel to 3.
13189         
13190         * statement.cs: Removed unused variable.
13191
13192 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13193
13194         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13195         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13196         Add error 502 report.
13197         (StaticClass.DefineType): Add error 441 report.
13198         (Class.AllowedModifiersProp): New virtual property as temporary
13199         extension to AllowedModifiers.
13200         (Class.DefineType): Add error 418 report. Moved ModFlags check here
13201         to share implementation with StaticClass and don't call virtual
13202         methods from ctor.
13203         
13204         * driver.cs (MainDriver): Add error 1558 test.
13205
13206         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13207         report. Moved error 36 test here.
13208
13209         * statement.cs (Throw.Resolve): Add error 724 report.
13210
13211         * typemanager.cs: Add out_attribute_type core type.
13212         
13213 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
13214
13215         * class.cs (TypeContainer.VerifyClsCompliance): Add error
13216         3018 report.
13217         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13218
13219         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13220         3017 report.
13221         
13222         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13223
13224         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
13225         Add error 3023 report.
13226         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13227
13228         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13229         implementation.
13230
13231 2004-12-12  John Luke  <john.luke@gmail.com>
13232
13233         * driver.cs (AddArgs): take -- into account when
13234         adding arguments, fixes bug 65710 
13235
13236 2004-12-12  Martin Baulig  <martin@ximian.com>
13237
13238         * expression.cs (Unary.TryReduceNegative): Added support for
13239         SByteConstant and ByteConstant.
13240         (Unary.Reduce): Check error values from TryReduceNegative().
13241
13242 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13243
13244         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13245         and report exception as error 182.
13246
13247 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13248
13249         * driver.cs (Main): Fix message when there are warnings.
13250
13251 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13252
13253         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13254
13255 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13256
13257         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13258         Reduced number of warnings.
13259         
13260         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13261
13262 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13263
13264         * driver.cs: Removed message.
13265
13266         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13267
13268 2004-12-08    <vargaz@freemail.hu>
13269
13270         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13271
13272 2004-12-08  Martin Baulig  <martin@ximian.com>
13273
13274         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13275         instead of a CS3002 for properties and indexer.
13276
13277 2004-12-08  Martin Baulig  <martin@ximian.com>
13278
13279         * decl.cs (MemberName.ToString): Make this work again.
13280
13281 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13282
13283         * attribute.cs (Resolve): Add error 591 detection.
13284
13285         * class.cs (FieldMember.Define): Add error 1547 detection.
13286         (Indexer.Define): Add error 620 detection.
13287         (Operator.Define): Add error 590 detection.
13288
13289         * ecore.cs: Missing argument for error 79.
13290
13291         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13292         detection.
13293
13294 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13295
13296         Fix #70106
13297         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13298         only.
13299
13300 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13301
13302         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13303           Some operator comments were suppressed.
13304         * doc.cs : Implicit/explicit operator name in doc comments are like
13305           "op_Explicit(type)~returnType", so added suffix handling.
13306
13307 2004-12-07  Martin Baulig  <martin@ximian.com>
13308
13309         * decl.cs
13310         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13311         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13312         (DeclSpace.ec): New protected field; store the EmitContext here.
13313         (DeclSpace.EmitContext): New public property; moved here from
13314         `TypeContainer'.
13315         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13316         EmitContext.
13317
13318         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13319         (Enum.Emit): Don't create a new EmitContext.
13320
13321         * delegate.cs (Delegate.DefineType): Always create the
13322         EmitContext.
13323
13324         * iterators.cs (Iterators.DefineIterator): Create a new
13325         EmitContext and store it in `ec'.
13326
13327 2004-08-24  Martin Baulig  <martin@ximian.com>
13328
13329         * typemanager.cs
13330         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13331         this for accessibility checks.
13332         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13333         IsNestedFamilyAccessible.
13334         (TypeManager.IsSubclassOf): New method, do what the name actually
13335         says.   
13336
13337 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13338
13339         Fix crash on cs0657-17.cs.
13340         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13341         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13342         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13343         the case where the NamespaceEntry gets overwritten.
13344
13345 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13346
13347         Fixed #69195, #56821
13348         * ecore.cs (ResolveBoolean): Tiny refactoring.
13349
13350         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13351         of right expression resolving when left is false constant and
13352         operator is LogicalAnd OR true constant and operator is LogicalOr.
13353
13354         * statement.cs (ResolveUnreachable): Always reports warning.
13355
13356 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13357
13358         * class.cs: Distinguish between 1721 and 1722 (just a little help
13359         for the programmer).
13360
13361 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * delegate.cs: Only allow this on new versions of the language. 
13364
13365 2004-12-02  Duncan Mak  <duncan@ximian.com>
13366
13367         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13368         Expression class.
13369         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13370         here as a static method. Take an additional bool out parameter
13371         `must_do_cs1540_check' for signaling to InstanceResolve.
13372         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13373         member field from PropertyExpr class and made it an argument of
13374         the method instead.
13375         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13376         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13377         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13378         and `remove_accessor' as well as InstanceResolve: report CS0122
13379         where applicable.
13380
13381         Fixes #70129.
13382
13383 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13384
13385         Fix test-327.cs, test-328.cs, and put in early infrastructure
13386         for eventually fixing #52697.
13387         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13388         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13389         from other methods.
13390         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13391         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13392         (VerifyUsing, error246): Update.
13393         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13394         'NamespaceEntry.LookupNamespaceOrType'.
13395
13396 2004-12-03  Martin Baulig  <martin@ximian.com>
13397
13398         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13399         method as our child, call AnonymousMethod.Compatible() on it.
13400
13401 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13402
13403         Disable XML documentation support in 'basic' profile.
13404         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13405         Redirect XmlElement to System.Object.
13406         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13407         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13408         * mcs.exe.sources: Add doc-bootstrap.cs.
13409         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13410         of doc.cs.
13411
13412 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13413
13414         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13415           comments are allowed.
13416
13417 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13418
13419         * delegate.cs: Add checks for subtypes in paramaters and return values
13420         in VerifyMethod () to add support for Covariance/Contravariance
13421         in delegates.
13422         
13423 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13424
13425         * report.cs: Remove extra closing parenthesis.
13426
13427         * convert.cs (Error_CannotImplicitConversion): If the name of the
13428         types are the same, provide some extra information.
13429
13430         * class.cs (FieldBase): Use an unused bit field from the field to
13431         encode the `has_offset' property from the FieldMember.  This saves
13432         a couple of Ks on bootstrap compilation.
13433
13434         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13435         method as our child, return the AnonymousMethod resolved
13436         expression.
13437
13438         * expression.cs (New.DoResolve): Allow return values from
13439         NewDelegate to also include AnonymousMethods.
13440
13441         Fixes #70150.
13442
13443 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13444
13445         Fix bug #70102
13446         * attribute.cs (Resolve): Improved implementation of params
13447         attribute arguments.
13448
13449         * support.cs (ParameterData): Add HasParams to be faster.
13450
13451 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13452
13453         all things are for /doc support:
13454
13455         * doc.cs: new file that supports XML documentation generation.
13456         * mcs.exe.sources: added doc.cs.
13457         * driver.cs:
13458           Handle /doc command line option.
13459           Report error 2006 instead of 5 for missing file name for /doc.
13460           Generate XML documentation when required, after type resolution.
13461         * cs-tokenizer.cs:
13462           Added support for picking up documentation (/// and /** ... */),
13463           including a new XmlCommentState enumeration.
13464         * cs-parser.jay:
13465           Added lines to fill Documentation element for field, constant,
13466           property, indexer, method, constructor, destructor, operator, event
13467           and class, struct, interface, delegate, enum.
13468           Added lines to warn incorrect comment.
13469         * rootcontext.cs :
13470           Added Documentation field (passed only when /doc was specified).
13471         * decl.cs:
13472           Added DocComment, DocCommentHeader, GenerateDocComment() and
13473           OnGenerateDocComment() and some supporting private members for
13474           /doc feature to MemberCore.
13475         * class.cs:
13476           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13477         * delegate.cs:
13478           Added overriden DocCommentHeader.
13479         * enum.cs:
13480           Added overriden DocCommentHeader and GenerateDocComment().
13481
13482 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13483
13484         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13485         unwrapping the enumeration values, chain to
13486         DoConstantNumericPromotions again, so we can promote things to the
13487         fundamental types (takes care of enums that are bytes, sbytes).
13488
13489         Fixes bug #62054.
13490
13491 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13492
13493         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13494         Fix long-standing bug in type-lookup.  Use FindType instead of
13495         LookupType when ec.ResolvingTypeTree.
13496         (Attribute.ResolveType, Attribute.Resolve)
13497         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13498         Update to changes.
13499         (Attributes.Search): Remove internal version.  Update.
13500         (Attributes.SearchMulti): Update.
13501         (Attributes.GetClsCompliantAttribute): Remove.
13502         (Attributes.GetIndexerNameAttribute): Remove.
13503         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13504         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13505         * class.cs (Indexer.Define): Likewise.
13506
13507 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13508
13509         Fix bug #68790
13510         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13511         MarshallByReference members access.
13512
13513         * expression.cs: Use CheckMarshallByRefAccess;
13514         Better error CS0197 message.
13515
13516         * report.cs: Print whole related error message.
13517
13518 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13519
13520         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13521         the current directory to help debugging.
13522
13523 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13524
13525         * class (GetClassBases): Better error 60 report.
13526         (EventProperty): Disabled warning 67 detection.
13527
13528 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13529
13530         Fix bug #60324
13531         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13532
13533         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13534         precise values.
13535
13536 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13537
13538         Fix bug #49488
13539         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13540
13541         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13542
13543 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13544
13545         * attribute.cs (Attribute.Resolve): Refine error reporting and
13546         report a cs0117 if the identifier does not exist, to distinguish
13547         from 0617 which is a miss-use of the actual identifier.
13548
13549         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13550         between cs0070 and cs0079.
13551
13552         * class.cs (MemberBase.DoDefine): When reporting a wrong
13553         accessibility level, we use MethodCore to compare instead of
13554         Method (this was a regression in some refactoring effort).
13555
13556         So now we correctly report cs0056 again.
13557
13558         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13559         testing the target_type (which was known to be object_type) and
13560         not the source type (which is anonymous_method).
13561
13562         Fixed reporting of error cs1660.
13563
13564         * expression.cs (UserCast.Source): Expose the underlying cast.
13565
13566         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13567         allowed types to find a match to int32 first (most common).
13568
13569         In addition, it ignores any ImplicitUserConversions that did an
13570         internal implicit conversion (as the switch statement allows only
13571         one integral conversion to exist).
13572
13573         * class.cs (PartialContainer.Create): rename `name' to
13574         `member_name' for clarity.  Then replace the string calls with a
13575         call to MemberName.GetPartialName, as now using
13576         MemberName.ToString is an error (this is due to the side effects
13577         it had, that were fixed in the past).
13578
13579         This will restore the error reporting on a number of partial class
13580         errors that were missusing this (and getting an exception as a
13581         results, which is now just a plain textual warning, because
13582         yyparse debug output would crash otherwise).
13583
13584 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13585
13586         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13587
13588 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13589
13590         * rootcontext.cs (LookupType): Make sure to cache lookups that
13591         don't give us a negative result. This saves about 5% of corlib
13592         compilation time.
13593
13594 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13595
13596         * report.cs (AbstractMessage.Print): messages are sent to stderr
13597
13598         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13599         non-interface in the list of interfaces (at this point, either
13600         parent was properly set, or a base class is being listed in the
13601         interfaces section).
13602
13603         This flags error 1722, and resolves the crash from bug 69259.
13604
13605 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13606
13607         * statement.cs (Using.EmitExpressionFinally): make this work right
13608         for valuetypes. Fixes 69926.
13609
13610 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13613         converted to an enum" here, before we try to change the underlying
13614         type.  This code exists, but it is a different code path than the
13615         one used while encoding constants.
13616
13617         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13618         old bug: when converting from the null literal to a pointer,
13619         return an EmptyCast, not the NullLiteral.
13620
13621         This fixes #69921, the recent null_type changes probably made this
13622         bug more prominent.
13623
13624         (ImplicitReferenceConversionExists): In addition, resynchronized
13625         the code here, so it matches the same code in
13626         ImplicitReferenceConversionExists for the `from any class-type S
13627         to any interface-type T'.
13628         
13629
13630 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13631
13632         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13633
13634 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13635
13636         * cs-parser.jay: Use verbosity accordingly. 
13637
13638 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13639
13640         * expression.cs (Unary.ResolveOperator): Do not report warning;
13641         AddressOf reads from variable.
13642         
13643         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13644
13645 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13646
13647         Fix bug #69462
13648
13649         * attribute.cs (Attributable): Removed CheckTargets.
13650         (Attributes.Emit): Explicit attribute targets are tested here.
13651
13652         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13653         not enabled for interfaces.
13654
13655         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13656         (GetAssemblyName): Ouch next bug there.
13657
13658 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13659
13660         * expression.cs: Error 275 added.
13661         
13662 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
13663
13664         Fix bug #69177 (Implemented decimal constant support)
13665
13666         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13667         (BinaryFold): Add DecimalConstant.
13668
13669         * const.cs (Define): Decimal constant 
13670         (is not constant.
13671         (ChangeType): Add decimal type handling.
13672         (LookupConstantValue): Don't set value for decimal type but
13673         emit DecimalConstantAttribute. Needed for constant optimization.
13674
13675         * constant.cs (ToDecimal): New method.
13676         (ConvertToDecimal): New method.
13677         (IntConstant): Implemented ConvertToDecimal.
13678         (DecimalConstant.Emit): Emit optimized version for decimals in
13679         int range.
13680
13681         * expression.cs (ResolveOperator): Changed order of constant
13682         reduction to work correctly with native types which have
13683         overloaded operators.
13684         (ResolveMemberAccess): Extract constant value from attribute
13685         for decimal type.
13686
13687         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13688
13689         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13690         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13691         (ChangeType): Decimal is special.
13692         (TypeToCoreType): Add decimal type.
13693
13694 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13695
13696         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13697         decimal types.
13698
13699 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13700
13701         * class.cs (EventField.ApplyAttributeBuilder): Fix error
13702         test cs1667-5.cs.
13703
13704 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13705
13706         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13707
13708         * pending.cs (PendingImplementation): Grab only interfaces.
13709
13710 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13711
13712         * statement.cs (ForeachHelperMethods): Add location member and
13713         error 202 detection.
13714
13715 2004-11-19  Raja R Harinath  <rharinath@novell.com>
13716
13717         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
13718         automatically handled by executable.make.
13719         (PROGRAM): Make profile-specific.
13720
13721 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
13722
13723         * expression.cs (DoResolveBase): Fixed wrong warning for out
13724         variables.
13725
13726 2004-11-18  Martin Baulig  <martin@ximian.com>
13727
13728         Merged latest changes into gmcs.  Please keep this comment in
13729         here, it makes it easier for me to see what changed in MCS since
13730         the last time I merged.
13731
13732 2004-11-17  Raja R Harinath  <rharinath@novell.com>
13733
13734         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13735         (TypeHandle.GetMemberCache): New.
13736         (TypeHandle.TypeHandle): Update.
13737         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13738         (TypeManager.LookupParentInterfacesCache):
13739         Rename from LookupInterfaceCache.  Optimize slightly.
13740         (TypeManager.MemberLookup_FindMembers): Update.
13741         * decl.cs (MemberCache.MemberCache): Set Container to null in the
13742         multi-type variant.
13743         (AddCacheContents): Rename from AddHashtable.
13744         * class.cs (TypeContainer.parent_container): Remove.
13745         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13746         (TypeContainer.DoDefineMembers): Don't initialize it.
13747         Update to name changes.
13748         
13749 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13752         that factors the code to check access modifiers on override.  
13753
13754         (PropertyBase): Use the code here.
13755
13756         Patch from Lluis S'anchez, fixes bug #69361.
13757
13758 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
13759
13760         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13761         routine that is used to report the use of a captured variable
13762         whose address has been taken.
13763
13764         There are two checks: one when variables are being captured and
13765         the other check is when the address of a variable is taken. 
13766         
13767         (because an anonymous methods might be resolved before *or* after
13768         the address has been taken) and 
13769
13770         * expression.cs (Conditional.DoResolve): Remove the special
13771         casing that Martin added to trueExpr and falseExpr being both
13772         NullLiteral.  We get the right behavior now just by introducing
13773         the null_type into the compiler. 
13774
13775         * convert.cs (ExplicitConversion): Change the code to use
13776         null_type instead of testing `expr is NullLiteral'.
13777         (ImplicitConversionStandard): use null_type too.
13778         (ImplicitReferenceConversionExists): use null_type too.
13779         (ImplicitReferenceConversion): use null_type too.
13780
13781         * literal.cs: The type of `NullLiteral' is now null_type instead
13782         of object_type. 
13783         (Resolve): Set the type here.
13784
13785         * typemanager.cs: Introduce null_type.
13786
13787 2004-11-17  Martin Baulig  <martin@ximian.com>
13788
13789         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13790         direction, like FindMembers() does.  Fixes #69546, testcase is in
13791         test-315.cs.    
13792
13793 2004-11-16  Martin Baulig  <martin@ximian.com>
13794
13795         This is based on a patch from Marek Safar, see bug #69082.
13796         Fixes bugs #63705 and #67130.
13797
13798         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13799         method; create a MemberCache for an interface type and cache the
13800         result.
13801
13802         * decl.cs (IMemberContainer.ParentContainer): Removed.
13803         (IMemberContainer.ParentCache): New property.
13804         (MemberCache.SetupCacheForInterface): Removed.
13805         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13806         to create a cache for an interface's "parent".
13807
13808         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13809         interfaces too.
13810
13811 2004-11-16  Martin Baulig  <martin@ximian.com>
13812
13813         Merged back from gmcs; these changes already went into gmcs a
13814         couple of weeks ago.
13815
13816         * typemanager.cs
13817         (TypeManager.AddUserType): Removed the `ifaces' argument.
13818         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13819         `TypeExpr []'.
13820         (TypeManager.AddUserInterface): Removed.
13821         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13822         `TypeExpr []'.
13823         (TypeManager.GetInterfaces): Likewise.
13824         (TypeManager.GetExplicitInterfaces): Likewise.
13825
13826         * ecore.cs (TypeExpr.GetInterfaces): Removed.
13827
13828         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13829         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13830
13831 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
13832
13833         * statement.cs: Avoid adding bools to a hashtable.
13834
13835 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
13836
13837         * expression.cs (Invocation.OverloadResolve): Flag error if we are
13838         calling an unsafe method from a safe location.
13839
13840 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
13841
13842         Fix #69167
13843         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13844
13845 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
13846
13847         * namespace.cs (VerifyUsing): use GetPartialName instead of
13848         ToString. 
13849
13850 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
13851
13852         * statement.cs (Return.Resolve): Fix regression in typo: if
13853         `in_exc', we have to request a NeedReturnLabel, this was a typo
13854         introduced in the anonymous method check-in.  Fixes #69131.
13855
13856         * Indexers were using the ShortName when defining themselves,
13857         causing a regression in the compiler bootstrap when applying the
13858         patch from 2004-11-02 (first part), now they use their full name
13859         and the bug is gone.
13860
13861 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
13862
13863         * driver.cs: Strip the path from the names of embedded resources. Fixes
13864         #68519.
13865
13866 2004-11-04  Raja R Harinath  <rharinath@novell.com>
13867
13868         Fix error message regression: cs0104-2.cs.
13869         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13870         (AliasEntry.Resolve): Update.
13871         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
13872         'silent' flag.
13873         (RootContext.LookupType): Update.
13874
13875 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
13876
13877         * cs-parser.jay: Add support for handling accessor modifiers
13878         * class: Add support port accessor modifiers and error checking,
13879         define PropertyMethod.Define as virtual (not abstract anymore)
13880         * ecore.cs: Add checking for proeprties access with access modifiers
13881         * iterators.cs: Modify Accessor constructor call based in the modified
13882         constructor
13883 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
13884
13885         * expression.cs (StringConcat): Handle being called twice,
13886         as when we have a concat in a field init with more than two
13887         ctors in the class
13888
13889 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
13890
13891         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13892         special case explicit implementations, we should always produce
13893         the .property or .event declaration.
13894         
13895         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13896         since it will not return correct data if people use this
13897         unresolved in the presence of using statements (see test-313).
13898
13899         * class.cs (MethodData.Define): If we are an explicit interface
13900         implementation, set the method name to the full name of the
13901         interface plus the name of the method.  
13902
13903         Notice that using the method.MethodName.GetFullName() does not
13904         work, as it will only contain the name as declared on the source
13905         file (it can be a shorthand in the presence of using statements)
13906         and not the fully qualifed type name, for example:
13907
13908         using System;
13909
13910         class D : ICloneable {
13911                 object ICloneable.Clone ()  {
13912                 }
13913         }
13914
13915         Would produce a method called `ICloneable.Clone' instead of
13916         `System.ICloneable.Clone'.
13917
13918         * namespace.cs (Alias.Resolve): Use GetPartialName.
13919         
13920 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13921
13922         * cs-parser.jay: Add error 1055 report.
13923
13924 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * assign.cs (Assign.DoResolve): Only do the transform of
13927         assignment into a New if the types are compatible, if not, fall
13928         through and let the implicit code deal with the errors and with
13929         the necessary conversions. 
13930
13931 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13932
13933         * cs-parser.jay: Add error 1031 report.
13934
13935         * cs-tokenizer.cs: Add location for error 1038.
13936
13937 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13938
13939         * cs-parser.jay: Add error 1016 report.
13940
13941 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13942
13943         * cs-parser.jay: Add errors 1575,1611 report.
13944
13945 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13946
13947         * cs-parser.jay: Add error 1001 report.
13948
13949 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13950
13951         Fix #68850
13952         * attribute.cs (GetMarshal): Add method argument for
13953         caller identification.
13954
13955         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13956         agument for GetMarshal and RuntimeMissingSupport.
13957
13958 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13959
13960         * attribute.cs (ExtractSecurityPermissionSet): Removed
13961         TypeManager.code_access_permission_type.
13962
13963         * typemanager.cs: Removed TypeManager.code_access_permission_type.
13964
13965 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
13966
13967         * expression.cs (LocalVariableReference.DoResolveLValue): Check
13968         for obsolete use of a variable here.   Fixes regression on errors
13969         cs0619-25 and cs0619-26.
13970
13971 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
13972
13973         Fix #62358, implemented security attribute encoding.
13974
13975         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13976         Tests permitted SecurityAction for assembly or other types.
13977         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13978         data from SecurityPermissionAttribute to PermisionSet class.
13979
13980         * class.cs (ApplyAttributeBuilder): Added special handling
13981         for System.Security.Permissions.SecurityAttribute based types.
13982
13983         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13984         special handling for System.Security.Permissions.SecurityAttribute
13985         based types.
13986
13987         * enum.cs (ApplyAttributeBuilder): Added special handling
13988         for System.Security.Permissions.SecurityAttribute based types.
13989
13990         * parameter.cs (ApplyAttributeBuilder): Added special handling
13991         for System.Security.Permissions.SecurityAttribute based types.
13992
13993         * rootcontext.cs: Next 2 core types.
13994
13995         * typemanager.cs (TypeManager.security_permission_attr_type):
13996         Built in type for the SecurityPermission Attribute.
13997         (code_access_permission_type): Build in type.
13998
13999 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14000
14001         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14002         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14003         all of this information into
14004         EmitContext.EmitCapturedVariableInstance.
14005         
14006         * codegen.cs (EmitCapturedVariableInstance): move here the
14007         funcionality of emitting an ldarg.0 in the presence of a
14008         remapping.   This centralizes the instance emit code.
14009
14010         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14011         then emit a load of this: it means that we have reached the
14012         topmost ScopeInfo: the one that contains the pointer to the
14013         instance of the class hosting the anonymous method.
14014
14015         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14016         captures to the topmost CaptureContext.
14017
14018 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14019
14020         * expression.cs (LocalVariableReference): Move the knowledge about
14021         the iterators into codegen's EmitCapturedVariableInstance.
14022
14023 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14024
14025         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14026         all code paths return a value from an anonymous method (it is the
14027         same as the 161 error, but for anonymous methods).
14028
14029 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14030
14031         The introduction of anonymous methods in the compiler changed
14032         various ways of doing things in the compiler.  The most
14033         significant one is the hard split between the resolution phase
14034         and the emission phases of the compiler.
14035
14036         For instance, routines that referenced local variables no
14037         longer can safely create temporary variables during the
14038         resolution phase: they must do so from the emission phase,
14039         since the variable might have been "captured", hence access to
14040         it can not be done with the local-variable operations from the runtime.
14041         
14042         * statement.cs 
14043
14044         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14045         is a toplevel block.
14046
14047         (ToplevelBlock): A new kind of Block, these are the blocks that
14048         are created by the parser for all toplevel method bodies.  These
14049         include methods, accessors and anonymous methods.
14050
14051         These contain some extra information not found in regular blocks:
14052         A pointer to an optional CaptureContext (for tracking captured
14053         local variables and parameters).  A pointer to the parent
14054         ToplevelBlock.
14055         
14056         (Return.Resolve): Catch missmatches when returning a value from an
14057         anonymous method (error 1662).
14058         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14059         phase.
14060
14061         (Break.Resolve): ditto.
14062
14063         (SwitchLabel): instead of defining the labels during the
14064         resolution phase, we now turned the public ILLabel and ILLabelCode
14065         labels into methods called GetILLabelCode() and GetILLabel() that
14066         only define the label during the Emit phase.
14067
14068         (GotoCase): Track the SwitchLabel instead of the computed label
14069         (its contained therein).  Emit the code by using
14070         SwitchLabel.GetILLabelCode ().
14071
14072         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14073         whether the Local has been captured or not.
14074
14075         (LocalInfo.IsCaptured): New property, used to tell whether the
14076         local has been captured.
14077         
14078         * anonymous.cs: Vastly updated to contain the anonymous method
14079         support.
14080
14081         The main classes here are: CaptureContext which tracks any
14082         captured information for a toplevel block and ScopeInfo used to
14083         track the activation frames for various local variables.   
14084
14085         Each toplevel block has an optional capture context associated
14086         with it.  When a method contains an anonymous method both the
14087         toplevel method and the anonymous method will create a capture
14088         context.   When variables or parameters are captured, they are
14089         recorded on the CaptureContext that owns them, for example:
14090
14091         void Demo () {
14092              int a;
14093              MyDelegate d = delegate {
14094                  a = 1;
14095              }
14096         }
14097
14098         Here `a' will be recorded as captured on the toplevel
14099         CapturedContext, the inner captured context will not have anything
14100         (it will only have data if local variables or parameters from it
14101         are captured in a nested anonymous method.
14102
14103         The ScopeInfo is used to track the activation frames for local
14104         variables, for example:
14105
14106         for (int i = 0; i < 10; i++)
14107                 for (int j = 0; j < 10; j++){
14108                    MyDelegate d = delegate {
14109                         call (i, j);
14110                    }
14111                 }
14112
14113         At runtime this captures a single captured variable `i', but it
14114         captures 10 different versions of the variable `j'.  The variable
14115         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14116         recorded on a child.  
14117
14118         The toplevel ScopeInfo will also track information like the `this'
14119         pointer if instance variables were referenced (this is necessary
14120         as the anonymous method lives inside a nested class in the host
14121         type of the method). 
14122
14123         (AnonymousMethod): Expanded to track the Toplevel, implement
14124         `AnonymousMethod.Compatible' to tell whether an anonymous method
14125         can be converted to a target delegate type. 
14126
14127         The routine now also produces the anonymous method content
14128
14129         (AnonymousDelegate): A helper class that derives from
14130         DelegateCreation, this is used to generate the code necessary to
14131         produce the delegate for the anonymous method that was created. 
14132
14133         * assign.cs: API adjustments for new changes in
14134         Convert.ImplicitStandardConversionExists.
14135
14136         * class.cs: Adjustments to cope with the fact that now toplevel
14137         blocks are of type `ToplevelBlock'. 
14138
14139         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14140         insteda of standard blocks.
14141
14142         Flag errors if params arguments are passed to anonymous methods.
14143
14144         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14145         `CurrentAnonymousMethod' which points to the current Anonymous
14146         Method.  The variable points to the AnonymousMethod class that
14147         holds the code being compiled.  It is set in the new EmitContext
14148         created for the anonymous method.
14149
14150         (EmitContext.Phase): Introduce a variable and an enumeration to
14151         assist in enforcing some rules about when and where we are allowed
14152         to invoke certain methods (EmitContext.NeedsReturnLabel is the
14153         only one that enfonces this right now).
14154
14155         (EmitContext.HaveCaptureInfo): new helper method that returns
14156         whether we have a CapturedContext initialized.
14157
14158         (EmitContext.CaptureVariable): New method used to register that a
14159         LocalInfo must be flagged for capturing. 
14160
14161         (EmitContext.CapturedParameter): New method used to register that a
14162         parameters must be flagged for capturing. 
14163         
14164         (EmitContext.CapturedField): New method used to register that a
14165         field must be flagged for capturing. 
14166
14167         (EmitContext.HaveCapturedVariables,
14168         EmitContext.HaveCapturedFields): Return whether there are captured
14169         variables or fields. 
14170
14171         (EmitContext.EmitMethodHostInstance): This is used to emit the
14172         instance for the anonymous method.  The instance might be null
14173         (static methods), this (for anonymous methods that capture nothing
14174         and happen to live side-by-side with the current method body) or a
14175         more complicated expression if the method has a CaptureContext.
14176
14177         (EmitContext.EmitTopBlock): Routine that drives the emission of
14178         code: it will first resolve the top block, then emit any metadata
14179         and then emit the code.  The split is done so that we can extract
14180         any anonymous methods and flag any captured variables/parameters.
14181         
14182         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14183         during this phase, the ILGenerator should not be used as labels
14184         and local variables declared here might not be accessible to any
14185         code that is part of an anonymous method.  
14186
14187         Exceptions to this include the temporary variables that are
14188         created by some statements internally for holding temporary
14189         variables. 
14190         
14191         (EmitContext.EmitMeta): New routine, in charge of emitting all the
14192         metadata for a cb
14193
14194         (EmitContext.TemporaryReturn): This method is typically called
14195         from the Emit phase, and its the only place where we allow the
14196         ReturnLabel to be defined other than the EmitMeta.  The reason is
14197         that otherwise we would have to duplicate a lot of logic in the
14198         Resolve phases of various methods that today is on the Emit
14199         phase. 
14200
14201         (EmitContext.NeedReturnLabel): This no longer creates the label,
14202         as the ILGenerator is not valid during the resolve phase.
14203
14204         (EmitContext.EmitThis): Extended the knowledge in this class to
14205         work in anonymous methods in addition to iterators. 
14206
14207         (EmitContext.EmitCapturedVariableInstance): This emits whatever
14208         code is necessary on the stack to access the instance to a local
14209         variable (the variable will be accessed as a field).
14210
14211         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14212         EmitContext.EmitAddressOfParameter): Routines to support
14213         parameters (not completed at this point). 
14214         
14215         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
14216         will also remove the parameters.
14217
14218         * convert.cs (Convert): Define a `ConstantEC' which points to a
14219         null.  This is just to prefity some code that uses
14220         ImplicitStandardConversion code and do not have an EmitContext
14221         handy.
14222
14223         The idea is to flag explicitly that at that point in time, it is
14224         known that the conversion will not trigger the delegate checking
14225         code in implicit conversions (which requires a valid
14226         EmitContext). 
14227
14228         Everywhere: pass new EmitContext parameter since
14229         ImplicitStandardConversionExists now requires it to check for
14230         anonymous method conversions. 
14231
14232         (Convert.ImplicitStandardConversionExists): If the type of an
14233         expression is the anonymous_method_type, and the type is a
14234         delegate, we invoke the AnonymousMethod.Compatible method to check
14235         whether an implicit conversion is possible. 
14236
14237         (Convert.ImplicitConversionStandard): Only do implicit method
14238         group conversions if the language level is not ISO_1.
14239
14240         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14241         MethodInfo for the Invoke method.  used by Delegate and
14242         AnonymousDelegate.
14243
14244         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14245         method conversions if the target type is a delegate.
14246
14247         Removed extra debugging nops.
14248
14249         (LocalVariableReference): Turn the `local_info' into a public
14250         field. 
14251
14252         Add `prepared' field, the same hack used for FieldExprs to cope
14253         with composed assignments, as Local variables do not necessarily
14254         operate purely on the stack as they used to: they can be captured
14255         fields. 
14256
14257         Add `temp' for a temporary result, like fields.
14258
14259         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14260
14261         It now copes with Local variables that are captured and emits the
14262         proper instance variable to load it from a field in the captured
14263         case. 
14264
14265         (ParameterReference.DoResolveBase): During the resolve phase,
14266         capture parameters if we are in an anonymous method.
14267
14268         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14269         anonymous method, use the EmitContext helper routines to emit the
14270         parameter reference.
14271
14272         * iterators.cs: Set RemapToProxy to true/false during the
14273         EmitDispose class.
14274
14275         * parameters.cs (GetParameterByName): New helper method. 
14276
14277         * typemanager.cs (anonymous_method_type) a new type that
14278         represents an anonyous method.  This is always an internal type,
14279         used as a fencepost to test against the anonymous-methodness of an
14280         expression. 
14281         
14282 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14283
14284         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14285         561 report.
14286         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14287
14288 2004-10-18  Martin Baulig  <martin@ximian.com>
14289
14290         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14291         `Type' directly, but call ResolveType() on it.
14292         (Catch.Resolve): Likewise.
14293         (Foreach.Resolve): Likewise.
14294
14295 2004-10-18  Martin Baulig  <martin@ximian.com>
14296
14297         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14298         `Type' directly, but call ResolveType() on it.
14299         (Probe.DoResolve): Likewise.
14300         (ArrayCreation.LookupType): Likewise.
14301         (TypeOf.DoResolve): Likewise.
14302         (SizeOf.DoResolve): Likewise.
14303
14304 2004-10-18  Martin Baulig  <martin@ximian.com>
14305
14306         * expression.cs (Invocation.BetterFunction): Put back
14307         TypeManager.TypeToCoreType().
14308
14309 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14310
14311         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14312         the ResolveType.
14313
14314 2004-10-18  Martin Baulig  <martin@ximian.com>
14315
14316         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14317         `Type' directly, but call ResolveType() on it.
14318
14319 2004-10-18  Martin Baulig  <martin@ximian.com>
14320
14321         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14322         `Type' directly, but call ResolveType() on it.
14323         (MemberBase.DoDefine): Likewise.
14324
14325         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14326         `Type' directly, but call ResolveType() on it.
14327         (ComposedCast.DoResolveAsTypeStep): Likewise.
14328
14329         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14330         `Type' directly, but call ResolveType() on it.
14331
14332 2004-10-17  John Luke  <john.luke@gmail.com>
14333
14334         * class.cs (Operator.GetSignatureForError): use CSharpName
14335
14336         * parameter.cs (Parameter.GetSignatureForError): Returns
14337         correct name even if was not defined.
14338
14339 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14340
14341         Fix #65816.
14342         * class.cs (TypeContainer.EmitContext): New property.
14343         (DefineNestedTypes): Create an emitcontext for each part.
14344         (MethodCore.DoDefineParameters): Use container's emitcontext.
14345         Pass type array to InternalParameters.
14346         (MemberBase.DoDefine): Use container's emitcontext.
14347         (FieldMember.Define): Likewise.
14348         (Event.Define): Likewise.
14349         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14350         Pass type array to InternalParameters.
14351         (SetIndexerMethod.GetParameterInfo): Likewise.
14352         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14353         * delegate.cs (Define): Pass emitcontext to
14354         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14355         array to InternalParameters.
14356         * expression.cs (ParameterReference.DoResolveBase): Pass
14357         emitcontext to GetParameterInfo.
14358         (ComposedCast.DoResolveAsTypeStep): Remove check on
14359         ec.ResolvingTypeTree.
14360         * parameter.cs (Parameter.Resolve): Change argument to
14361         EmitContext.  Use ResolveAsTypeTerminal.
14362         (Parameter.GetSignature): Change argument to EmitContext.
14363         (Parameters.ComputeSignature): Likewise.
14364         (Parameters.ComputeParameterTypes): Likewise.
14365         (Parameters.GetParameterInfo): Likewise.
14366         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14367         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14368         * support.cs (InternalParameters..ctor): Remove variant that takes
14369         a DeclSpace.
14370         * typemanager.cs (system_intptr_expr): New.
14371         (InitExpressionTypes): Initialize it.
14372
14373 2004-10-12  Chris Toshok  <toshok@ximian.com>
14374
14375         * cs-parser.jay: fix location for try_statement and catch_clause.
14376
14377 2004-10-11  Martin Baulig  <martin@ximian.com>
14378
14379         * report.cs: Don't make --fatal abort on warnings, we have
14380         -warnaserror for that.
14381
14382 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14383
14384         More DeclSpace.ResolveType avoidance.
14385         * decl.cs (MemberCore.InUnsafe): New property.
14386         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14387         with newly created EmitContext.
14388         (FieldMember.Define): Likewise.
14389         * delegate.cs (Delegate.Define): Likewise.
14390         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14391         only if normal name-lookup fails.
14392         (TypeExpr.DoResolve): Enable error-checking.
14393         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14394         (SizeOf.DoResolve): Likewise.
14395         (ComposedCast.DoResolveAsTypeStep): Likewise.
14396         (StackAlloc.DoResolve): Likewise.
14397         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14398         (Block.Unsafe): New property.
14399         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14400         (Unsafe): Set 'unsafe' flag of contained block.
14401         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14402         (Fixed.Resolve): Likewise.
14403         (Catch.Resolve): Likewise.
14404         (Using.ResolveLocalVariableDecls): Likewise.
14405         (Foreach.Resolve): Likewise.
14406
14407 2004-10-05  John Luke <john.luke@gmail.com>
14408
14409         * cs-parser.jay: add location to error CS0175
14410
14411 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14412
14413         * ecore.cs (Expression.Constantity): Add support for turning null
14414         into a constant.
14415
14416         * const.cs (Const.Define): Allow constants to be reference types
14417         as long as the value is Null.
14418
14419 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14420
14421         * namespace.cs (NamespaceEntry.Using): No matter which warning
14422         level is set, check if this namespace name has already been added.
14423
14424 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14425
14426         * expression.cs: reftype [!=]= null should always use br[true,false].
14427         # 67410
14428
14429 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14430
14431         Fix #67108
14432         * attribute.cs: Enum conversion moved to 
14433         GetAttributeArgumentExpression to be applied to the all
14434         expressions.
14435
14436 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14437
14438         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14439         * class.c (TypeContainer.DefineType): Flag error if
14440         base types aren't accessible due to access permissions.
14441         * decl.cs (DeclSpace.ResolveType): Move logic to
14442         Expression.ResolveAsTypeTerminal.
14443         (DeclSpace.ResolveTypeExpr): Thin layer over
14444         Expression.ResolveAsTypeTerminal.
14445         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14446         Refactor code into NestedAccess.  Use it.
14447         (DeclSpace.NestedAccess): New.
14448         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14449         argument to silence errors.  Check access permissions.
14450         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14451         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14452         (Cast.DoResolve): Likewise.
14453         (New.DoResolve): Likewise.
14454         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14455         (TypeOf.DoResolve): Likewise.
14456
14457         * expression.cs (Invocation.BetterConversion): Return the Type of
14458         the better conversion.  Implement section 14.4.2.3 more faithfully.
14459         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14460         section 14.4.2.2 explicit.
14461         (Invocation.OverloadResolve): Update.
14462         (Invocation): Remove is_base field.
14463         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14464         (Invocation.Emit): Likewise.
14465
14466 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14467
14468         * README: Update to changes.
14469
14470 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14471
14472         * cs-parser.jay: Reverted 642 warning fix.
14473
14474 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14475
14476         Fix bug #66615
14477         * decl.cs (FindMemberWithSameName): Indexer can have more than
14478         1 argument.
14479
14480 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14481
14482         * expression.cs (LocalVariableReference.DoResolveLValue):
14483         Do not report warning 219 for out values.
14484         (EmptyExpression.Null): New member to avoid extra allocations.
14485
14486 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14487
14488         * cs-parser.jay: Fix wrong warning 642 report.
14489
14490         * cs-tokenizer.cs (CheckNextToken): New helper;
14491         Inspect next character if is same as expected.
14492
14493 2004-09-23  Martin Baulig  <martin@ximian.com>
14494
14495         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14496         (Convert.ImplicitReferenceConversionExists): Likewise.
14497
14498 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14499
14500         * class.cs (Operator.Define): Add error 448 and 559 report.
14501
14502 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14503
14504         * class.cs (MemberBase.IsTypePermitted): New protected
14505         method for checking error CS0610.
14506
14507 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14508
14509         * class.cs (TypeContainer.HasExplicitLayout): New property
14510         Returns whether container has StructLayout attribute set Explicit.
14511         (FieldMember): New abstract class for consts and fields.
14512         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14513         (Field): Reuse FieldMember.
14514
14515         * const.cs (Const): Reuse FieldMember.
14516
14517         * rootcontext.cs: EmitConstants call moved to class.
14518
14519 2004-09-22  Martin Baulig  <martin@ximian.com>
14520
14521         Thanks to Peter Sestoft for this bug report.
14522
14523         * expression.cs (Conditional): If both the `trueExpr' and the
14524         `falseExpr' is a NullLiteral, return a NullLiteral.
14525
14526 2004-09-22  Martin Baulig  <martin@ximian.com>
14527
14528         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14529         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14530         for the "get_Current" call.
14531
14532 2004-09-22  Martin Baulig  <martin@ximian.com>
14533
14534         Marek and me just fixed one of our oldest bugs: #28562 :-)
14535
14536         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14537
14538         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14539         we're an EnumConstant, just return that.
14540         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14541         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14542         to get the value which'll actually be written into the attribute.
14543         However, we have to use GetValue() to access the attribute's value
14544         in the compiler.        
14545
14546 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14547
14548         * constant.cs (Constant.IsNegative): New abstract property
14549         IsNegative.
14550
14551         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14552         (StackAlloc.DoResolve): Reused IsNegative.
14553
14554 2004-09-21  Martin Baulig  <martin@ximian.com>
14555
14556         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14557         if we're used in an iterator, we may be called from different
14558         methods.
14559
14560         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14561         we actually have an exception block.
14562
14563 2004-09-20  John Luke <jluke@cfl.rr.com>
14564
14565         * class.cs, cs-parser.jay: Improve the error report for 1520:
14566         report the actual line where the error happens, not where the
14567         class was declared.
14568
14569         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14570         Pass location information that was available elsewhere.
14571
14572 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14573
14574         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14575         runtime to delay sign assemblies.
14576
14577 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14578
14579         * cs-parser.jay: Do not report the stack trace, this is barely
14580         used nowadays.
14581
14582 2004-08-22  John Luke  <john.luke@gmail.com>
14583  
14584         * driver.cs : check that a resource id is not already used
14585         before adding it, report CS1508 if it is, bug #63637
14586
14587 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14588
14589         * ecore.cs: Removed dead code.
14590
14591 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14592
14593         * class.cs: Do not report warning CS0067 on the interfaces.
14594
14595 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14596
14597         * cs-parser.jay: Add error 504 report.
14598
14599 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14600
14601         * rootcontext.cs: WarningLevel is 4 by default now.
14602
14603         * statement.cs (Fixed.Resolve): Do not null
14604         VariableInfo.
14605
14606 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14607
14608         Fixed bug #55780
14609         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14610         deep search when property is not virtual.
14611         (PropertyExpr.ResolveAccessors): Make one call for both
14612         accessors.
14613
14614 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14615
14616         Fixed bug #65766
14617         * statement.cs: Error 152 report constains also location.
14618
14619 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14620
14621         Fixed bug #65766
14622         * const.cs: Explicitly set constant as static.
14623
14624 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14625
14626         Fixed bug #64226
14627         * cs-parser.jay: Add error 1017 report.
14628
14629 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14630
14631         Fixed bug #59980, #64224
14632         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14633
14634         * typemanager.cs (IsSpecialMethod): Simplified
14635
14636 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14637
14638         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14639         condition with better params.
14640
14641 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14642
14643         Fixed bug #65238
14644         * attribute.cs (Resolve): Property has to have both
14645         accessors.
14646
14647 2004-09-14  Martin Baulig  <martin@ximian.com>
14648
14649         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14650
14651 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14652
14653         Fixed bug #61902
14654         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14655         called and is obsolete then this member suppress message
14656         when call is inside next [Obsolete] method or type.
14657
14658         * expression.cs: Use TestObsoleteMethodUsage member.
14659
14660 2004-09-14  Martin Baulig  <martin@ximian.com>
14661
14662         * cs-parser.jay: Sync a bit with the GMCS version.
14663
14664 2004-09-14  Martin Baulig  <martin@ximian.com>
14665
14666         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14667         (CSharpParser.yacc_verbose_flag): New public field.
14668
14669         * genericparser.cs: Removed.
14670
14671 2004-09-14  Raja R Harinath  <rharinath@novell.com>
14672
14673         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14674
14675 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
14676
14677         * class.cs (MethodCore.CheckBase): Fix bug #65757.
14678
14679 2004-09-10  Martin Baulig  <martin@ximian.com>
14680
14681         Backported my MemberName changes from GMCS into MCS.
14682
14683         - we are now using a special `MemberName' class instead of using
14684         strings; in GMCS, the `MemberName' also contains the type
14685         arguments.
14686
14687         - changed the grammar rules a bit:
14688           * the old `member_name' is now a `namespace_or_type_name':
14689             The rule is that we use `namespace_or_type_name' everywhere
14690             where we expect either a "member name" (GetEnumerator) or a
14691             "member name" with an explicit interface name
14692             (IEnumerable.GetEnumerator).
14693             In GMCS, the explicit interface name may include type arguments
14694             (IEnumerable<T>.GetEnumerator).
14695           * we use `member_name' instead of just `IDENTIFIER' for
14696             "member names":
14697             The rule is that we use `member_name' wherever a member may
14698             have type parameters in GMCS.       
14699
14700         * decl.cs (MemberName): New public class.
14701         (MemberCore.MemberName): New public readonly field.
14702         (MemberCore.ctor): Take a `MemberName' argument, not a string.
14703         (DeclSpace): Likewise.
14704
14705         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14706         * enum.cs (Enum.ctor): Likewise.
14707
14708         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14709         MemberName.     
14710         (AliasEntry.ctor): Take a MemberName, not an Expression.
14711         (AliasEntry.UsingAlias): Likewise.
14712
14713         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14714         (IMethodData.MemberName): Changed type from string to MemberName.
14715         (MemberBase.ExplicitInterfaceName): Likewise.
14716         (AbstractPropertyEventMethod.SetupName): Make this private.
14717         (AbstractPropertyEventMethod.ctor): Added `string prefix'
14718         argument; compute the member name here.
14719         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14720         on the `member.MemberName' and the `prefix'.
14721
14722         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14723         not `type_name'.
14724         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14725         thus, we get a `MemberName' instead of a `string'.  These
14726         declarations may have type parameters in GMCS.
14727         (interface_method_declaration, delegate_declaration): Likewise.
14728         (class_declaration, interface_declaration): Likewise.
14729         (method_header): Use `namespace_or_type_name' instead of
14730         `member_name'.  We may be an explicit interface implementation.
14731         (property_declaration, event_declaration): Likewise.
14732         (member_name): This is now just an `IDENTIFIER', not a
14733         `namespace_or_type_name'.
14734         (type_name, interface_type): Removed.
14735         (namespace_or_type_name): Return a MemberName, not an Expression.
14736         (primary_expression): Use `member_name' instead of `IDENTIFIER';
14737         call GetTypeExpression() on the MemberName to get an expression.
14738         (IndexerDeclaration.interface_type): Changed type from string to
14739         MemberName.
14740         (MakeName): Operate on MemberName's instead of string's.
14741
14742 2004-09-13  Raja R Harinath  <rharinath@novell.com>
14743
14744         Fix bug #55770.
14745         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14746         (NamespaceEntry.Lookup): Add new argument to flag if we want the
14747         lookup to avoid symbols introduced by 'using'.
14748         * rootcontext.cs (NamespaceLookup): Update.
14749
14750 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14751
14752         * class.cs (TypeContainer.DoDefineMembers): Do not call
14753         DefineDefaultConstructor for static classes.
14754
14755 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14756
14757         * attribute.cs (Attribute.Resolve): Add error 653 report.
14758
14759         * class.cs (Class.ApplyAttributeBuilder): Add error 641
14760         report.
14761         (Method.ApplyAttributeBuilder): Add error 685 report.
14762         (Operator.Define): Add error 564 report.
14763
14764         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14765
14766         * expression.cs (Invocation.DoResolve): Add error
14767         245 and 250 report.
14768
14769         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14770         error 674 report.
14771
14772 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14773
14774         * class.cs (ConstructorInitializer.Resolve):
14775         Wrong error number (515->516).
14776
14777 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14778
14779         * class.cs (Indexer.Define): Add error 631 report.
14780
14781 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14782
14783         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14784
14785 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14786
14787         * expression.cs (Probe.DoResolve): Add error CS0241 report.
14788
14789 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
14790
14791         * cs-parser.jay: Added error CS0241 report.
14792
14793 2004-09-10  Raja R Harinath  <rharinath@novell.com>
14794
14795         * cs-parser.jay (fixed_statement): Introduce a scope for the
14796         declaration in the 'fixed' statement.
14797
14798 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14799
14800         * cs-parser.jay: Added CS0230 error report.
14801
14802 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14803
14804         * cs-parser.jay: Added errors CS0231 and CS0257 report.
14805
14806 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14807
14808         * expression.cs (Argument.Resolve): Added error CS0192 and
14809         CS0199 report.
14810
14811 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14812
14813         C# 2.0 #pragma warning feature
14814
14815         * cs-tokenizer.cs (PreProcessPragma): New method; 
14816         Handles #pragma directive.
14817
14818         * report.cs (WarningRegions): New class; Support
14819         class for #pragma warning directive. It tests whether
14820         warning is enabled for a given line.
14821
14822 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
14823
14824         * const.cs: Add more descriptive error report, tahnks to
14825         Sebastien. 
14826
14827 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
14828
14829         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14830
14831 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
14832
14833         * expression.cs: Apply patch from Ben: Remove dead code from
14834         ArrayCreation, and remove the TurnintoConstant call in const.cs,
14835         as that code just threw an exception anwyays.
14836
14837         * const.cs: Remove the call to the turnintoconstant, for details
14838         see bug: #63144
14839         
14840         * literal.cs: The type of the null-literal is the null type;  So
14841         we use a placeholder type (literal.cs:System.Null, defined here)
14842         for it.
14843
14844         * expression.cs (Conditional.DoResolve): Remove some old code that
14845         is no longer needed, conversions have been fixed.
14846
14847         (ArrayCreationExpression.DoResolve): Return false if we fail to
14848         resolve the inner expression.
14849
14850 2004-09-07  Raja R Harinath  <rharinath@novell.com>
14851
14852         Fix test-290.cs.
14853         * cs-parser.jay (delegate_declaration): Record a delegate
14854         declaration as a type declaration.
14855         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14856
14857 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
14858
14859         * parameter.cs: Do not crash if the type can not be resolved. 
14860
14861         * expression.cs: Report errors with unsafe pointers, fixes #64896
14862
14863 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14864
14865         * expression.cs: Pointer arith always needs to do a conv.i
14866         if the operand is a long. fix 65320
14867
14868 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14869
14870         Fixed cs0619-37.cs, cs0619-38.cs
14871
14872         * enum.cs (GetObsoleteAttribute): Removed.
14873
14874         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14875         on Enum member is double staged. The first is tested member
14876         and then enum.
14877
14878 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14879
14880         Fixed #56986, #63631, #65231
14881
14882         * class.cs: (TypeContainer.AddToMemberContainer): New method,
14883         adds member to name container.
14884         (TypeContainer.AddToTypeContainer): New method, adds type to
14885         name container.
14886         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14887         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14888         AddOperator): Simplified by reusing AddToMemberContainer.
14889         (TypeContainer.UserDefinedStaticConstructor): Changed to property
14890         instead of field.
14891         (Method.CheckForDuplications): Fixed implementation to test all
14892         possibilities.
14893         (MemberBase): Detection whether member is explicit interface
14894         implementation is now in constructor.
14895         (MemberBase.UpdateMemberName): Handles IndexerName.
14896         (Accessor): Changed to keep also location information.
14897         (AbstractPropertyEventMethod): Is derived from MemberCore.
14898         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14899         will be emited or not.
14900         (PropertyBase.AreAccessorsDuplicateImplementation):
14901         Tests whether accessors are not in collision with some method.
14902         (Operator): Is derived from MethodCore to simplify common
14903         operations.
14904
14905         * decl.cs (Flags.TestMethodDuplication): Test for duplication
14906         must be performed.
14907         (DeclSpace.AddToContainer): Adds the member to defined_names
14908         table. It tests for duplications and enclosing name conflicts.
14909
14910         * enum.cs (EnumMember): Clean up to reuse the base structures
14911
14912 2004-09-03  Martin Baulig  <martin@ximian.com>
14913
14914         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14915         into TypeContainer, to make partial classes work again.
14916
14917 2004-09-03  Martin Baulig  <martin@ximian.com>
14918
14919         * rootcontext.cs (RootContext.V2): Removed.
14920
14921 2004-03-23  Martin Baulig  <martin@ximian.com>
14922
14923         * expression.cs (Invocation.OverloadResolve): Added `bool
14924         may_fail' argument and use it instead of the Location.IsNull() hack.
14925
14926 2004-09-03  Martin Baulig  <martin@ximian.com>
14927
14928         Merged latest changes into gmcs.  Please keep this comment in
14929         here, it makes it easier for me to see what changed in MCS since
14930         the last time I merged.
14931
14932 2004-09-03  Raja R Harinath  <rharinath@novell.com>
14933
14934         Fix #61128.
14935         * expression.cs (BetterConversion): Don't allow either conversion 
14936         to be null.  Remove redundant implicit conversion test when 'q ==
14937         null' -- when this function is invoked, we already know that the
14938         implicit conversion exists.
14939         (BetterFunction): Assume that 'best' is non-null.  Remove
14940         redundant reimplementation of IsApplicable when 'best' is null.
14941         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14942         number of arguments.
14943         (IsAncestralType): Extract from OverloadResolve.
14944         (OverloadResolve): Make robust to the MethodGroupExpr being
14945         unsorted.  Implement all the logic of Section 14.5.5.1, and
14946         support overloading of methods from multiple applicable types.
14947         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
14948
14949         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14950         (RealError, Warning): Append type of report to related symbol.
14951
14952 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
14953
14954         * enum.cs: Fixed CLS-Compliance checks for enum members.
14955         Error tests cs3008-8.cs, cs3014-8.cs
14956
14957 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14958
14959         Fixed bug #62342, #63102
14960         * class.cs: ImplementIndexer uses member.IsExplicitImpl
14961         like ImplementMethod.
14962
14963 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14964
14965         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14966         Fixed bug #65170.
14967
14968 2004-09-02  Martin Baulig  <martin@ximian.com>
14969
14970         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14971         TypeManager.GetArgumentTypes() rather than calling GetParameters()
14972         on the MethodBase.
14973
14974 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
14975
14976         C# 2.0 Static classes implemented
14977
14978         * class.cs (TypeContainer): instance_constructors,
14979         initialized_fields, initialized_static_fields,
14980         default_constructor, base_inteface_types are protected to be
14981         accessible from StaticClass.
14982         (TypeContainer.DefineDefaultConstructor): New virtual method
14983         for custom default constructor generating
14984         (StaticClass): New class to handle "Static classes" feature.
14985
14986         * cs-parser.jay: Handle static keyword on class like instance
14987         of StaticClass.
14988
14989         * driver.cs: Added "/langversion" command line switch with two
14990         options (iso-1, default).
14991
14992 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
14993
14994         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14995
14996 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
14997
14998         * delegate.cs: Style.
14999
15000 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15001
15002         * delegate.cs: Add seperate instance expr field for miguel.
15003
15004 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15005
15006         * PointerArithmetic (Resolve): make sure we are not doing
15007         pointer arith on void*. Also, make sure we are resolved
15008         by not setting eclass until resolve.
15009
15010         All callers: Make sure that PointerArithmetic gets resolved.
15011
15012 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15013
15014         * ArrayCreation (LookupType): If the type does not resolve 
15015         to an array, give an error.
15016
15017 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15018
15019         * statement.cs (Try.Resolve): Fixed bug #64222
15020
15021 2004-08-27  Martin Baulig  <martin@ximian.com>
15022
15023         * class.cs
15024         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15025         crash here.     
15026
15027 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15028
15029         * ecore.cs (Constantify): Get underlying type via
15030         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15031         Windows in special cases.
15032
15033 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15034
15035         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15036         for obtaining also private methods.
15037         (GetRemoveMethod): Used GetRemoveMethod (true)
15038         for obtaining also private methods.
15039
15040 2004-08-24  Martin Baulig  <martin@ximian.com>
15041
15042         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15043         MethodAttributes.HideBySig for operators.
15044
15045 2004-08-23  Martin Baulig  <martin@ximian.com>
15046
15047         Back to the old error reporting system :-)
15048
15049         * report.cs (Message): Removed.
15050         (Report.MessageData, ErrorData, WarningData): Removed.
15051         (Report.Error, Warning): Back to the old system.
15052
15053 2004-08-23  Martin Baulig  <martin@ximian.com>
15054
15055         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15056
15057         * class.cs (TypeContainer.ParentContainer): New public virtual
15058         method; replaces the explicit interface implementation.
15059         (ClassPart.ParentContainer): Override.
15060
15061 2004-08-23  Martin Baulig  <martin@ximian.com>
15062
15063         * statement.cs (Switch): Added support for constant switches; see
15064         #59428 or test-285.cs.
15065
15066 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15067
15068         Fixed bug #62740.
15069         * statement.cs (GetEnumeratorFilter): Removed useless
15070         logic because C# specs is strict. GetEnumerator must be
15071         public.
15072
15073 2004-08-22  Martin Baulig  <martin@ximian.com>
15074
15075         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15076         a switch and may break, reset the barrier.  Fixes #59867.
15077
15078 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15079
15080         CLS-Compliance speed up (~5% for corlib)
15081
15082         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15083         New method. Tests container for CLS-Compliant names
15084
15085         * class.cs (TypeContainer.VerifyClsName): New method.
15086         Checks whether container name is CLS Compliant.
15087         (Constructor): Implements IMethodData.
15088
15089         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15090         low-case table for CLS Compliance test.
15091         (MemberCache.VerifyClsParameterConflict): New method.
15092         Checks method parameters for CS3006 error.
15093
15094         * enum.cs (EnumMember): Is derived from MemberCore.
15095         (Enum.VerifyClsName): Optimized for better performance.
15096
15097 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15098
15099         * report.cs: Renamed Error_T to Error and changed all
15100         references.
15101
15102 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15103
15104         * class.cs (TypeContainer.IndexerArrayList): New inner class
15105         container for indexers.
15106         (TypeContainer.DefaultIndexerName): New constant for default
15107         indexer name. Replaced all "Item" with this constant.
15108         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15109
15110         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15111         DefaultMemberAttribute constructor.
15112
15113 2004-08-05  Martin Baulig  <martin@ximian.com>
15114
15115         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15116         Fix bug #59429.
15117
15118 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
15119
15120         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15121         multi platforms problem.
15122
15123         * compiler.csproj: Included shared files.
15124
15125 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15126
15127         Fix bug 60333, 55971 in the more general way
15128         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15129         Added arg_type argument for constant conversion.
15130         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15131
15132 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15133
15134         Fix bug #59760
15135         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
15136         OperatorArrayList, MethodCoreArrayList for typecontainer
15137         containers. Changed class member types to these new types.
15138         (MethodArrayList.DefineMembers): Added test for CS0659.
15139
15140 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
15141
15142         * cfold.cs: Synchronize the folding with the code in expression.cs
15143         Binary.DoNumericPromotions for uint operands.
15144
15145         * attribute.cs: Revert patch from Raja, it introduced a regression
15146         while building Blam-1.2.1 (hard to isolate a test case).
15147
15148 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15149
15150         Fix for #55382
15151         * class.cs:
15152         (TypeContainer.Define): Renamed to DefineContainerMembers because of
15153         name collision.
15154         (MethodCore.parent_method): New member. The method we're overriding
15155         if this is an override method.
15156         (MethodCore.CheckBase): Moved from Method class and made common.
15157         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15158         private.
15159         (MethodCore.CheckForDuplications): New abstract method. For custom
15160         member duplication search in a container
15161         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15162         method and its return type.
15163         (Event.conflict_symbol): New member. Symbol with same name in the
15164         parent class.
15165
15166         * decl.cs:
15167         (MemberCache.FindMemberWithSameName): New method. The method
15168         is looking for conflict with inherited symbols.
15169
15170 2004-08-04  Martin Baulig  <martin@ximian.com>
15171
15172         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15173
15174         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15175
15176 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15177
15178         * report.cs (Message): New enum for better error, warning reference in
15179         the code.
15180         (MessageData): New inner abstract class. It generally handles printing of
15181         error and warning messages.
15182         Removed unused Error, Warning, Message methods.
15183
15184 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15185
15186         Fix for cs0592-8.cs test
15187         * attribute.cs
15188         (Attributable.ValidAttributeTargets): Made public.
15189         (Attribute.ExplicitTarget): New member for explicit target value.
15190         (Attribute.CheckTargets): Now we translate explicit attribute
15191         target to Target here.
15192
15193 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
15194
15195         * ecore.cs (MethodGroupExpr): new IsBase property.
15196
15197         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15198
15199         * delegate.cs (DelegateCreation): store a MethodGroupExpr
15200         rather than an instance expr.
15201
15202         (DelegateCreation.Emit): Use the method group rather than
15203         the instance expression. Also, if you have base.Foo as the
15204         method for a delegate, make sure to emit ldftn, not ldftnvirt.
15205
15206         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
15207
15208         (NewDelegate.DoResolve): Only check for the existance of Invoke
15209         if the method is going to be needed. Use MethodGroupExpr.
15210
15211         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
15212
15213         * expression.cs: For pointer arith., make sure to use
15214         the size of the type, not the size of the pointer to
15215         the type.
15216
15217 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15218
15219         Fix for #60722
15220         * class.cs (Class): Added error CS0502 test.
15221
15222 2004-08-03  John Luke  <jluke@cfl.rr.com>
15223             Raja R Harinath  <rharinath@novell.com>
15224
15225         Fix for #60997.
15226         * attribute.cs (Attribute.complained_before): New flag.
15227         (Attribute.ResolveType, Attribute.Resolve),
15228         (Attribute.DefinePInvokeMethod): Set it.
15229         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15230         
15231 2004-08-03  Martin Baulig  <martin@ximian.com>
15232
15233         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15234         use a user-defined operator; we still need to do numeric
15235         promotions in case one argument is a builtin type and the other
15236         one has an implicit conversion to that type.  Fixes #62322.
15237
15238 2004-08-02  Martin Baulig  <martin@ximian.com>
15239
15240         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15241         (LocalInfo.IsThis): New public property.
15242         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15243
15244 2004-08-01  Martin Baulig  <martin@ximian.com>
15245
15246         * class.cs (TypeContainer.GetClassBases): Don't set the default
15247         here since we may get called from GetPartialBases().
15248         (TypeContainer.DefineType): If GetClassBases() didn't return a
15249         parent, use the default one.
15250
15251 2004-07-30  Duncan Mak  <duncan@ximian.com>
15252
15253         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15254
15255 2004-07-30  Martin Baulig  <martin@ximian.com>
15256
15257         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15258
15259         * class.cs (SourceMethod): New public class, derive from the
15260         symbol writer's ISourceMethod.
15261         (Method): Use the new symbol writer API.
15262
15263         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15264         as argument and use the new symbol writer.
15265
15266         * location.cs
15267         (SourceFile): Implement the symbol writer's ISourceFile.
15268         (Location.SymbolDocument): Removed.
15269         (Location.SourceFile): New public property.
15270
15271         * symbolwriter.cs: Use the new symbol writer API.
15272
15273 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15274
15275         * Makefile (install-local): Remove.  Functionality moved to
15276         executable.make.
15277
15278 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15279
15280         * Makefile: Install mcs.exe.config file together with mcs.exe.
15281         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15282         correct runtime version.
15283         
15284 2004-07-25  Martin Baulig  <martin@ximian.com>
15285
15286         * class.cs
15287         (TypeContainer.RegisterOrder): Removed, this was unused.
15288         (TypeContainer, interface_order): Removed.
15289         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15290         TypeContainer as argument since we can also be called with a
15291         `PartialContainer' for a partial class/struct/interface.
15292         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15293         of checking whether we're an `Interface' - we could be a
15294         `PartialContainer'.
15295         (PartialContainer.Register): Override; call
15296         AddClass()/AddStruct()/AddInterface() on our parent.
15297
15298         * cs-parser.jay (interface_member_declaration): Add things to the
15299         `current_container', not the `current_class'.
15300
15301         * rootcontext.cs (RegisterOrder): The overloaded version which
15302         takes an `Interface' was unused, removed.
15303
15304         * typemanager.cs (TypeManager.LookupInterface): Return a
15305         `TypeContainer', not an `Interface'.
15306         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15307         contain a `PartialContainer' for an interface, so check it's
15308         `Kind' to figure out what it is.
15309
15310 2004-07-25  Martin Baulig  <martin@ximian.com>
15311
15312         * class.cs (Class.DefaultTypeAttributes): New public constant.
15313         (Struct.DefaultTypeAttributes): Likewise.
15314         (Interface.DefaultTypeAttributes): Likewise.
15315         (PartialContainer.TypeAttr): Override this and add the
15316         DefaultTypeAttributes.
15317
15318 2004-07-25  Martin Baulig  <martin@ximian.com>
15319
15320         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15321         we can just use the `Parent' field instead.
15322
15323 2004-07-25  Martin Baulig  <martin@ximian.com>
15324
15325         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15326
15327 2004-07-25  Martin Baulig  <martin@ximian.com>
15328
15329         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15330         our parts before defining any methods.
15331         (TypeContainer.VerifyImplements): Make this virtual.
15332         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15333         on our PartialContainer.
15334
15335 2004-07-25  Martin Baulig  <martin@ximian.com>
15336
15337         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15338
15339         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15340         argument, we can just use the `Parent' field instead.
15341
15342         * class.cs
15343         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15344         (MemberBase.DoDefine): Likewise.
15345
15346 2004-07-24  Martin Baulig  <martin@ximian.com>
15347
15348         * decl.cs (MemberCore.Parent): New public field.
15349         (DeclSpace.Parent): Moved to MemberCore.
15350
15351         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15352         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15353         parent's .ctor.
15354         (FieldBase, Field, Operator): Likewise.
15355         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15356         (EventField, Event): Likewise.
15357
15358 2004-07-23  Martin Baulig  <martin@ximian.com>
15359
15360         * class.cs (PartialContainer): New public class.
15361         (ClassPart): New public class.
15362         (TypeContainer): Added support for partial classes.
15363         (TypeContainer.GetClassBases): Splitted some of the functionality
15364         out into GetNormalBases() and GetPartialBases().
15365
15366         * cs-tokenizer.cs (Token.PARTIAL): New token.
15367         (Tokenizer.consume_identifier): Added some hacks to recognize
15368         `partial', but only if it's immediately followed by `class',
15369         `struct' or `interface'.
15370
15371         * cs-parser.jay: Added support for partial clases.
15372
15373 2004-07-23  Martin Baulig  <martin@ximian.com>
15374
15375         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15376         a `DeclSpace' and also made it readonly.
15377         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15378         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15379         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15380
15381         * cs-parser.jay: Pass the `current_class', not the
15382         `current_container' (at the moment, this is still the same thing)
15383         to a new Method, Property, Event, Indexer or Constructor.
15384
15385 2004-07-23  Martin Baulig  <martin@ximian.com>
15386
15387         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15388         and removed the `current_interface' one.
15389         (struct_declaration, class_declaration, interface_declaration):
15390         Set `current_class' to the newly created class/struct/interface;
15391         set their `Bases' and call Register() before parsing their body.
15392
15393 2004-07-23  Martin Baulig  <martin@ximian.com>
15394
15395         * class.cs (Kind): New public enum.
15396         (TypeContainer): Made this class abstract.
15397         (TypeContainer.Kind): New public readonly field.
15398         (TypeContainer.CheckDef): New public method; moved here from
15399         cs-parser.jay.
15400         (TypeContainer.Register): New public abstract method.
15401         (TypeContainer.GetPendingImplementations): New public abstract
15402         method.
15403         (TypeContainer.GetClassBases): Removed the `is_class' and
15404         `is_iface' parameters.
15405         (TypeContainer.DefineNestedTypes): Formerly known as
15406         DoDefineType().
15407         (ClassOrStruct): Made this class abstract.
15408
15409         * tree.cs (RootTypes): New public type. 
15410
15411 2004-07-20  Martin Baulig  <martin@ximian.com>
15412
15413         * tree.cs (Tree.RecordNamespace): Removed.
15414         (Tree.Namespaces): Removed.
15415
15416         * rootcontext.cs (RootContext.IsNamespace): Removed.
15417
15418         * cs-parser.jay (namespace_declaration): Just create a new
15419         NamespaceEntry here.
15420
15421 2004-07-20  Martin Baulig  <martin@ximian.com>
15422
15423         * statement.cs (ExceptionStatement): New abstract class.  This is
15424         now used as a base class for everyone who's using `finally'.
15425         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15426         our local variables before using them.
15427
15428         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15429         virtual method.  This is used by Yield.Resolve() to "steal" an
15430         outer block's `finally' clauses.
15431         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15432         argument.
15433
15434         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15435         version which takes an ExceptionStatement.  This version must be
15436         used to create exception branchings.
15437
15438         * iterator.cs
15439         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15440         (Iterator.EmitMoveNext): Added exception support; protect the
15441         block with a `fault' clause, properly handle 'finally' clauses.
15442         (Iterator.EmitDispose): Run all the `finally' clauses here.
15443
15444 2004-07-20  Martin Baulig  <martin@ximian.com>
15445
15446         * iterator.cs: This is the first of a set of changes in the
15447         iterator code.  Match the spec more closely: if we're an
15448         IEnumerable, then GetEnumerator() must be called.  The first time
15449         GetEnumerator() is called, it returns the current instance; all
15450         subsequent invocations (if any) must create a copy.
15451
15452 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15453
15454         * expression.cs: Resolve the constant expression before returning
15455         it. 
15456
15457 2004-07-19  Martin Baulig  <martin@ximian.com>
15458
15459         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15460         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15461         the return type of the new EmitContext.
15462
15463 2004-07-18  Martin Baulig  <martin@ximian.com>
15464
15465         * class.cs (Property.Define): Fix iterators.
15466
15467         * iterators.cs (Iterator.Define): Moved the
15468         `container.AddInterator (this)' call here from the .ctor; only do
15469         it if we resolved successfully.
15470
15471 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15472
15473         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15474         `true' for preprocessing directives that we parse.  The return
15475         value indicates whether we should return to regular tokenizing or
15476         not, not whether it was parsed successfully.
15477
15478         In the past if we were in: #if false ... #line #endif, we would
15479         resume parsing after `#line'.  See bug 61604.
15480
15481         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15482         building: IsEnumType should return true only for enums, not for
15483         enums or System.Enum itself.  This fixes #61593.
15484
15485         Likely what happened is that corlib was wrong: mcs depended on
15486         this bug in some places.  The bug got fixed, we had to add the
15487         hack, which caused bug 61593.
15488
15489         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15490         that was a workaround for the older conditions.
15491
15492 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15493
15494         * assign.cs: IAssignMethod has a new interface, as documented
15495         inline. All assignment code now uses this new api.
15496
15497         * ecore.cs, expression.cs: All classes which implement
15498         IAssignMethod now use the new interface.
15499
15500         * expression.cs (Invocation): add a hack to EmitCall so that
15501         IndexerAccess can be the target of a compound assignment without
15502         evaluating its arguments twice.
15503
15504         * statement.cs: Handle changes in Invocation api.
15505
15506 2004-07-16  Martin Baulig  <martin@ximian.com>
15507
15508         * iterators.cs: Rewrote this.  We're now using one single Proxy
15509         class for both the IEnumerable and the IEnumerator interface and
15510         `Iterator' derives from Class so we can use the high-level API.
15511
15512         * class.cs (TypeContainer.AddIterator): New method.
15513         (TypeContainer.DoDefineType): New protected virtual method, which
15514         is called from DefineType().
15515         (TypeContainer.DoDefineMembers): Call DefineType() and
15516         DefineMembers() on all our iterators.
15517         (TypeContainer.Emit): Call Emit() on all our iterators.
15518         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15519
15520         * codegen.cs (EmitContext.CurrentIterator): New public field.
15521
15522 2004-07-15  Martin Baulig  <martin@ximian.com>
15523
15524         * typemanager.cs
15525         (TypeManager.not_supported_exception_type): New type.   
15526
15527 2004-07-14  Martin Baulig  <martin@ximian.com>
15528
15529         * iterators.cs: Use real error numbers.
15530
15531 2004-07-14  Martin Baulig  <martin@ximian.com>
15532
15533         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15534         requires this to be a System.Collection.IEnumerable and not a
15535         class implementing that interface.
15536         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15537
15538 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15539
15540         * class.cs: Fixed previous fix, it broke some error tests.
15541
15542 2004-07-12  Martin Baulig  <martin@ximian.com>
15543
15544         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15545         Fixes #61293.
15546
15547 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15548
15549         * assign.cs (LocalTemporary): Add new argument: is_address,If
15550         `is_address' is true, then the value that we store is the address
15551         to the real value, and not the value itself.
15552         
15553         * ecore.cs (PropertyExpr): use the new local temporary
15554         stuff to allow us to handle X.Y += z (where X is a struct)
15555
15556 2004-07-08  Martin Baulig  <martin@ximian.com>
15557
15558         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15559         not always return, just like we're doing in Using.Resolve().
15560
15561 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15562
15563         * cs-parser.jay (fixed_statement): flag this as Pinned.
15564
15565 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15566
15567         * typemanager.cs (TypeManager): Removed MakePinned method, this
15568         mechanism is replaced with the .NET 2.x compatible mechanism of
15569         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15570
15571         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15572         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15573         `IsFixed' property which has a different meaning.
15574
15575 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15576
15577         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15578         visible from inside a nested class, not just the names of the
15579         immediately enclosing class.
15580         Fix for bug #60730.
15581
15582 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15583
15584         * expression.cs (BetterConversion): Remove buggy special-case
15585         handling of "implicit constant expression conversions".  At this
15586         point, we already know that the conversion is possible -- we're
15587         only checking to see which is better.
15588
15589 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15590
15591         * cs-parser.jay: Added error CS0210 test.
15592
15593 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15594
15595         * cs-parser.jay: Added error CS0134 test.
15596
15597 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15598
15599         Fix bug #52507
15600         * cs-parser.jay: Added error CS0145 test.
15601
15602 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15603
15604         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15605
15606 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15607         
15608         * expression.cs (StackAlloc.Resolve): The argument may not
15609         be a constant; deal with this case.
15610         
15611 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15612
15613         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15614         GetIndexerAttributeValue.
15615         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15616
15617         * class.cs (Indexer.Define): Added error tests for CS0415,
15618         CS0609.
15619
15620 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15623         property code.
15624
15625 2004-06-23  Martin Baulig  <martin@ximian.com>
15626
15627         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15628         neither return nor throw, reset the barrier as well.  Fixes #60457.
15629
15630 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15631
15632         * class.cs : EventAttributes is now set to None by default.
15633           This fixes bug #60459.
15634
15635 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15636
15637         Fix bug #60219
15638         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15639         Don't throw exception but return null (it's sufficient now).
15640
15641 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15642
15643         * typemanager.cs (GetArgumentTypes): Faster implementation.
15644
15645 2004-06-18  Martin Baulig  <martin@ximian.com>
15646
15647         * attribute.cs (Attribute.Resolve): Check whether we're an
15648         EmptyCast which a Constant child.  Fixes #60333.
15649
15650 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
15651
15652         * statement.cs (EmitCollectionForeach): Account for the fact that
15653         not all valuetypes are in areas which we can take the address of.
15654         For these variables, we store to a temporary variable. Also, make
15655         sure that we dont emit a `callvirt' on a valuetype method.
15656
15657 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15658
15659         * expression.cs (StackAlloc.DoReSolve): Added test for
15660         negative parameter (CS0247).
15661
15662 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15663
15664         Fix bug #59792
15665         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15666
15667 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15668
15669         Fix bug #59781
15670         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15671         ulong.
15672
15673 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15674
15675         Fix bug #58254 & cs1555.cs, cs1556.cs
15676         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15677
15678 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15679
15680         * cs-parser.jay: Added error CS1669 test for indexers.
15681
15682 2004-06-11  Martin Baulig  <martin@ximian.com>
15683
15684         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15685         call this twice: for params and varargs methods.
15686
15687 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15688
15689         * class.cs:
15690         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15691
15692 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15693
15694         * attribute.cs (Attribute.GetValidTargets): Made public.
15695
15696         * class.cs: 
15697         (AbstractPropertyEventMethod): New class for better code sharing.
15698         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15699         CS1667 report.
15700         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15701
15702 2004-06-11  Raja R Harinath  <rharinath@novell.com>
15703
15704         Fix bug #59477.
15705         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15706         that the call to Resolve is part of a MemberAccess.
15707         (Expression.Resolve): Use it for SimpleName resolution.
15708         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15709         Add 'intermediate' boolean argument.
15710         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
15711         error message when the SimpleName can be resolved ambiguously
15712         between an expression and a type.
15713         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15714         public.
15715         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15716         call on the left-side.
15717
15718 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15719
15720         * class.cs:
15721         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15722
15723 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15724
15725         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15726
15727 2004-06-11  Martin Baulig  <martin@ximian.com>
15728
15729         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15730         varargs methods if applicable.
15731
15732 2004-06-11  Martin Baulig  <martin@ximian.com>
15733
15734         * expression.cs (Invocation.EmitCall): Don't use
15735         `method.CallingConvention == CallingConventions.VarArgs' since the
15736         method could also have `CallingConventions.HasThis'.
15737
15738 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15739
15740         * class.cs (Event.GetSignatureForError): Implemented.
15741         Fixed crash in error test cs3010.cs
15742
15743 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
15744
15745         * cs-tokenizer.cs: Change the way we track __arglist to be
15746         consistent with the other keywords.
15747
15748 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
15749
15750         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15751         tomorrow.
15752
15753 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
15754
15755         * codegen.cs: Check that all referenced assemblies have a strongname
15756         before strongnaming the compiled assembly. If not report error CS1577.
15757         Fix bug #56563. Patch by Jackson Harper.
15758         * typemanager.cs: Added a method to return all referenced assemblies.
15759         Fix bug #56563. Patch by Jackson Harper.
15760
15761 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15762
15763         * class.cs:
15764         (Method.ApplyAttributeBuilder): Moved and added conditional
15765         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15766
15767         * delegate.cs:
15768         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15769
15770 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15771
15772         Fixed #59640
15773         * class.cs: (EventField.attribute_targets): Changed default target.
15774
15775 2004-06-08  Martin Baulig  <martin@ximian.com>
15776
15777         * expression.cs (Invocation.EmitCall): Enable varargs methods.
15778
15779 2004-06-08  Martin Baulig  <martin@ximian.com>
15780
15781         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15782
15783 2004-06-07  Martin Baulig  <martin@ximian.com>
15784
15785         Added support for varargs methods.
15786
15787         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15788         keyword.
15789
15790         * cs-parser.jay: Added support for `__arglist'.
15791
15792         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15793
15794         * expression.cs (Argument.AType): Added `ArgList'.
15795         (Invocation): Added support for varargs methods.
15796         (ArglistAccess): New public class.
15797         (Arglist): New public class.
15798
15799         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15800
15801         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
15802         a method's top-level block if the method has varargs.
15803
15804         * support.cs (ReflectionParameters, InternalParameters): Added
15805         support for varargs methods.    
15806
15807 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
15808
15809         * class.cs: Provide location in indexer error report.
15810
15811         * driver.cs: Use standard names.
15812
15813         * namespace.cs: Catch the use of using after a namespace has been
15814         declared also on using aliases.
15815
15816 2004-06-03  Raja R Harinath  <rharinath@novell.com>
15817
15818         Bug #50820.
15819         * typemanager.cs (closure_private_ok, closure_invocation_type)
15820         (closure_qualifier_type, closure_invocation_assembly)
15821         (FilterWithClosure): Move to ...
15822         (Closure): New internal nested class.
15823         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15824         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15825         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15826         (MemberLookup, MemberLookupFailed): Use it.
15827         * expression.cs (New.DoResolve): Treat the lookup for the
15828         constructor as being qualified by the 'new'ed type.
15829         (Indexers.GetIndexersForTypeOrInterface): Update.
15830
15831 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
15832
15833         * attribute.cs
15834         (GetConditionalAttributeValue): New method. Returns
15835         condition of ConditionalAttribute.
15836         (SearchMulti): New method.  Returns all attributes of type 't'.
15837         Use it when attribute is AllowMultiple = true.
15838         (IsConditionalMethodExcluded): New method.
15839
15840         * class.cs
15841         (Method.IsExcluded): Implemented. Returns true if method has conditional
15842         attribute and the conditions is not defined (method is excluded).
15843         (IMethodData): Extended interface for ConditionalAttribute support.
15844         (PropertyMethod.IsExcluded): Implemented.
15845
15846         * decl.cs
15847         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15848
15849         * expression.cs
15850         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15851         on the method.
15852
15853 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15854
15855         * expression.cs (ArrayCreationExpression): Make this just an
15856         `expression'. It can't be a statement, so the code here was
15857         dead.
15858
15859 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15860
15861         Fixed #59072
15862         * typemanager.cs (GetFullNameSignature): New method for
15863         MethodBase types.
15864
15865 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15866
15867         Fixed #56452
15868         * class.cs (MemberBase.GetSignatureForError): New virtual method.
15869         Use this method when MethodBuilder is null.
15870         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15871         Added test for error CS0626 (MONO reports error for this situation).
15872         (IMethodData.GetSignatureForError): Extended interface.
15873
15874 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15875
15876         * attribute.cs
15877         (AttributeTester.GetObsoleteAttribute): Returns instance of
15878         ObsoleteAttribute when type is obsolete.
15879
15880         * class.cs
15881         (TypeContainer.VerifyObsoleteAttribute): Override.
15882         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15883         (MethodCode.VerifyObsoleteAttribute): Override.
15884         (MemberBase.VerifyObsoleteAttribute): Override.
15885
15886         * decl.cs
15887         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15888         and report proper error.
15889
15890         *delegate.cs
15891         Delegate.VerifyObsoleteAttribute): Override.
15892
15893         * ecore.cs
15894         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15895         and report proper error.
15896         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15897
15898         * enum.cs
15899         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15900         and enum member.
15901
15902         * expression.cs
15903         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15904         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15905         Added test for ObsoleteAttribute.
15906
15907         * statement.cs
15908         (Catch): Derived from Statement.
15909
15910 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15911  
15912         Fixed bug #59071 & cs0160.cs
15913  
15914         * statement.cs (Try.Resolve): Check here whether order of catch
15915         clauses matches their dependencies.
15916
15917 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
15920         caused a regression: #59343.  Referencing nested classes from an
15921         assembly stopped working.
15922
15923 2004-05-31  Martin Baulig  <martin@ximian.com>
15924
15925         MCS is now frozen for beta 2.
15926
15927 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15928
15929         * convert.cs: add a trivial cache for overload operator resolution.
15930
15931 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15932
15933         * decl.cs: If possible, use lookuptypedirect here. We can only do
15934         this if there is no `.' after the namespace. Avoids using
15935         LookupType, which does lots of slow processing.
15936         (FindNestedType) New method, does what it says :-).
15937         * namespace.cs: use LookupTypeDirect.
15938         * rootcontext.cs: use membercache, if possible.
15939         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15940
15941 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15942
15943         * expression.cs:
15944         According to the spec, 
15945
15946         In a member access of the form E.I, if E is a single identifier,
15947         and if the meaning of E as a simple-name (§7.5.2) is a constant,
15948         field, property, localvariable, or parameter with the same type as
15949         the meaning of E as a type-name (§3.8), then both possible
15950         meanings of E are permitted.
15951
15952         We did not check that E as a simple-name had the same type as E as
15953         a type name.
15954
15955         This trivial check gives us 5-7% on bootstrap time.
15956
15957 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15958
15959         * expression.cs (Invocation.OverloadResolve): Avoid the
15960         use of hashtables and boxing here by allocating on demand.
15961
15962 2004-05-30  Martin Baulig  <martin@ximian.com>
15963
15964         * rootcontext.cs (RootContext.LookupType): Don't cache things if
15965         we're doing a silent lookup.  Don't try to lookup nested types in
15966         TypeManager.object_type (thanks to Ben Maurer).
15967
15968 2004-05-30  Martin Baulig  <martin@ximian.com>
15969
15970         Committing a patch from Ben Maurer.
15971
15972         * rootcontext.cs (RootContext.LookupType): Cache negative results.
15973
15974 2004-05-29  Martin Baulig  <martin@ximian.com>
15975
15976         * class.cs (IMethodData.ShouldIgnore): New method.
15977
15978         * typemanager.cs (TypeManager.MethodFlags): Don't take a
15979         `Location' argument, we don't need it anywhere.  Use
15980         `IMethodData.ShouldIgnore ()' instead of
15981         `MethodData.GetMethodFlags ()'.
15982         (TypeManager.AddMethod): Removed.
15983         (TypeManager.AddMethod2): Renamed to AddMethod.
15984
15985 2004-05-29  Martin Baulig  <martin@ximian.com>
15986
15987         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15988
15989         * convert.cs (Convert.ImplicitReferenceConversion): If we're
15990         converting from a class type S to an interface type and we already
15991         have an object on the stack, don't box it again.  Fixes #52578.
15992
15993 2004-05-29  Martin Baulig  <martin@ximian.com>
15994
15995         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15996         Added support for `params' parameters.  Fixes #59267.
15997
15998 2004-05-29  Martin Baulig  <martin@ximian.com>
15999
16000         * literal.cs (NullPointer): Provide a private .ctor which sets
16001         `type' to TypeManager.object_type.  Fixes #59048.
16002
16003 2004-05-29  Martin Baulig  <martin@ximian.com>
16004
16005         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16006         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16007
16008         * ecore.cs (EventExpr.instance_expr): Make the field private.
16009
16010 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16011
16012         Fixed bug #50080 & cs0214-2.cs
16013         * expression.cs (Cast.DoResolve): Check unsafe context here.
16014         
16015         * statement.cs (Resolve.DoResolve): Likewise.
16016
16017 2004-05-26  Martin Baulig  <martin@ximian.com>
16018
16019         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16020
16021         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16022         (RootContext.LookupType): Pass down the `silent' flag.
16023
16024 2004-05-25  Martin Baulig  <martin@ximian.com>
16025
16026         * expression.cs
16027         (MethodGroupExpr.IdenticalTypeName): New public property.
16028         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16029         expression actually refers to a type.
16030
16031 2004-05-25  Martin Baulig  <martin@ximian.com>
16032
16033         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16034         for #56176 and made it actually work.
16035
16036 2004-05-25  Martin Baulig  <martin@ximian.com>
16037
16038         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16039         (FieldExpr, PropertyExpr): Override and implement
16040         CacheTemporaries.  Fixes #52279.
16041
16042 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16043
16044         * location.cs: In the new compiler listing a file twice is a
16045         warning, not an error.
16046
16047 2004-05-24  Martin Baulig  <martin@ximian.com>
16048
16049         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16050         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16051
16052 2004-05-24  Martin Baulig  <martin@ximian.com>
16053
16054         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16055         walking the `using' list.  Fixes #53921.
16056
16057 2004-05-24  Martin Baulig  <martin@ximian.com>
16058
16059         * const.cs (Const.LookupConstantValue): Added support for
16060         EmptyCast's; fixes #55251.
16061
16062 2004-05-24  Martin Baulig  <martin@ximian.com>
16063
16064         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16065         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16066         which does the CS0135 check.  The reason is that we first need to
16067         check whether the variable actually exists.
16068
16069 2004-05-24  Martin Baulig  <martin@ximian.com>
16070
16071         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16072         than RootContext.LookupType() to find the explicit interface
16073         type.  Fixes #58584.
16074
16075 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16076
16077         * Makefile: Simplify.  Use executable.make.
16078         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16079
16080 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16081
16082         * decl.cs:
16083         * enum.cs:
16084         Use the invariant culture when doing String.Compare for CLS case
16085         sensitivity.
16086         
16087 2004-05-23  Martin Baulig  <martin@ximian.com>
16088
16089         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16090         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16091
16092         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16093         
16094 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16095
16096         * class.cs (MemberBase.Define): Reuse MemberType member for 
16097         resolved type. Other methods can use it too.
16098
16099 2004-05-23  Martin Baulig  <martin@ximian.com>
16100
16101         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16102         the variable also exists in the current block (otherwise, we need
16103         to report a CS0103).  Fixes #58670.
16104
16105 2004-05-23  Martin Baulig  <martin@ximian.com>
16106
16107         * flowanalysis.cs (Reachability.Reachable): Compute this
16108         on-the-fly rather than storing it as a field.
16109
16110 2004-05-23  Martin Baulig  <martin@ximian.com>
16111
16112         * flowanalysis.cs (Reachability.And): Manually compute the
16113         resulting `barrier' from the reachability.      
16114        
16115 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16116
16117         Fix bug #57835
16118         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16119         instance of ObsoleteAttribute when symbol is obsolete.
16120
16121         * class.cs
16122         (IMethodData): Extended interface for ObsoleteAttribute support.
16123
16124 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16125
16126         * attribute.cs: Fix bug #55970
16127
16128 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16129
16130         Fix bug #52705
16131         * attribute.cs
16132         (GetObsoleteAttribute): New method. Creates the instance of
16133         ObsoleteAttribute.
16134         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16135         ObsoleteAttribute when member is obsolete.
16136         (AttributeTester.Report_ObsoleteMessage): Common method for
16137         Obsolete error/warning reporting.
16138
16139         * class.cs
16140         (TypeContainer.base_classs_type): New member for storing parent type.
16141
16142         * decl.cs
16143         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16144         for this MemberCore.
16145
16146 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16147
16148         * attribute.cs, const.cs: Fix bug #58590
16149
16150 2004-05-21  Martin Baulig  <martin@ximian.com>
16151
16152         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16153         out parameters if the end of the method is unreachable.  Fixes
16154         #58098. 
16155
16156 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16157
16158         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16159         Hari was right, why extra method.
16160
16161 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16162
16163         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16164
16165 2004-05-20  Martin Baulig  <martin@ximian.com>
16166
16167         Merged this back from gmcs to keep the differences to a minumum.
16168
16169         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16170         instead of a Declspace.
16171         (Attribute.ResolveType): Likewise.
16172         (Attributes.Search): Likewise.
16173         (Attributes.Contains): Likewise.
16174         (Attributes.GetClsCompliantAttribute): Likewise.
16175
16176         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16177         argument.
16178         (MethodData.ApplyAttributes): Take an EmitContext instead of a
16179         DeclSpace.
16180
16181 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
16182
16183         Fix bug #58688 (MCS does not report error when the same attribute
16184         is assigned twice)
16185
16186         * attribute.cs (Attribute.Emit): Distinction between null and default.
16187
16188 2004-05-19  Raja R Harinath  <rharinath@novell.com>
16189
16190         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16191         of a top-level attribute without an attribute target.
16192         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
16193         Make non-static.
16194         (Attribute.Conditional_GetConditionName), 
16195         (Attribute.Obsolete_GetObsoleteMessage): Update.
16196         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
16197         part of ScanForIndexerName.
16198         (Attribute.CanIgnoreInvalidAttribute): New function.
16199         (Attribute.ScanForIndexerName): Move to ...
16200         (Attributes.ScanForIndexerName): ... here.
16201         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16202         (Attributes.Search): New internal variant that can choose not to
16203         complain if types aren't resolved.  The original signature now
16204         complains.
16205         (Attributes.GetClsCompliantAttribute): Use internal variant, with
16206         complaints suppressed.
16207         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16208         only if it not useful.
16209         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16210         top-level for attributes that are shared between the assembly
16211         and a top-level class.
16212         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16213         * class.cs: Update to reflect changes.
16214         (DefineIndexers): Fuse loops.
16215         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
16216         a couple more variants of attribute names.
16217
16218 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
16219
16220         Fix bug #52585 (Implemented explicit attribute declaration)
16221
16222         * attribute.cs:
16223         (Attributable.ValidAttributeTargets): New abstract method. It gets
16224         list of valid attribute targets for explicit target declaration.
16225         (Attribute.Target): It holds target itself.
16226         (AttributeSection): Removed.
16227         (Attribute.CheckTargets): New method. It checks whether attribute
16228         target is valid for the current element.
16229
16230         * class.cs:
16231         (EventProperty): New class. For events that are declared like
16232         property (with add and remove accessors).
16233         (EventField): New class. For events that are declared like field.
16234         class.cs
16235
16236         * cs-parser.jay: Implemented explicit attribute target declaration.
16237
16238         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16239         Override ValidAttributeTargets.
16240
16241         * parameter.cs:
16242         (ReturnParameter): Class for applying custom attributes on 
16243         the return type.
16244         (ParameterAtribute): New class. Class for applying custom
16245         attributes on the parameter type.
16246
16247 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16248
16249         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16250         definitions. 
16251
16252         (Method): Allow UNSAFE here.
16253
16254         * modifiers.cs: Support unsafe reporting.
16255
16256 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16257
16258         * decl.cs: Fix bug #58478.
16259
16260 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16261
16262         * statement.cs: When checking for unreachable code on an EmptyStatement,
16263         set the location. Fixes bug #58488.
16264
16265 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16266
16267         * driver.cs: Add -pkg handling.
16268
16269         From Gonzalo: UseShelLExecute=false
16270
16271 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16272
16273         * attribute.cs:
16274         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16275         for attribute.
16276         (Attribute.IsClsCompliaceRequired): Moved to base for better
16277         accesibility.
16278         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16279         when attribute is AttributeUsageAttribute.
16280         (Attribute.GetValidTargets): Simplified.
16281         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16282         attribute for this type.
16283         (Attribute.ApplyAttributes): Method renamed to Emit and make
16284         non-static.
16285         (GlobalAttributeSection): New class for special handling of global
16286         attributes (assembly, module).
16287         (AttributeSection.Emit): New method.
16288
16289         * class.cs: Implemented Attributable abstract methods.
16290         (MethodCore.LabelParameters): Moved to Parameter class.
16291         (Accessor): Is back simple class.
16292         (PropertyMethod): Implemented Attributable abstract class.
16293         (DelegateMethod): Implemented Attributable abstract class.
16294         (Event): New constructor for disctintion between normal Event
16295         and Event with accessors.
16296
16297         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16298
16299         * codegen.cs, const.cs, decl.cs, delegate.cs:
16300         (CommonAssemblyModulClass): Implemented Attributable abstract class
16301         and simplified.
16302
16303         * enum.cs: Implement IAttributeSupport interface.
16304         (EnumMember): New class for emum members. Implemented Attributable
16305         abstract class
16306
16307         * parameter.cs:
16308         (ParameterBase): Is abstract.
16309         (ReturnParameter): New class for easier [return:] attribute handling.
16310
16311         * typemanager.cs: Removed builder_to_attr.
16312
16313 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16314
16315         Fix bug #57151.
16316         * attribute.cs (Attribute.GetPositionalValue): New function.
16317         * class.cs (TypeContainer.VerifyMembers): New function.
16318         (TypeContainer.Emit): Use it.
16319         (ClassOrStruct): New base class for Class and Struct.
16320         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16321         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16322         class.
16323         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16324         then each non-static field should have a FieldOffset attribute.
16325         Otherwise, none of the fields should have a FieldOffset attribute.
16326         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16327         and FieldOffset attributes.
16328         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16329         (TypeManager.field_offset_attribute_type): New core types.
16330         (TypeManager.InitCoreTypes): Initialize them.
16331
16332 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16333
16334         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16335         Return correct type.
16336         From bug #58270.
16337
16338 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16339
16340         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16341         be implicitly converted to ulong.
16342         
16343         * expression.cs: The logic for allowing operator &, | and ^ worked
16344         was wrong, it worked before because we did not report an error in
16345         an else branch.  Fixes 57895.
16346
16347         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16348         allow volatile fields to be reference types.
16349
16350 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16351
16352         * driver.cs: Add support for /debug-
16353
16354 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16355
16356         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16357         Add a 'complain' parameter to silence errors.
16358         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16359         silently overlooked type-resolutions.
16360         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16361         to reflect changes.
16362         (Attributes.Search): New function.
16363         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16364         (Attributes.GetAttributeFullName): Remove hack.
16365         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16366         Update to reflect changes.
16367         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16368         Use Attributes.Search instead of nested loops.
16369
16370 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16371
16372         * decl.cs:
16373         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16374         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16375         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16376
16377         * report.cs: (Report.Warning): Renamed to Warning_T because of
16378         parameter collision.
16379
16380 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16381
16382         * expression.cs (MemberAccess.ResolveMemberAccess):
16383         Exit with non-zero status after Report.Error.
16384         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16385         Likewise.
16386         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16387
16388 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16389
16390         * support.cs: Don't hang when the file is empty.
16391
16392 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16393
16394         * support.cs: In SeekableStreamReader, compute the preamble size of the
16395           underlying stream. Position changes should take into account that initial
16396           count of bytes.
16397
16398 2004-05-03  Todd Berman  <tberman@sevenl.net>
16399
16400         * driver.cs: remove unused GetSysVersion function.
16401
16402 2004-05-03  Todd Berman  <tberman@sevenl.net>
16403
16404         * driver.cs: Remove the hack from saturday, as well as the hack
16405         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16406         link_paths to get that bit proper.
16407
16408 2004-05-01  Todd Berman  <tberman@sevenl.net>
16409
16410         * driver.cs: Try a LoadFrom before a Load, this checks the current
16411         path. This is currently a bug in mono that is be fixed, however, this
16412         provides a workaround for now. This will be removed when the bug
16413         is fixed.
16414
16415 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16416
16417         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16418         incomplete key pairs (#57941).
16419
16420 2004-05-01  Todd Berman  <tberman@sevenl.net>
16421
16422         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16423         from the GAC
16424
16425 2004-04-30  Jackson Harper  <jackson@ximian.com>
16426
16427         * codegen.cs: Open keys readonly.
16428         
16429 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16430
16431         * typemanager.cs: don't report cyclic struct layout when a struct
16432         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16433         which has 2 Pango.Rectangle fields.
16434
16435 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16436
16437         * expression.cs: Handle IntPtr comparisons with IL code
16438         rather than a method call.
16439
16440 2004-04-29  Martin Baulig  <martin@ximian.com>
16441
16442         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16443         the list of PropertyInfo's in class hierarchy and find the
16444         accessor.  Fixes #56013.
16445
16446 2004-04-29  Martin Baulig  <martin@ximian.com>
16447
16448         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16449
16450 2004-04-29  Martin Baulig  <martin@ximian.com>
16451
16452         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16453
16454         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16455
16456 2004-04-29  Martin Baulig  <martin@ximian.com>
16457
16458         * class.cs (ConstructorInitializer.Resolve): Check whether the
16459         parent .ctor is accessible.  Fixes #52146.
16460
16461 2004-04-29  Martin Baulig  <martin@ximian.com>
16462
16463         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16464
16465         * statement.cs (Using.EmitLocalVariableDecls): Use
16466         TypeManager.idisposable_type, not typeof (IDisposable).
16467         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16468
16469 2004-04-29  Martin Baulig  <martin@ximian.com>
16470
16471         * class.cs (Event.Define): Don't emit the field and don't set
16472         RTSpecialName and SpecialName for events on interfaces.  Fixes
16473         #57703. 
16474
16475 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16476
16477         Refactor Attribute.ApplyAttributes.
16478         * attribute.cs (Attributable): New base class for objects that can
16479         have Attributes applied on them.
16480         (Attribute): Make AttributeUsage fields public.
16481         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16482         (Attribute.IsInternalCall): New property.
16483         (Attribute.UsageAttr): Convert to a public read-only property.
16484         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16485         (Attribute.ResolveType, Attribute.Resolve)
16486         (Attribute.ScanForIndexerName): Update to reflect changes.
16487         (Attribute.CheckAttributeTarget): Re-format.
16488         (Attribute.ApplyAttributes): Refactor, to various
16489         Attributable.ApplyAttributeBuilder methods.
16490         * decl.cs (MemberCore): Make Attributable.
16491         * class.cs (Accessor): Make Attributable.
16492         (MethodData.ApplyAttributes): Use proper attribute types, not
16493         attribute names.
16494         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16495         (TypeContainer.ApplyAttributeBuilder)
16496         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16497         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16498         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16499         (Operator.ApplyAttributeBuilder): New factored-out methods.
16500         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16501         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16502         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16503         * parameter.cs (ParameterBase): New Attributable base class
16504         that can also represent Return types.
16505         (Parameter): Update to the changes.
16506
16507 2004-04-29  Jackson Harper  <jackson@ximian.com>
16508
16509         * driver.cs: Prefer the corlib system version when looking for
16510         assemblies in the GAC. This is still a hack, but its a better hack
16511         now.
16512         
16513 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16514
16515         * decl.cs, enum.cs: Improved error 3005 reporting.
16516   
16517         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16518         (related_symbols): New private member for list of symbols
16519         related to reported error/warning.
16520         
16521         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16522
16523 2004-04-29  Martin Baulig  <martin@ximian.com>
16524
16525         * ecore.cs (Expression.Constantify): If we're an enum and
16526         TypeManager.TypeToCoreType() doesn't give us another type, use
16527         t.UnderlyingSystemType.  Fixes #56178.  
16528
16529 2004-04-29  Martin Baulig  <martin@ximian.com>
16530
16531         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16532         interfaces and for each interface, only add members directly
16533         declared in that interface.  Fixes #53255.
16534
16535 2004-04-28  Martin Baulig  <martin@ximian.com>
16536
16537         * expression.cs (ConditionalLogicalOperator): Use a temporary
16538         variable for `left' to avoid that we evaluate it more than once;
16539         bug #52588.
16540
16541 2004-04-28  Martin Baulig  <martin@ximian.com>
16542
16543         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16544         `void[]' (CS1547).
16545
16546 2004-04-28  Martin Baulig  <martin@ximian.com>
16547
16548         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16549         void (CS1547).
16550
16551         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16552         whether the type is not void (CS1547).
16553
16554 2004-04-28  Martin Baulig  <martin@ximian.com>
16555
16556         * expression.cs (Unary.DoResolveLValue): Override this and report
16557         CS0131 for anything but Operator.Indirection.
16558
16559 2004-04-28  Martin Baulig  <martin@ximian.com>
16560
16561         Committing a patch from Ben Maurer; see bug #50820.
16562
16563         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16564         check for classes.
16565
16566         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16567         classes.        
16568
16569 2004-04-28  Martin Baulig  <martin@ximian.com>
16570
16571         Committing a patch from Ben Maurer; see bug #50820.
16572
16573         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16574         check for classes.
16575
16576         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16577         classes.        
16578
16579 2004-04-28  Martin Baulig  <martin@ximian.com>
16580
16581         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16582         (Block.AddLabel): Call DoLookupLabel() to only search in the
16583         current block.
16584
16585 2004-04-28  Martin Baulig  <martin@ximian.com>
16586
16587         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16588         comparing StringConstants and NullLiterals in Equality and Inequality.
16589
16590 2004-04-28  Jackson Harper  <jackson@ximian.com>
16591
16592         * driver.cs: Attempt to load referenced assemblies from the
16593         GAC. This is the quick and dirty version of this method that
16594         doesnt take into account versions and just takes the first
16595         canidate found. Will be good enough for now as we will not have more
16596         then one version installed into the GAC until I update this method.
16597
16598 2004-04-28  Martin Baulig  <martin@ximian.com>
16599
16600         * typemanager.cs (TypeManager.CheckStructCycles): New public
16601         static method to check for cycles in the struct layout.
16602
16603         * rootcontext.cs (RootContext.PopulateTypes): Call
16604         TypeManager.CheckStructCycles() for each TypeContainer.
16605         [Note: We only need to visit each type once.]
16606
16607 2004-04-28  Martin Baulig  <martin@ximian.com>
16608
16609         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16610
16611         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16612         success and added `out object value'.  Use a `bool resolved' field
16613         to check whether we've already been called rather than
16614         `ConstantValue != null' since this breaks for NullLiterals.
16615
16616 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16617
16618         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16619         setting of this flag, since the 'set' method may be non-public.
16620
16621 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16622
16623         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16624         check on current_vector.Block.
16625
16626 2004-04-27  Martin Baulig  <martin@ximian.com>
16627
16628         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16629         a field initializer.  Fixes #56459.
16630
16631 2004-04-27  Martin Baulig  <martin@ximian.com>
16632
16633         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16634         we're not attempting to use an indexer.  Fixes #52154.
16635
16636 2004-04-27  Martin Baulig  <martin@ximian.com>
16637
16638         * statement.cs (Return): Don't create a return label if we don't
16639         need it; reverts my change from January 20th.  Thanks to Ben
16640         Maurer for this.
16641
16642 2004-04-27  Martin Baulig  <martin@ximian.com>
16643
16644         According to the spec, `goto' can only leave a nested scope, but
16645         never enter it.
16646
16647         * statement.cs (Block.LookupLabel): Only lookup in the current
16648         block, don't recurse into parent or child blocks.
16649         (Block.AddLabel): Check in parent and child blocks, report
16650         CS0140/CS0158 if we find a duplicate.
16651         (Block): Removed this indexer for label lookups.
16652         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16653         this already does the error reporting for us.
16654
16655         * flowanalysis.cs
16656         (FlowBranching.UsageVector.Block): New public variable; may be null.
16657         (FlowBranching.CreateSibling): Added `Block' argument.
16658         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
16659         label for the target of a `goto' and check whether we're not
16660         leaving a `finally'.
16661
16662 2004-04-27  Martin Baulig  <martin@ximian.com>
16663
16664         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16665         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16666         just for returns).
16667
16668 2004-04-27  Martin Baulig  <martin@ximian.com>
16669
16670         * statement.cs (Block.AddLabel): Also check for implicit blocks
16671         and added a CS0158 check.
16672
16673 2004-04-27  Martin Baulig  <martin@ximian.com>
16674
16675         * flowanalysis.cs (FlowBranchingLoop): New class.
16676         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16677         UsageVector's instead of an ArrayList.
16678         (FlowBranching.Label): Likewise.
16679         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16680         (FlowBranching.AddBreakVector): New method.
16681
16682 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
16683
16684         * attribute.cs: Small regression fix: only convert the type if we
16685         the type is different, fixes System.Drawing build.
16686
16687 2004-04-27  Martin Baulig  <martin@ximian.com>
16688
16689         * attribute.cs (Attribute.Resolve): If we have a constant value
16690         for a named field or property, implicity convert it to the correct
16691         type.
16692
16693 2004-04-27  Raja R Harinath  <rharinath@novell.com>
16694
16695         * statement.cs (Block.Block): Implicit blocks share
16696         'child_variable_names' fields with parent blocks.
16697         (Block.AddChildVariableNames): Remove.
16698         (Block.AddVariable): Mark variable as "used by a child block" in
16699         every surrounding block.
16700         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16701         been used in a child block, complain about violation of "Invariant
16702         meaning in blocks" rule.
16703         * cs-parser.jay (declare_local_variables): Don't use
16704         AddChildVariableNames.
16705         (foreach_statement): Don't create an implicit block: 'foreach'
16706         introduces a scope.
16707
16708 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
16709
16710         * convert.cs (ImplicitNumericConversion): 0 is also positive when
16711         converting from 0L to ulong.  Fixes 57522.
16712
16713 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16714
16715         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16716         derived class hides via 'new' keyword field from base class (test-242.cs).
16717         TODO: Handle this in the more general way.
16718         
16719         * class.cs (CheckBase): Ditto.
16720
16721 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16722
16723         * decl.cs (caching_flags): New member for storing cached values
16724         as bit flags.
16725         (MemberCore.Flags): New enum where bit flags for caching_flags
16726         are defined.
16727         (MemberCore.cls_compliance): Moved to caching_flags.
16728         (DeclSpace.Created): Moved to caching_flags.
16729
16730         * class.cs: Use caching_flags instead of DeclSpace.Created
16731         
16732 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
16733
16734         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16735         if we are only a derived class, not a nested class.
16736
16737         * typemanager.cs: Same as above, but do this at the MemberLookup
16738         level (used by field and methods, properties are handled in
16739         PropertyExpr).   Allow for the qualified access if we are a nested
16740         method. 
16741
16742 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
16743
16744         * class.cs: Refactoring.
16745         (IMethodData): New inteface; Holds links to parent members
16746         to avoid member duplication (reduced memory allocation).
16747         (Method): Implemented IMethodData interface.
16748         (PropertyBase): New inner classes for get/set methods.
16749         (PropertyBase.PropertyMethod): Implemented IMethodData interface
16750         (Event): New inner classes for add/remove methods.
16751         (Event.DelegateMethod): Implemented IMethodData interface.
16752
16753         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16754         EmitContext (related to class.cs refactoring).
16755
16756 2004-04-21  Raja R Harinath  <rharinath@novell.com>
16757
16758         * delegate.cs (Delegate.VerifyApplicability): If the number of
16759         arguments are the same as the number of parameters, first try to
16760         verify applicability ignoring  any 'params' modifier on the last
16761         parameter.
16762         Fixes #56442.
16763
16764 2004-04-16  Raja R Harinath  <rharinath@novell.com>
16765
16766         * class.cs (TypeContainer.AddIndexer): Use
16767         'ExplicitInterfaceName' to determine if interface name was
16768         explicitly specified.  'InterfaceType' is not initialized at this time.
16769         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
16770         Indexers array is already in the required order.  Initialize
16771         'IndexerName' only if there are normal indexers.
16772         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16773         (TypeContainer.Emit): Emit DefaultMember attribute only if
16774         IndexerName is initialized.
16775         Fixes #56300.
16776
16777 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
16778
16779         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16780         Fixes #57007
16781
16782 2004-04-15  Raja R Harinath  <rharinath@novell.com>
16783
16784         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16785         attributes.
16786         Fix for #56456.
16787
16788         * attribute.cs (Attribute.Resolve): Check for duplicate named
16789         attributes.
16790         Fix for #56463.
16791
16792 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * iterators.cs (MarkYield): track whether we are in an exception,
16795         and generate code accordingly.  Use a temporary value to store the
16796         result for our state.
16797
16798         I had ignored a bit the interaction of try/catch with iterators
16799         since their behavior was not entirely obvious, but now it is
16800         possible to verify that our behavior is the same as MS .NET 2.0
16801
16802         Fixes 54814
16803
16804 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
16805
16806         * iterators.cs: Avoid creating temporaries if there is no work to
16807         do. 
16808
16809         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16810         Enumerations, use TypeManager.EnumToUnderlying and call
16811         recursively. 
16812
16813         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16814         bug #57013
16815
16816         (This.Emit): Use EmitContext.EmitThis to emit our
16817         instance variable.
16818
16819         (This.EmitAssign): Ditto.
16820
16821         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16822         codepaths, we will move all the functionality into
16823         Mono.CSharp.This 
16824
16825         (FieldExpr.EmitAssign): Ditto.
16826
16827         This fixes several hidden bugs that I uncovered while doing a code
16828         review of this today.
16829
16830         * codegen.cs (EmitThis): reworked so the semantics are more clear
16831         and also support value types "this" instances.
16832
16833         * iterators.cs: Changed so that for iterators in value types, we
16834         do not pass the value type as a parameter.  
16835
16836         Initialization of the enumerator helpers is now done in the caller
16837         instead of passing the parameters to the constructors and having
16838         the constructor set the fields.
16839
16840         The fields have now `assembly' visibility instead of private.
16841
16842 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
16843
16844         * expression.cs (Argument.Resolve): Check if fields passed as ref
16845         or out are contained in a MarshalByRefObject.
16846
16847         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16848         another compiler type.
16849
16850 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16851
16852         * class.cs (Indexer.Define): use the new name checking method.
16853         Also, return false on an error.
16854         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16855         (is_identifier_[start/part]_character): make static.
16856
16857 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
16858
16859         * expression.cs (Binary.ResolveOperator): Do no append strings
16860         twice: since we can be invoked more than once (array evaluation)
16861         on the same concatenation, take care of this here.  Based on a fix
16862         from Ben (bug #56454)
16863
16864 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
16865
16866         * codegen.cs: Fix another case where CS1548 must be reported (when 
16867         delay-sign isn't specified and no private is available #56564). Fix
16868         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
16869         error when MCS is used on the MS runtime and we need to delay-sign 
16870         (which seems unsupported by AssemblyBuilder - see #56621).
16871
16872 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
16873
16874         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16875         (TypeManager.ComputeNamespaces): Faster implementation for
16876         Microsoft runtime.
16877
16878         * compiler.csproj: Updated AssemblyName to mcs.
16879
16880 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * rootcontext.cs: Add new types to the boot resolution.
16883
16884         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16885         MulticastDelegate is not allowed.
16886
16887         * typemanager.cs: Add new types to lookup: System.TypedReference
16888         and ArgIterator.
16889
16890         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16891         check for TypedReference or ArgIterator, they are not allowed. 
16892
16893         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16894         makes us properly catch 1510 in some conditions (see bug 56016 for
16895         details). 
16896
16897 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
16898
16899         * CryptoConvert.cs: update from corlib version
16900         with endian fixes.
16901
16902 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
16903
16904         * class.cs (Indexer.Define): Check indexername declaration
16905
16906 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
16907
16908         * attribute.cs (IsClsCompliant): Fixed problem with handling
16909         all three states (compliant, not-compliant, undetected).
16910
16911 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
16912
16913         * attribute.cs (Attribute): Location is now public.
16914         (Resolve): Store resolved arguments (pos_values) in attribute class.
16915         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16916         (GetClsCompliantAttributeValue): New method that gets
16917         CLSCompliantAttribute value.
16918         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16919         if exists else null.
16920         (AttributeTester): New class for CLS-Compliant verification routines.
16921
16922         * class.cs (Emit): Add CLS-Compliant verification.
16923         (Method.GetSignatureForError): Implemented.
16924         (Constructor.GetSignatureForError): Implemented
16925         (Constructor.HasCompliantArgs): Returns if constructor has
16926         CLS-Compliant arguments.
16927         (Constructor.Emit): Override.
16928         (Construcor.IsIdentifierClsCompliant): New method; For constructors
16929         is needed to test only parameters.
16930         (FieldBase.GetSignatureForError): Implemented.
16931         (TypeContainer): New member for storing base interfaces.
16932         (TypeContainer.FindMembers): Search in base interfaces too.
16933
16934         * codegen.cs (GetClsComplianceAttribute): New method that gets
16935         assembly or module CLSCompliantAttribute value.
16936         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16937         for assembly.
16938         (ModuleClass.Emit): Add error 3012 test.
16939
16940         * const.cs (Emit): Override and call base for CLS-Compliant tests.
16941
16942         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16943         state for all decl types.
16944         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16945         if CLS-Compliant tests are required.
16946         (IsClsCompliaceRequired): New method. Analyze whether code
16947         must be CLS-Compliant.
16948         (IsExposedFromAssembly): New method. Returns true when MemberCore
16949         is exposed from assembly.
16950         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16951         value or gets cached value.
16952         (HasClsCompliantAttribute): New method. Returns true if MemberCore
16953         is explicitly marked with CLSCompliantAttribute.
16954         (IsIdentifierClsCompliant): New abstract method. This method is
16955         used to testing error 3005.
16956         (IsIdentifierAndParamClsCompliant): New method. Common helper method
16957         for identifier and parameters CLS-Compliant testing.
16958         (VerifyClsCompliance): New method. The main virtual method for
16959         CLS-Compliant verifications.
16960         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16961         null. I don't know why is null (too many public members !).
16962         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16963         and get value of first CLSCompliantAttribute that found.
16964
16965         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16966         (VerifyClsCompliance): Override and add extra tests.
16967
16968         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16969         clscheck- disable CLS-Compliant verification event if assembly is has
16970         CLSCompliantAttribute(true).
16971
16972         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16973         ApllyAttribute is now called in emit section as in the other cases.
16974         Possible future Emit integration.
16975         (IsIdentifierClsCompliant): New override.
16976         (VerifyClsCompliance): New override.
16977         (GetEnumeratorName): Returns full enum name.
16978
16979         * parameter.cs (GetSignatureForError): Implemented.
16980
16981         * report.cs (WarningData): New struct for Warning message information.
16982         (LocationOfPreviousError): New method.
16983         (Warning): New method. Reports warning based on the warning table.
16984         (Error_T): New method. Reports error based on the error table.
16985
16986         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16987         verifications are done here.
16988
16989         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16990
16991         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16992         CLSCompliantAttribute.
16993         (all_imported_types): New member holds all imported types from other
16994         assemblies.
16995         (LoadAllImportedTypes): New method fills static table with exported types
16996         from all referenced assemblies.
16997         (Modules): New property returns all assembly modules.
16998
16999 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17000
17001         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17002         throwing a parser error.
17003
17004         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17005         which removes the hardcoded get_/set_ prefixes for properties, as
17006         IL allows for the properties to be named something else.  
17007
17008         Bug #56013
17009
17010         * expression.cs: Do not override operand before we know if it is
17011         non-null.  Fix 56207
17012
17013 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17014
17015         * typemanager.cs: support for pinned variables.
17016
17017 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17018
17019         * decl.cs, typemanager.cs: Avoid using an arraylist
17020         as a buffer if there is only one result set.
17021
17022 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17023
17024         * expression.cs: Make sure you cant call a static method
17025         with an instance expression, bug #56174.
17026
17027 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17028
17029         * class.cs (IsDuplicateImplementation): Improve error reporting to
17030         flag 663 (method only differs in parameter modifier).
17031
17032         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17033         in preprocessor directives.
17034
17035         * location.cs (LookupFile): Allow for the empty path.
17036
17037         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17038         better approach for some of that patch, but its failing with the
17039         CharSet enumeration.  For now try/catch will do.
17040
17041         * typemanager.cs: Do not crash if a struct does not have fields.
17042         Fixes 56150.
17043
17044 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17045
17046         * expression.cs: cs0213, cant fix a fixed expression.
17047         fixes 50231.
17048
17049 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17050
17051         * cs-parser.jay: detect invalid embeded statements gracefully.
17052         bug #51113.
17053
17054 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17055
17056         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17057         As a regex:
17058         s/
17059         the invocation type may not be a subclass of the tye of the item/
17060         The type of the item must be a subclass of the invocation item.
17061         /g
17062
17063         Fixes bug #50820.
17064
17065 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17066
17067         * attribute.cs: Added methods to get a string and a bool from an
17068         attribute. Required to information from AssemblyKeyFileAttribute,
17069         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17070         * codegen.cs: Modified AssemblyName creation to include support for
17071         strongnames. Catch additional exceptions to report them as CS1548.
17072         * compiler.csproj: Updated include CryptoConvert.cs.
17073         * compiler.csproj.user: Removed file - user specific configuration.
17074         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17075         Mono.Security assembly. The original class is maintained and tested in
17076         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17077         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17078         like CSC 8.0 (C# v2) supports.
17079         * Makefile: Added CryptoConvert.cs to mcs sources.
17080         * rootcontext.cs: Added new options for strongnames.
17081
17082 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17083
17084         * driver.cs: For --expect-error, report error code `2'
17085         if the program compiled with no errors, error code `1' if
17086         it compiled with an error other than the one expected.
17087
17088 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17089
17090         * compiler.csproj: Updated for Visual Studio .NET 2003.
17091         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17092         * compiler.sln: Updated for Visual Studio .NET 2003.
17093
17094 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17095
17096         * expression.cs: Fix bug #47234. We basically need to apply the
17097         rule that we prefer the conversion of null to a reference type
17098         when faced with a conversion to 'object' (csc behaviour).
17099
17100 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17101
17102         * statement.cs: Shorter form for foreach, eliminates
17103         a local variable. r=Martin.
17104
17105 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17106
17107         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17108         checks if we can use brtrue/brfalse to test for 0.
17109         * expression.cs: use the above in the test for using brtrue/brfalse.
17110         cleanup code a bit.
17111
17112 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17113
17114         * expression.cs: Rewrite string concat stuff. Benefits:
17115
17116         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17117         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17118         rather than a concat chain.
17119
17120         * typemanager.cs: Add lookups for more concat overloads.
17121
17122 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17123
17124         * expression.cs: Emit shorter il code for array init.
17125
17126         newarr
17127         dup
17128         // set 1
17129
17130         // set 2
17131
17132         newarr
17133         stloc.x
17134
17135         ldloc.x
17136         // set 1
17137
17138         ldloc.x
17139         // set 2
17140
17141 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17142
17143         * statement.cs: Before, two switch blocks would be merged if the
17144         total size of the blocks (end_item - begin_item + 1) was less than
17145         two times the combined sizes of the blocks.
17146
17147         Now, it will only merge if after the merge at least half of the
17148         slots are filled.
17149
17150         fixes 55885.
17151
17152 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
17153
17154         * class.cs : csc build fix for GetMethods(). See bug #52503.
17155
17156 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
17157
17158         * expression.cs: Make sure fp comparisons work with NaN.
17159         This fixes bug #54303. Mig approved this patch a long
17160         time ago, but we were not able to test b/c the runtime
17161         had a related bug.
17162
17163 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
17164
17165         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
17166
17167 2004-03-19  Martin Baulig  <martin@ximian.com>
17168
17169         * class.cs (MemberCore.IsDuplicateImplementation): Report the
17170         error here and not in our caller.
17171
17172 2004-03-19  Martin Baulig  <martin@ximian.com>
17173
17174         * interface.cs: Completely killed this file.
17175         (Interface): We're now a TypeContainer and live in class.cs.
17176
17177         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17178         argument; we're now also called for interfaces.
17179         (TypeContainer.DefineMembers): Allow this method being called
17180         multiple times.
17181         (TypeContainer.GetMethods): New public method; formerly known as
17182         Interface.GetMethod().  This is used by PendingImplementation.
17183         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17184         it's now private and non-static.
17185         (Interface): Moved this here; it's now implemented similar to
17186         Class and Struct.
17187         (Method, Property, Event, Indexer): Added `bool is_interface'
17188         argument to their .ctor's.
17189         (MemberBase.IsInterface): New public field.
17190
17191         * cs-parser.jay: Create normal Method, Property, Event, Indexer
17192         instances instead of InterfaceMethod, InterfaceProperty, etc.
17193         (opt_interface_base): Removed; we now use `opt_class_base' instead.
17194         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17195
17196 2004-03-19  Martin Baulig  <martin@ximian.com>
17197
17198         * class.cs (MethodCore.IsDuplicateImplementation): New private
17199         method which does the CS0111 checking.
17200         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17201         Use IsDuplicateImplementation().
17202
17203 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17204
17205         * decl.cs (FindMemberToOverride): New method to find the correct
17206         method or property to override in the base class.
17207         * class.cs
17208             - Make Method/Property use the above method to find the
17209               version in the base class.
17210             - Remove the InheritableMemberSignatureCompare as it is now
17211               dead code.
17212
17213         This patch makes large code bases much faster to compile, as it is
17214         O(n) rather than O(n^2) to do this validation.
17215
17216         Also, it fixes bug 52458 which is that nested classes are not
17217         taken into account when finding the base class member.
17218
17219         Reviewed/Approved by Martin.
17220
17221 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
17222
17223         * interface.cs: In all interface classes removed redundant
17224         member initialization.
17225
17226 2004-03-16  Martin Baulig  <martin@ximian.com>
17227
17228         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17229
17230 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * decl.cs (DefineTypeAndParents): New helper method to define a
17233         type's containers before the type itself is defined;  This is a
17234         bug exposed by the recent changes to Windows.Forms when an
17235         implemented interface was defined inside a class that had not been
17236         built yet.   
17237
17238         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17239
17240         (Check): Loop correctly to report errors modifiers
17241         (UNSAFE was not in the loop, since it was the same as TOP).
17242
17243         * interface.cs: Every interface member now takes a ModFlags,
17244         instead of a "is_new" bool, which we set on the base MemberCore. 
17245
17246         Every place where we called "UnsafeOk" in the interface, now we
17247         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17248         the unsafe settings from the member declaration instead of the
17249         container interface. 
17250
17251         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17252
17253         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17254         `set_indexer_name' to the pending bits (one per type).
17255
17256         We fixed a bug today that was picking the wrong method to
17257         override, since for properties the existing InterfaceMethod code
17258         basically ignored the method name.  Now we make sure that the
17259         method name is one of the valid indexer names.
17260
17261 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17262  
17263         * support.cs (SeekableStreamReader): Keep track of stream byte
17264         positions and don't mix them with character offsets to the buffer.
17265
17266         Patch from Gustavo Giráldez
17267
17268 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17269
17270         * interface.cs (InterfaceSetGetBase): Removed double member
17271         initialization, base class does it as well.
17272
17273 2004-03-13  Martin Baulig  <martin@ximian.com>
17274
17275         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17276         when compiling corlib.
17277
17278 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17279
17280         * convert.cs (ExplicitConversion): We were reporting an error on
17281         certain conversions (object_type source to a value type, when the
17282         expression was `null') before we had a chance to pass it through
17283         the user defined conversions.
17284
17285         * driver.cs: Replace / and \ in resource specifications to dots.
17286         Fixes 50752
17287
17288         * class.cs: Add check for duplicate operators.  Fixes 52477
17289
17290 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17291
17292         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17293         that are in the middle of the statements, not only at the end.
17294         Fixes #54987
17295
17296         * class.cs (TypeContainer.AddField): No longer set the
17297         `HaveStaticConstructor' flag, now we call it
17298         `UserDefineStaticConstructor' to diferentiate the slightly
17299         semantic difference.
17300
17301         The situation is that we were not adding BeforeFieldInit (from
17302         Modifiers.TypeAttr) to classes that could have it.
17303         BeforeFieldInit should be set to classes that have no static
17304         constructor. 
17305
17306         See:
17307
17308         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17309
17310         And most importantly Zoltan's comment:
17311
17312         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17313
17314         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17315          before its static fields are used', i.e. initialization does not need
17316          to be triggered by the first access to the type. Setting this flag
17317          helps the JIT to compile better code, since it can run the static
17318          constructor at JIT time, and does not need to generate code to call it
17319          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17320          this flag for lots of classes like String. 
17321          
17322          csc sets this flag if the type does not have an explicit static 
17323          constructor. The reasoning seems to be that if there are only static
17324          initalizers for a type, and no static constructor, then the programmer
17325          does not care when this initialization happens, so beforefieldinit
17326          can be used.
17327          
17328          This bug prevents the AOT compiler from being usable, since it 
17329          generates so many calls to mono_runtime_class_init that the AOT code
17330          is much slower than the JITted code. The JITted code is faster, 
17331          because it does not generate these calls if the vtable is type is
17332          already initialized, which is true in the majority of cases. But the
17333          AOT compiler can't do this."
17334
17335 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * class.cs (MethodData.Emit): Refactor the code so symbolic
17338         information is generated for destructors;  For some reasons we
17339         were taking a code path that did not generate symbolic information
17340         before. 
17341
17342 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17343
17344         * class.cs: Create a Constructor.CheckBase method that
17345         takes care of all validation type code. The method
17346         contains some code that was moved from Define.
17347
17348         It also includes new code that checks for duplicate ctors.
17349         This fixes bug #55148.
17350
17351 2004-03-09  Joshua Tauberer <tauberer@for.net>
17352
17353         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17354         a { ... }-style array creation invokes EmitStaticInitializers
17355         which is not good for reference-type arrays.  String, decimal
17356         and now null constants (NullCast) are not counted toward
17357         static initializers.
17358
17359 2004-03-05  Martin Baulig  <martin@ximian.com>
17360
17361         * location.cs (SourceFile.HasLineDirective): New public field;
17362         specifies whether the file contains or is referenced by a "#line"
17363         directive.
17364         (Location.DefineSymbolDocuments): Ignore source files which
17365         either contain or are referenced by a "#line" directive.        
17366
17367 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17368
17369         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17370         direct access to our parent, so check the method inline there.
17371
17372 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17373
17374         * expression.cs (Invocation.EmitCall): Miguel's last commit
17375         caused a regression. If you had:
17376
17377             T t = null;
17378             t.Foo ();
17379
17380         In Foo the implict this would be null.
17381
17382 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17383
17384         * expression.cs (Invocation.EmitCall): If the method is not
17385         virtual, do not emit a CallVirt to it, use Call.
17386
17387         * typemanager.cs (GetFullNameSignature): Improve the method to
17388         cope with ".ctor" and replace it with the type name.
17389
17390         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17391         as an argument the ConstructorBuilder where it is being defined,
17392         to catch the recursive constructor invocations.
17393
17394 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17397         routines to check if a type is an enumerable/enumerator allow
17398         classes that implement the IEnumerable or IEnumerator interfaces.
17399
17400         * class.cs (Property, Operator): Implement IIteratorContainer, and
17401         implement SetYields.
17402
17403         (Property.Define): Do the block swapping for get_methods in the
17404         context of iterators.   We need to check if Properties also
17405         include indexers or not.
17406
17407         (Operator): Assign the Block before invoking the
17408         OperatorMethod.Define, so we can trigger the Iterator code
17409         replacement. 
17410
17411         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17412         Property and Operator classes are not created when we parse the
17413         declarator but until we have the block completed, so we use a
17414         singleton SimpleIteratorContainer.Simple to flag whether the
17415         SetYields has been invoked.
17416
17417         We propagate this setting then to the Property or the Operator to
17418         allow the `yield' to function.
17419
17420 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17421
17422         * codegen.cs: Implemented attribute support for modules.
17423         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17424         Assembly/Module functionality.
17425
17426         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17427         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17428         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17429
17430 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17431
17432         * interface.cs (FindMembers): The operation is performed on all base
17433         interfaces and not only on the first. It is required for future CLS Compliance patch.
17434
17435 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17436
17437         * statement.cs, codegen.cs:
17438         This patch deals with patterns such as:
17439
17440         public class List : IEnumerable {
17441
17442                 public MyEnumerator GetEnumerator () {
17443                         return new MyEnumerator(this);
17444                 }
17445
17446                 IEnumerator IEnumerable.GetEnumerator () {
17447                         ...
17448                 }
17449                 
17450                 public struct MyEnumerator : IEnumerator {
17451                         ...
17452                 }
17453         }
17454
17455         Before, there were a few things we did wrong:
17456         1) we would emit callvirt on a struct, which is illegal
17457         2) we emited ldarg when we needed to emit ldarga
17458         3) we would mistakenly call the interface methods on an enumerator
17459         type that derived from IEnumerator and was in another assembly. For example:
17460
17461         public class MyEnumerator : IEnumerator
17462
17463         Would have the interface methods called, even if there were public impls of the
17464         method. In a struct, this lead to invalid IL code.
17465
17466 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17467
17468         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17469           renamed to Emit.
17470
17471         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17472
17473 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * cs-parser.jay: Fix small regression: we were not testing V2
17476         compiler features correctly.
17477
17478         * interface.cs: If the emit context is null, then create one
17479
17480 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17481
17482         * decl.cs (GetSignatureForError): New virtual method to get full name
17483           for error messages.
17484
17485         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17486           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17487
17488         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17489           Duplicated members and code in these classes has been removed.
17490           Better encapsulation in these classes.
17491
17492 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17493
17494         * assign.cs (Assign.DoResolve): When dealing with compound
17495         assignments, there is a new rule in ECMA C# 2.4 (might have been
17496         there before, but it is documented here) that states that in:
17497
17498         a op= b;
17499
17500         If b is of type int, and the `op' is a shift-operator, then the
17501         above is evaluated as:
17502
17503         a = (int) a op b 
17504
17505         * expression.cs (Binary.ResolveOperator): Instead of testing for
17506         int/uint/long/ulong, try to implicitly convert to any of those
17507         types and use that in pointer arithmetic.
17508
17509         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17510         method to print information for from the type, not from the
17511         null-method we were given.
17512
17513 2004-02-01  Duncan Mak  <duncan@ximian.com>
17514
17515         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17516         parsing for cmd, fixes bug #53694.
17517
17518 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17519
17520         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17521         in the member name duplication tests. Property and operator name duplication
17522         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17523
17524 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17525
17526         * interface.cs (PopulateMethod): Fixed crash when interface method
17527         returns not existing type (error test cs0246-3.cs).
17528
17529 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17530
17531         * cs-parser.jay (interface_accessors): Re-write actions to also
17532         store attributes attached to get and set methods. Fix spelling
17533         while at it.
17534
17535         (inteface_property_declaration): Modify accordingly.
17536
17537         (InterfaceAccessorInfo): New helper class to store information to pass
17538         around between rules that use interface_accessors.
17539
17540         * interface.cs (Emit): Apply attributes on the get and set
17541         accessors of properties and indexers too.
17542
17543         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17544         right MethodBuilder when applying attributes to the get and set accessors.
17545
17546 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17547
17548         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17549
17550 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17551
17552         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17553
17554 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17555
17556         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17557         changes that treat `yield' specially when present before `break'
17558         or `return' tokens.
17559
17560         * cs-tokenizer.cs: yield is no longer a keyword.
17561
17562 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17563
17564         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17565         setting for default constructors.
17566         For default constructors are almost every time set wrong Modifier. The
17567         generated IL code has been alright. But inside mcs this values was
17568         wrong and this was reason why several of my CLS Compliance tests
17569         failed.
17570
17571 2004-01-22  Martin Baulig  <martin@ximian.com>
17572
17573         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17574         not a QualifiedIdentifier.  This is what `type_name_expression'
17575         was previously doing.
17576         (type_name_expression): Removed; the code is now in
17577         `namespace_or_type_name'.
17578         (qualified_identifier): Removed, use `namespace_or_type_name'
17579         instead.
17580         (QualifiedIdentifier): Removed this class.      
17581
17582 2004-01-22  Martin Baulig  <martin@ximian.com>
17583
17584         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17585         not a string as alias name.
17586
17587 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17588
17589         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17590         #52730 bug, and instead compute correctly the need to use a
17591         temporary variable when requesting an address based on the
17592         static/instace modified of the field and the constructor.
17593  
17594 2004-01-21  Martin Baulig  <martin@ximian.com>
17595
17596         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17597         class and namespace before looking up aliases.  Fixes #52517.
17598
17599 2004-01-21  Martin Baulig  <martin@ximian.com>
17600
17601         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17602         assinged in a 'try'; fixes exception4.cs.
17603
17604 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17605         * class.cs : Implemented parameter-less constructor for TypeContainer
17606
17607         * decl.cs: Attributes are now stored here. New property OptAttributes
17608
17609         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17610
17611         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17612
17613 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17614
17615         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17616           (CSharpSignature): New method for indexer and property signature.
17617
17618 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17619
17620         * pending.cs (IsVirtualFilter): Faster implementation.
17621
17622 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17623
17624         * typemanager.cs: Avoid inclusion of same assembly more than once.
17625
17626 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17627
17628         * cs-parser.jay: Fixed problem where the last assembly attribute
17629           has been applied also to following declaration (class, struct, etc.)
17630           
17631 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17632
17633         * class.cs: Added error CS0538, CS0539 reporting.
17634         Fixed crash on Microsoft runtime when field type is void.
17635
17636         * cs-parser.jay: Added error CS0537 reporting.
17637
17638         * pending.cs: Added error CS0535 reporting.
17639         Improved error report for errors CS0536, CS0534.
17640
17641 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
17642
17643         Merge a few bits from the Anonymous Method MCS tree.
17644
17645         * statement.cs (ToplevelBlock): New class for toplevel methods,
17646         will hold anonymous methods, lifted variables.
17647
17648         * cs-parser.jay: Create toplevel blocks for delegates and for
17649         regular blocks of code. 
17650
17651 2004-01-20  Martin Baulig  <martin@ximian.com>
17652
17653         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17654         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17655         and `NeedExplicitReturn'; added `IsLastStatement'.
17656         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17657         have a `ReturnLabel' or we're not unreachable.
17658
17659         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17660         child's reachability; don't just override ours with it.  Fixes
17661         #58058 (lluis's example).
17662         (FlowBranching): Added public InTryOrCatch(), InCatch(),
17663         InFinally(), InLoop(), InSwitch() and
17664         BreakCrossesTryCatchBoundary() methods.
17665
17666         * statement.cs (Return): Do all error checking in Resolve().
17667         Unless we are the last statement in a top-level block, always
17668         create a return label and jump to it.
17669         (Break, Continue): Do all error checking in Resolve(); also make
17670         sure we aren't leaving a `finally'.
17671         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17672         statement in a top-level block.
17673         (Block.Flags): Added `IsDestructor'.
17674         (Block.IsDestructor): New public property.
17675
17676 2004-01-20  Martin Baulig  <martin@ximian.com>
17677
17678         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17679
17680 2004-01-20  Martin Baulig  <martin@ximian.com>
17681
17682         * statement.cs (Statement.ResolveUnreachable): New public method.
17683         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17684         (Block.Resolve): Resolve unreachable statements.
17685
17686 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17687
17688         * expression.cs: We need to fix the case where we do
17689         not have a temp variable here.
17690
17691         * assign.cs: Only expression compound assignments need
17692         temporary variables.
17693
17694 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17695
17696         * flowanalysis.cs: Reduce memory allocation in a few ways:
17697           - A block with no variables should not allocate a bit
17698             vector for itself.
17699           - A method with no out parameters does not need any tracking
17700             for assignment of the parameters, so we need not allocate
17701             any data for it.
17702           - The arrays:
17703                 public readonly Type[] VariableTypes;
17704                 public readonly string[] VariableNames;
17705             Are redundant. The data is already stored in the variable
17706             map, so we need not allocate another array for it.
17707           - We need to add alot of checks for if (params | locals) == null
17708             due to the first two changes.
17709
17710 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17713         implement IMemoryLocation, we store a copy on a local variable and
17714         take the address of it.  Patch from Benjamin Jemlich
17715
17716         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17717         to use a special "type_name_expression" rule which reduces the
17718         number of "QualifiedIdentifier" classes created, and instead
17719         directly creates MemberAccess expressions.
17720
17721 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
17722
17723         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17724         that fixes #52853.  Null literal assignment to ValueType
17725
17726         * class.cs (MethodData.Emit): Instead of checking the name of the
17727         method to determine if its a destructor, create a new derived
17728         class from Method called Destructor, and test for that.  
17729
17730         * cs-parser.jay: Create a Destructor object instead of a Method.  
17731
17732         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17733
17734         Fixes: 52933
17735
17736 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
17737
17738         * expression.cs (Binary.ResolveOperator): Perform an implicit
17739         conversion from MethodGroups to their delegate types on the
17740         Addition operation.
17741
17742         * delegate.cs: Introduce a new class DelegateCreation that is the
17743         base class for `NewDelegate' and `ImplicitDelegateCreation',
17744         factor some code in here.
17745
17746         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17747         conversion from MethodGroups to compatible delegate types. 
17748
17749         * ecore.cs (Expression.Resolve): Do not flag error 654
17750         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17751         we allow conversions from MethodGroups to delegate types now.
17752
17753         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17754         assignments in v2 either.
17755
17756 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
17757
17758         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17759         static read-only fields in ctors.
17760
17761         Applied patch from Benjamin Jemlich 
17762
17763         * expression.cs (UnaryMutator): Avoid leaking local variables. 
17764
17765 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
17766
17767         * cs-tokenizer.cs (IsCastToken): Allow the various native types
17768         here to return true, as they can be used like this:
17769
17770                 (XXX) int.MEMBER ()
17771
17772         Fixed 49836 and all the other dups
17773
17774 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
17775
17776         * driver.cs: Implement /win32res and /win32icon.
17777
17778 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
17779
17780         * cs-parser.jay: Add a rule to improve error handling for the
17781         common mistake of placing modifiers after the type.
17782
17783 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
17784
17785         * cs-parser.jay (interface_event_declaration): Catch
17786         initialization of events on interfaces, and report cs0068
17787
17788         * cs-parser.jay (interface_event_declaration): Catch
17789         initialization of events. 
17790
17791         * ecore.cs: Better report missing constructors.
17792
17793         * expression.cs (Binary.ResolveOperator): My previous bug fix had
17794         the error reporting done in the wrong place.  Fix.
17795
17796         * expression.cs (Binary.ResolveOperator): Catch the 
17797         operator + (E x, E y) error earlier, and later allow for implicit
17798         conversions in operator +/- (E e, U x) from U to the underlying
17799         type of E.
17800
17801         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17802         52596, if the container class is abstract, the default constructor
17803         is protected otherwise its public (before, we were always public).
17804
17805         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17806         fixed statement.
17807
17808         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17809         Jemlich that fixes bug #52597, MCS was generating invalid code for
17810         idisposable structs.   Thanks to Ben for following up with this
17811         bug as well.
17812
17813 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
17814
17815         * driver.cs: Allow assemblies without code to be generated, fixes
17816         52230.
17817
17818 2004-01-07  Nick Drochak <ndrochak@gol.com>
17819
17820         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17821
17822 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * cs-parser.jay: Add rules to improve error reporting if fields or
17825         methods are declared at the namespace level (error 116)
17826
17827         * Add rules to catch event add/remove
17828
17829 2004-01-04  David Sheldon <dave-mono@earth.li>
17830
17831   * expression.cs: Added matching ")" to error message for 
17832   CS0077
17833
17834 2004-01-03 Todd Berman <tberman@gentoo.org>
17835
17836         * ecore.cs, attribute.cs:
17837         Applying fix from #52429.
17838
17839 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17840
17841         * ecore.cs, expression.cs, statement.cs:
17842         Total rewrite of how we handle branching. We
17843         now handle complex boolean expressions with fewer
17844         jumps. As well if (x == 0) no longer emits a ceq.
17845
17846         if (x is Foo) is much faster now, because we generate
17847         better code.
17848
17849         Overall, we get a pretty big improvement on our benchmark
17850         tests. The code we generate is smaller and more readable.
17851
17852         I did a full two-stage bootstrap. The patch was reviewed
17853         by Martin and Miguel.
17854
17855 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17856
17857         * cs-parser.jay: Make primary_expression not take a QI.
17858         we dont need this because the member_access rule covers
17859         us here. So we replace the rule with just IDENTIFIER.
17860
17861         This has two good effects. First, we remove a s/r conflict.
17862         Second, we allocate many fewer QualifiedIdentifier objects.
17863
17864 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17865
17866         * attribute.cs: Handle MarshalAs attributes as pseudo, and
17867         set the correct information via SRE. This prevents
17868         hanging on the MS runtime. Fixes #29374.
17869
17870 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17871
17872         * convert.cs: correctly handle conversions to value types
17873         from Enum and ValueType as unboxing conversions.
17874
17875         Fixes bug #52569. Patch by Benjamin Jemlich.
17876
17877 2004-01-02  Ravi Pratap  <ravi@ximian.com>
17878
17879         * expression.cs (BetterConversion): Prefer int -> uint
17880         over int -> ulong (csc's behaviour). This fixed bug #52046.
17881
17882 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17883
17884         * decl.cs (MemberCache.FindMembers): now returns a
17885         MemberInfo [].
17886
17887         * typemanager.cs: In general, go with with ^^.
17888         (CopyNewMethods): take an IList.
17889         (RealMemberLookup): Only allocate an arraylist
17890         if we copy from two sets of methods.
17891
17892         This change basically does two things:
17893         1) Fewer array lists allocated due to CopyNewMethods.
17894         2) the explicit cast in MemberList costed ALOT.
17895
17896 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
17897
17898         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17899         a hashtable to avoid needless string allocations when an identifier is
17900         used more than once (the common case).
17901
17902 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17903
17904         * pending.cs: MS's TypeBuilder.GetInterfaces ()
17905         is broken, it will not return anything. So, we
17906         have to use the information we have in mcs to
17907         do the task.
17908
17909         * typemanager.cs: Add a cache for GetInterfaces,
17910         since this will now be used more often (due to ^^)
17911
17912         (GetExplicitInterfaces) New method that gets the
17913         declared, not effective, interfaces on a type
17914         builder (eg, if you have interface IFoo, interface
17915         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17916         { IBar }.
17917
17918         This patch makes MCS able to bootstrap itself on
17919         Windows again.
17920
17921 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17922
17923         * expression.cs: Remove the Nop's that Miguel put
17924         in by mistake.
17925
17926 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17927
17928         * report.cs, codegen.cs: Give the real stack trace to
17929         the error when an exception is thrown.
17930
17931 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17932
17933         * decl.cs: only allocate hashtables for ifaces if 
17934         it is an iface!
17935
17936 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17937
17938         * expression.cs: fix the error from cs0121-2.cs
17939         (a parent interface has two child interfaces that
17940         have a function with the same name and 0 params
17941         and the function is called through the parent).
17942
17943 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17944
17945         * class.cs, rootcontext.cs, typmanager.cs: do not
17946         leak pointers.
17947
17948 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17949
17950         * codegen.cs: remove stack for the ec flow branching.
17951         It is already a linked list, so no need.
17952
17953 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17954
17955         * Makefile: Allow custom profiler here.
17956
17957 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17958
17959         * typemanager.cs (LookupType):
17960           - Use a static char [], because split takes
17961             a param array for args, so it was allocating
17962             every time.
17963           - Do not store true in a hashtable, it boxes.
17964
17965 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17966
17967         * flowanalysis.cs: bytify common enums.
17968
17969 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17970
17971         * modifiers.cs: Add a new set of flags for the
17972         flags allowed on explicit interface impls.
17973         * cs-parser.jay: catch the use of modifiers in
17974         interfaces correctly.
17975         * class.cs: catch private void IFoo.Blah ().
17976
17977         All related to bug #50572.
17978
17979 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17980
17981         * decl.cs: Rewrite the consistant accessability checking.
17982         Accessability is not linear, it must be implemented in
17983         a tableish way. Fixes #49704.
17984
17985 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17986
17987         * expression.cs: Handle negation in a checked context.
17988         We must use subtraction from zero. Fixes #38674.
17989
17990 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17991
17992         * class.cs: Ignore static void main in DLLs.
17993         * rootcontext.cs: Handle the target type here,
17994         since we are have to access it from class.cs
17995         * driver.cs: account for the above.
17996
17997 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17998
17999         * report.cs: Give line numbers and files if available.
18000
18001 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18002
18003         * driver.cs: Implement /addmodule.
18004
18005         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18006         ModuleBuilders.
18007
18008 2003-12-20  Martin Baulig  <martin@ximian.com>
18009
18010         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18011         (FieldBase.IsAssigned): Removed this field.
18012         (FieldBase.SetAssigned): New public method.
18013         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18014
18015 2003-12-20  Martin Baulig  <martin@ximian.com>
18016
18017         * expression.cs (LocalVariableReference.DoResolve): Don't set
18018         `vi.Used' if we're called from DoResolveLValue().
18019
18020         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18021         returns the usage vector it just merged into the current one -
18022         pass this one to UsageWarning().
18023         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18024         of the `EmitContext', don't call this recursively on our children.
18025
18026 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18027
18028         * driver.cs: Implement /target:module.
18029
18030 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18031
18032         * support.cs (CharArrayHashtable): New helper class.
18033
18034         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18035         char arrays, not strings, so we can avoid creating a string in
18036         consume_identifier if the identifier is a keyword.
18037
18038 2003-12-16  Martin Baulig  <martin@ximian.com>
18039
18040         * statement.cs (LocalInfo.Assigned): Removed this property.
18041         (LocalInfo.Flags): Removed `Assigned'.
18042         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18043         and uses flow analysis.
18044         (Block.UsageWarning): Made this method private.
18045         (Block.Resolve): Call UsageWarning() if appropriate.
18046
18047         * expression.cs (LocalVariableReference.DoResolve): Always set
18048         LocalInfo.Used here.
18049
18050 2003-12-13  Martin Baulig  <martin@ximian.com>
18051
18052         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18053         any value here; we're now using flow analysis to figure out
18054         whether a statement/block returns a value.
18055
18056 2003-12-13  Martin Baulig  <martin@ximian.com>
18057
18058         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18059         working again.
18060         (FlowBranching.MergeFinally): Don't call
18061         `branching.CheckOutParameters()' here, this is called in
18062         MergeTopBlock().
18063         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18064         when adding the `finally' vector.       
18065
18066 2003-12-13  Martin Baulig  <martin@ximian.com>
18067
18068         * flowanalysis.cs
18069         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18070         actually work and also fix #48962.
18071
18072 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18073
18074         * decl.cs: Do not check System.Object for nested types,
18075         since we know it does not have any. Big bang for buck:
18076
18077         BEFORE:
18078            Run 1:   8.35 seconds
18079            Run 2:   8.32 seconds
18080            corlib:  17.99 seconds
18081         AFTER:
18082            Run 1:   8.17 seconds
18083            Run 2:   8.17 seconds
18084            corlib:  17.39 seconds
18085
18086 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18087
18088         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18089         time we are returning 0 members, so we save alot here.
18090
18091 2003-12-11  Martin Baulig  <martin@ximian.com>
18092
18093         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18094         `MergeChild()', also just take the `FlowBranching' as argument;
18095         call Merge() on it and return the result.
18096         (FlowBranching.Merge): We don't need to do anything if we just
18097         have one sibling.
18098
18099 2003-12-11  Martin Baulig  <martin@ximian.com>
18100
18101         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18102         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18103         Maurer for this idea.
18104
18105 2003-12-11  Martin Baulig  <martin@ximian.com>
18106
18107         * flowanalysis.cs (MergeResult): This class is now gone; we now
18108         use the `UsageVector' for this.  The reason for this is that if a
18109         branching just has one sibling, we don't need to "merge" them at
18110         all - that's the next step to do.
18111         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18112         `MergeResult'.
18113
18114 2003-12-11  Martin Baulig  <martin@ximian.com>
18115
18116         Reworked flow analyis and made it more precise and bug-free.  The
18117         most important change is that we're now using a special `Reachability'
18118         class instead of having "magic" meanings of `FlowReturns'.  I'll
18119         do some more cleanups and optimizations and also add some more
18120         documentation this week.
18121
18122         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18123         largely reworked this class.
18124         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18125         the new `Reachability' class instead of having "magic" values here.
18126         (FlowBranching): We're now using an instance of `Reachability'
18127         instead of having separate `Returns', `Breaks' etc. fields.
18128
18129         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18130         based on flow analysis; ignore the return value of block.Emit ().
18131
18132 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18133
18134         * driver.cs typemanager.cs: Find the mono extensions to corlib even
18135         if they are private.
18136
18137 2003-12-09  Martin Baulig  <martin@ximian.com>
18138
18139         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18140         call them directly on the UsageVector.
18141
18142 2003-12-09  Martin Baulig  <martin@ximian.com>
18143
18144         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18145         Changed return type from `FlowReturns' to `Reachability'.
18146
18147 2003-12-09  Martin Baulig  <martin@ximian.com>
18148
18149         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18150         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18151         `Reachable' fields with a single `Reachability' one.
18152
18153 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18154
18155         * class.cs (FindMembers): Remove foreach's.
18156
18157         Bootstrap times:
18158
18159         BEFORE
18160                 Run 1:   8.74 seconds
18161                 Run 2:   8.71 seconds
18162
18163         AFTER
18164                 Run 1:   8.64 seconds
18165                 Run 2:   8.58 seconds
18166
18167
18168 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18169
18170         * cs-parser.jay:
18171         * gen-treedump.cs:
18172         * statement.cs:
18173         This patch does a few things:
18174                 1. EmptyStatement is now a singleton, so it is never reallocated.
18175                 2. All blah is EmptyStatement constructs have been changed to
18176                    blah == EmptyStatement.Value, which is much faster and valid
18177                    now that EmptyStatement is a singleton.
18178                 3. When resolving a block, rather than allocating a new array for
18179                    the non-empty statements, empty statements are replaced with
18180                    EmptyStatement.Value
18181                 4. Some recursive functions have been made non-recursive.
18182         Mainly the performance impact is from (3), however (1) and (2) are needed for
18183         this to work. (4) does not make a big difference in normal situations, however
18184         it makes the profile look saner.
18185
18186         Bootstrap times:
18187
18188         BEFORE
18189         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18190         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18191         Total memory allocated: 56397 KB
18192
18193         AFTER
18194         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18195         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18196         Total memory allocated: 55666 KB
18197
18198 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18199
18200         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18201         than the hashtable in a hashtable version
18202
18203         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18204         we always end up concating a string. This results in a huge perf
18205         loss, because many strings have to be tracked by the GC. In this
18206         patch, we first use a hashtable that works with two keys, so that
18207         the strings do not need to be concat'ed.
18208
18209         Bootstrap times:
18210         BEFORE
18211                 Run 1:   8.74 seconds
18212                 Run 2:   8.71 seconds
18213
18214         AFTER
18215                 Run 1:   8.65 seconds
18216                 Run 2:   8.56 seconds
18217
18218 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18219
18220         * Makefile: Add a new target `do-time' that does a quick and simple
18221         profile, leaving easy to parse output.
18222
18223 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18224
18225         * codegen.cs (Init): Create the dynamic assembly with 
18226         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18227
18228 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18229
18230         * support.cs: Make the PtrHashtable use only one
18231         instance of its comparer.
18232
18233 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18234
18235         * typemanager.cs: Fix lookup of GetNamespaces.
18236
18237 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * expression.cs: Removed redundant line.
18240
18241         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18242         ArrayLists, use for loops with bounds.  
18243
18244         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18245         arraylist.
18246
18247         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18248         arraylists, use for loop with bounds.
18249
18250         The above three changes give us a 0.071 second performance
18251         improvement out of 3.294 seconds down to 3.223.  On my machine
18252         the above changes reduced the memory usage by 1,387 KB during
18253         compiler bootstrap.
18254
18255         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18256         QualifiedIdentifiers.  Before we created a new string through
18257         concatenation, and mostly later on, the result would be
18258         manipulated by DecomposeQI through string manipulation.
18259
18260         This reduced the compiler memory usage for bootstrapping from
18261         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18262         compile times in 0.05 seconds.
18263
18264 2003-11-28  Dick Porter  <dick@ximian.com>
18265
18266         * support.cs: Do string compares with the Invariant culture.
18267
18268         * rootcontext.cs: 
18269         * gen-treedump.cs: 
18270         * expression.cs: 
18271         * driver.cs: 
18272         * decl.cs: 
18273         * codegen.cs: 
18274         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18275         the comparison is done with the Invariant culture.
18276
18277 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18278
18279         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18280         GetEnumerator method.
18281
18282         (ProbeCollectionType): Iterate starting at the most specific type
18283         upwards looking for a GetEnumerator
18284
18285         * expression.cs: Shift count can be up to 31 for int/uint and 63
18286         for long/ulong.
18287
18288 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18289
18290         * statement.cs (Block.LookupLabel): Also look for the label on the
18291         children blocks.  Use a hash table to keep track of visited
18292         nodes. 
18293
18294         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18295         we actually did transform the other operand, otherwise fall back
18296         to the common codepath that casts to long.
18297
18298         * cs-tokenizer.cs: Use the same code pattern as the int case.
18299         Maybe I should do the parsing myself, and avoid depending on the
18300         Parse routines to get this done.
18301
18302 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18303
18304         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18305         which fixes bug 51347.  This time test it.
18306
18307         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18308         attributes for example can not tell the difference between these.
18309         The difference was only a syntax feature of the language. 
18310
18311         * attribute.cs: Apply attributes to delegates.
18312
18313         * delegate.cs: Call the apply attributes method.
18314
18315 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18316
18317         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18318         comparing 0 vs Byte.MinValue, not the value
18319
18320         (ImplicitConversionRequired): When reporting a conversion error,
18321         use error 31 to print out the constant error instead of the
18322         simpler 29.
18323
18324         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18325         which fixes bug 51347.
18326
18327 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18328
18329         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18330         which fixes the -warnaserror command line option.
18331
18332 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18333
18334         * cfold.cs (DoNumericPromotions): During constant folding of
18335         additions on UIntConstant, special case intconstants with
18336         IntConstants like we do on the expression binary operator. 
18337
18338 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * convert.cs (ImplicitReferenceConversion): We were missing a case
18341         (System.Enum are not value types or class types, so we need to
18342         classify them separatedly).
18343
18344         * driver.cs: We do not support error 2007.
18345
18346 2003-11-12 Jackson Harper <jackson@ximian.com>
18347
18348         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18349         system directory. Also use the full file name so users can
18350         libraries names mscorlib-o-tron.dll in a non system dir.
18351
18352 2003-11-10  Martin Baulig  <martin@ximian.com>
18353
18354         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18355         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18356         calling `ResolveType()' on them, directly assign their `Type'.
18357
18358 2003-11-08  Martin Baulig  <martin@ximian.com>
18359
18360         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18361         return value and the `out parent' parameter.
18362         (TypeContainer.DefineType): Moved the CS0644 check into
18363         GetClassBases().  Don't pass the interface types to the
18364         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18365         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18366
18367         * ecore.cs (TypeExpr.IsAttribute): New property.
18368         (TypeExpr.GetInterfaces): New method.
18369
18370         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18371         TypeExpr instead of a Type.
18372         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18373         (Interface.DefineType): Don't pass the interface types to the
18374         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18375         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18376
18377         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18378         instead of a `Type[]'.
18379         (TypeManager.RegisterBuilder): Likewise.
18380         (TypeManager.AddUserInterface): Likewise.
18381         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18382         `Type[]' and also return a `TypeExpr[]'.
18383         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18384
18385 2003-11-08  Martin Baulig  <martin@ximian.com>
18386
18387         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18388         Expression.     
18389
18390 2003-11-08  Martin Baulig  <martin@ximian.com>
18391
18392         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18393         TypeManager.ResolveExpressionTypes().
18394
18395         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18396         instead of an Expression.
18397         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18398         (TypeExpression): New public class; formerly known as `TypeExpr'.
18399
18400         * expression.cs (ComposedCast): Derive from TypeExpr.
18401
18402         * typemanager.cs (TypeManager.system_*_expr): These are now
18403         TypExpr's instead of Expression's.
18404         (TypeManager.ResolveExpressionTypes): New public static function;
18405         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18406         of them.        
18407
18408 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * expression.cs (New.DoResolve): Do not dereference value that
18411         might be a null return.
18412
18413         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18414         sure that the constant value has the right type.  Fixes an
18415         unreported bug, similar to 50425.
18416
18417         * const.cs (Const.LookupConstantValue): Call
18418         ImplicitStandardConversionExists before doing a conversion to
18419         avoid havng the TypeManager.ChangeType do conversions.
18420
18421         Reduced the number of casts used
18422
18423         (Const.ChangeType): New routine to enable reuse of the constant
18424         type changing code from statement.
18425
18426         * typemanager.cs (ChangeType): Move common initialization to
18427         static global variables.
18428
18429         Fixes #50425.
18430
18431         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18432         every value type to go through, even if it was void.  Fix that. 
18433
18434         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18435         character of the define, and the is_identifier_part_character for
18436         the rest of the string.
18437
18438 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18439
18440         * expression.cs (UnaryMutator.EmitCode): When I updated
18441         LocalVariableReference.DoResolve, I overdid it, and dropped an
18442         optimization done on local variable references.
18443
18444 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18445
18446         * ecore.cs: Convert the return from Ldlen into an int.
18447
18448 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18449
18450         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18451         the accessibility, this is a special case for toplevel non-public
18452         classes (internal for instance).
18453
18454 2003-10-20  Nick Drochak <ndrochak@gol.com>
18455
18456         * ecore.cs: Fix typo and build.  Needed another right paren.
18457
18458 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18459
18460         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18461         `internal' case regular and protected, but not allowing protected
18462         to be evaluated later.  Bug 49840
18463
18464 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18465
18466         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18467         to kb.Nlast, and not the kb.nFirst to isolate the switch
18468         statement.
18469
18470         Extract the underlying type, so enumerations of long/ulong are
18471         treated like long/ulong.
18472
18473 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18474
18475         * expression.cs (New): Overload the meaning of RequestedType to
18476         track the possible creation of the NewDelegate type, since
18477         DoResolve is invoked more than once for new constructors on field
18478         initialization.
18479
18480         See bugs: #48800 and #37014
18481
18482         * cs-parser.jay (declare_local_constants): Take an arraylist
18483         instead of a single constant.
18484
18485         (local_constant_declaration): It should take a
18486         constant_declarators, not a constant_declarator.  Fixes 49487
18487
18488         * convert.cs: Fix error report.
18489
18490 2003-10-13 Jackson Harper <jackson@ximian.com>
18491
18492         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18493         bug #49611
18494
18495 2003-10-09  Martin Baulig  <martin@ximian.com>
18496
18497         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18498         to the .ctor.
18499         (MethodCore.DoDefineParameters): Removed the TypeContainer
18500         argument; use the DeclSpace which was passed to the .ctor instead.
18501         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18502         TypeContainer; we only need a DeclSpace here.
18503
18504 2003-10-09  Martin Baulig  <martin@ximian.com>
18505
18506         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18507         to the .ctor.
18508         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18509         EmitContext's .ctor.    
18510
18511 2003-10-09  Martin Baulig  <martin@ximian.com>
18512
18513         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18514         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18515         AsAccessible(), moved them as well.
18516
18517         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18518
18519 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18520
18521         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18522
18523 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18524
18525         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18526         generation for >=, as spotted by Paolo, bug 48679.  
18527         Patch from David Waite.
18528
18529         * cs-tokenizer.cs: Add handling for #pragma.
18530
18531         * cs-parser.jay: Allow for both yield and yield return in the
18532         syntax.  The anti-cobolization of C# fight will go on!
18533
18534         * class.cs (TypeBuilder.DefineType): Catch error condition here
18535         (Parent.DefineType erroring out and returning null).
18536
18537         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18538         coping with enumerations variables, we were mistakenly processing
18539         them as a regular value type instead of built-in types.  Fixes the
18540         bug #48063
18541
18542         * typemanager.cs (IsBuiltinOrEnum): New method.
18543
18544 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18545
18546         * cs-parser.jay: Upgrade: yield now needs the return clause.
18547
18548 2003-09-19  Martin Baulig  <martin@ximian.com>
18549
18550         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18551         `MemberCache parent' argument.  Normally, an interface doesn't
18552         have a parent type except System.Object, but we use this in gmcs
18553         for generic type parameters.
18554
18555 2003-09-18  Martin Baulig  <martin@ximian.com>
18556
18557         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18558         on `type.IsInterface'; don't check whether the type has a parent
18559         to determine whether it's an interface.
18560
18561 2003-09-15  Martin Baulig  <martin@ximian.com>
18562
18563         * class.cs (TypeContainer.DefineType): Added an error flag to
18564         avoid reporting duplicate CS0146's ("class definition is
18565         circular.").
18566
18567         * driver.cs (Driver.MainDriver): Abort if
18568         RootContext.ResolveTree() reported any errors.
18569
18570 2003-09-07  Martin Baulig  <martin@ximian.com>
18571
18572         * report.cs (Error, Warning): Added overloaded versions which take
18573         a `params object[] args' and call String.Format().
18574
18575 2003-09-07  Martin Baulig  <martin@ximian.com>
18576
18577         * decl.cs (DeclSpace..ctor): Don't call
18578         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18579         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18580         (DeclSpace.RecordDecl): New method.
18581
18582         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18583
18584 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18585
18586         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18587         value attributes to be applied to ParameterBuilders.
18588
18589         * class.cs (MethodCore.LabelParameters): Make static and more
18590         generic so that it can be used from other places - like interface
18591         methods, for instance.
18592
18593         * interface.cs (Interface.Emit): Call LabelParameters before
18594         emitting attributes on the InterfaceMethod.
18595
18596 2003-08-26  Martin Baulig  <martin@ximian.com>
18597
18598         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18599         resolving aliases; fixes #47927.
18600
18601 2003-08-26  Martin Baulig  <martin@ximian.com>
18602
18603         * statement.cs (Using.DoResolve): This is internally emitting a
18604         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18605         do not always return.  Fixes #47681.
18606
18607 2003-08-26  Martin Baulig  <martin@ximian.com>
18608
18609         * decl.cs (MemberCore): Moved WarningNotHiding(),
18610         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18611         into MemberBase.
18612         (AdditionResult): Make this nested in DeclSpace.
18613         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18614         argument; call NamespaceEntry.Define() unless we're nested in a
18615         class or struct.
18616
18617         * namespace.cs (Namespace.DefineName): New public function.  This
18618         is called from DeclSpace's .ctor to add 
18619         (Namespace.Lookup): Include DeclSpaces in the lookup.
18620
18621         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18622
18623         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18624
18625 2003-08-25  Martin Baulig  <martin@ximian.com>
18626
18627         * convert.cs (Convert.ExplicitReferenceConversion): When
18628         converting from an interface type to a class, unbox if the target
18629         type is a struct type.  Fixes #47822.
18630
18631 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18632
18633         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18634         #47854.
18635
18636 2003-08-22  Martin Baulig  <martin@ximian.com>
18637
18638         * class.cs (TypeManager.DefineType): When defining a nested type,
18639         call DefineType() on our parent; fixes #47801.
18640
18641 2003-08-22  Martin Baulig  <martin@ximian.com>
18642
18643         * class.cs (MethodData.Define): While checking if a method is an
18644         interface implementation, improve the test a bit more to fix #47654.
18645
18646 2003-08-22  Martin Baulig  <martin@ximian.com>
18647
18648         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18649         correctly; fixes #47722.
18650
18651 2003-08-22  Martin Baulig  <martin@ximian.com>
18652
18653         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18654         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
18655
18656         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
18657
18658 2003-08-22  Martin Baulig  <martin@ximian.com>
18659
18660         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18661         can only be assigned in static constructors.  Fixes #47161.
18662
18663 2003-08-22  Martin Baulig  <martin@ximian.com>
18664
18665         Rewrote and improved the flow analysis code.
18666
18667         * flowbranching.cs (FlowBranching): Make this class abstract.
18668         (FlowBranching.CreateBranching): New static function to create a
18669         new flow branching.
18670         (FlowBranchingBlock, FlowBranchingException): New classes.
18671         (FlowBranching.UsageVector.Type): New public readonly field.
18672         (FlowBranching.UsageVector.Breaks): Removed the setter.
18673         (FlowBranching.UsageVector.Returns): Removed the setter.
18674         (FlowBranching.UsageVector): Added Break(), Return(),
18675         NeverReachable() and Throw() methods to modify the reachability.
18676         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18677         done by FlowBranching.Merge().
18678         (FlowBranching.UsageVector.MergeChild): New method; merges the
18679         merge result into the current vector.
18680         (FlowBranching.Merge): New abstract method to merge a branching.
18681
18682 2003-08-12  Martin Baulig  <martin@ximian.com>
18683
18684         * expression.cs (Indirection.CacheTemporaries): Create the
18685         LocalTemporary with the pointer type, not its element type.
18686
18687 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18690         token was a keyword or not.
18691
18692         Add `error' options where an IDENTIFIER was expected;  Provide
18693         CheckToken and CheckIdentifierToken convenience error reporting
18694         functions. 
18695
18696         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18697
18698         * decl.cs: Rename `NamespaceEntry Namespace' public field into
18699         NameSpaceEntry NameSpaceEntry.
18700
18701         (LookupInterfaceOrClass): Avoid creating a full qualified name
18702         from namespace and name: avoid doing lookups when we know the
18703         namespace is non-existant.   Use new Tree.LookupByNamespace which
18704         looks up DeclSpaces based on their namespace, name pair.
18705
18706         * driver.cs: Provide a new `parser verbose' to display the
18707         exception thrown during parsing.  This is turned off by default
18708         now, so the output of a failure from mcs is more graceful.
18709
18710         * namespace.cs: Track all the namespaces defined in a hashtable
18711         for quick lookup.
18712
18713         (IsNamespace): New method
18714
18715 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
18716
18717         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
18718         we know that we need to concatenate (full typename can never be
18719         null). 
18720
18721         * class.cs: ditto.
18722
18723         * statement.cs: Use a bitfield;  Do not initialize to null things
18724         which are done by the constructor by default.
18725
18726         * cs-parser.jay: bug fix, parameter was 4, not 3.
18727
18728         * expression.cs: Just use the property;
18729
18730         * statement.cs: No need for GetVariableInfo method.
18731
18732 2003-08-08  Martin Baulig  <martin@ximian.com>
18733
18734         * flowanalysis.cs (FlowReturns): This is now nested in the
18735         `FlowBranching' class.
18736         (MyBitVector): Moved this here from statement.cs.
18737         (FlowBranching.SiblingType): New enum type.
18738         (FlowBranching.CreateSibling): Added `SiblingType' argument.
18739
18740 2003-08-07  Martin Baulig  <martin@ximian.com>
18741
18742         * flowanalysis.cs (FlowBranchingType): This is now nested in the
18743         `FlowBranching' class and called `BranchingType'.
18744
18745 2003-08-07  Martin Baulig  <martin@ximian.com>
18746
18747         * flowanalysis.cs: Moved all the control flow analysis code into
18748         its own file.
18749
18750 2003-08-07  Martin Baulig  <martin@ximian.com>
18751
18752         * assign.cs (Assign.DoResolve): `target' must either be an
18753         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
18754         #37319.
18755
18756 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
18757
18758         * expression.cs (BinaryMethod): This kind of expression is created by the
18759         Binary class if it determines that the operator has to be handled
18760         by a method.
18761
18762         (BinaryDelegate): This kind of expression is created if we are
18763         dealing with a + or - operator on delegates.
18764
18765         (Binary): remove method, argumetns, and DelegateOperator: when
18766         dealing with methods, 
18767
18768         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18769
18770         * statement.cs (Block): use bitfields for the three extra booleans
18771         we had in use.   Remove unused topblock parameter.
18772
18773         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18774
18775         * assign.cs: Drop extra unneeded tests.
18776
18777 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
18778
18779         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18780
18781         * statement.cs (Foreach): Use VariableStorage instead of
18782         LocalBuilders.   
18783
18784         * codegen.cs (VariableStorage): New class used by clients that
18785         require a variable stored: locals or fields for variables that
18786         need to live across yield.
18787
18788         Maybe provide a convenience api for EmitThis+EmitLoad?
18789
18790         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18791         these bad boys.
18792
18793 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
18794
18795         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18796         RemapParameterLValue): New methods that are used to turn a
18797         precomputed FieldInfo into an expression like this:
18798
18799                 instance.FieldInfo
18800
18801         The idea is to use this instead of making LocalVariableReference
18802         have more than one meaning.
18803
18804         * cs-parser.jay: Add error production to BASE.
18805
18806         * ecore.cs: Deal with TypeManager.GetField returning null, which
18807         is now a valid return value.
18808
18809         (FieldExprNoAddress): New expression for Fields whose address can
18810         not be taken.
18811
18812         * expression.cs (LocalVariableReference): During the resolve
18813         phases, create new expressions if we are in a remapping context.
18814         Remove code that dealt with remapping here.
18815
18816         (ParameterReference): same.
18817
18818         (ProxyInstance): New expression, like the `This' expression, but
18819         it is born fully resolved.  We know what we are doing, so remove
18820         the errors that are targeted to user-provided uses of `this'.
18821
18822         * statement.cs (Foreach): our variable is now stored as an
18823         Expression;  During resolution, follow the protocol, dont just
18824         assume it will return this.
18825
18826 2003-08-06  Martin Baulig  <martin@ximian.com>
18827
18828         * support.cs (SeekableStreamReader.cs): New public class.
18829
18830         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18831         SeekableStreamReader instead of the normal StreamReader.
18832
18833 2003-08-04  Martin Baulig  <martin@ximian.com>
18834
18835         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18836         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18837         deambiguate casts and delegate invocations.
18838         (parenthesized_expression): Use the new tokens to ensure this is
18839         not a cast of method invocation.
18840
18841         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18842         when reading a `)' and Deambiguate_CloseParens () was previously
18843         called.
18844
18845         * expression.cs (ParenthesizedExpression): New class.  This is
18846         just used for the CS0075 test.
18847         (Binary.DoResolve): Check for CS0075.   
18848
18849 2003-07-29  Ravi Pratap  <ravi@ximian.com>
18850
18851         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18852         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18853         reference comparison.
18854
18855         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18856         examine the ReturnType for equality - this is necessary in the
18857         cases of implicit and explicit operators whose signature also
18858         includes the return type.
18859
18860 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * namespace.cs: Cache the result of the namespace computation,
18863         instead of computing it every time.
18864
18865 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
18866
18867         * decl.cs: Use a global arraylist that we reuse over invocations
18868         to avoid excesive memory consumption.  Reduces memory usage on an
18869         mcs compile by one meg (45 average).
18870
18871         * typemanager.cs (LookupTypeReflection): In .NET pointers are
18872         private, work around that.
18873
18874 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
18875
18876         * literal.cs (IntLiteral): Define Zero and One static literals. 
18877
18878         * cs-parser.jay (integer_literal): use static literals to reduce
18879         memory usage for the most used literals (0, 1 and -1).  211kb
18880         reduced in memory usage.
18881
18882         Replace all calls to `new ArrayList' with `new
18883         ArrayList(4)' which is a good average number for most allocations,
18884         and also requires only 16 bytes of memory for its buffer by
18885         default. 
18886
18887         This reduced MCS memory usage in seven megabytes for the RSS after
18888         bootstrapping.
18889
18890 2003-07-28  Ravi Pratap  <ravi@ximian.com>
18891
18892         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18893         handle params methods the correct way by forming only one
18894         applicable set with params and normal methods in them. Earlier we
18895         were looking at params methods only if we found no normal methods
18896         which was not the correct thing to do.
18897
18898         (Invocation.BetterFunction): Take separate arguments indicating
18899         when candidate and the best method are params methods in their
18900         expanded form.
18901
18902         This fixes bugs #43367 and #46199.
18903
18904         * attribute.cs: Documentation updates.
18905
18906         (CheckAttribute): Rename to CheckAttributeTarget.
18907         (GetValidPlaces): Rename to GetValidTargets.
18908
18909         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18910         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18911
18912         Fixes bug #44468.
18913
18914 2003-07-28  Martin Baulig  <martin@ximian.com>
18915
18916         * class.cs (TypeContainer.DefineMembers): Use the base type's full
18917         name when looking up the base class of a nested class.  Fixes #46977.
18918
18919 2003-07-26  Martin Baulig  <martin@ximian.com>
18920
18921         * expression.cs (Indexers.Indexer): New nested struct; contains
18922         getter, setter and the indexer's type.
18923         (Indexers.Properties): This is now an ArrayList of
18924         Indexers.Indexer's.
18925         (IndexerAccess.DoResolveLValue): Correctly set the type if the
18926         indexer doesn't have any getters.
18927
18928         * assign.cs (Assign.DoResolve): Also do the implicit conversions
18929         for embedded property and indexer assignments.
18930
18931 2003-07-26  Martin Baulig  <martin@ximian.com>
18932
18933         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18934         preprocessor directive is not the first non-whitespace character
18935         on a line.
18936
18937 2003-07-26  Martin Baulig  <martin@ximian.com>
18938
18939         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18940         namespace parsing, follow the spec more closely.
18941
18942         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18943         NamespaceEntry.Lookup().
18944
18945 2003-07-25  Martin Baulig  <martin@ximian.com>
18946
18947         * MethodCore.cs (OverridesSomething): New public field; it's set
18948         from TypeContainer.DefineMembers if this method overrides
18949         something (which doesn't need to be a method).  Fix #39462.
18950
18951 2003-07-25  Ravi Pratap  <ravi@ximian.com>
18952
18953         * typemanager.cs (GetMembers): Ensure that the list of members is
18954         reversed. This keeps things in sync.
18955
18956         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18957         find an AttributeUsage attribute.
18958
18959         * expression.cs (Invocation.OverloadResolve): Perform the check
18960         which disallows Invoke to be directly called on a Delegate.
18961
18962         (Error_InvokeOnDelegate): Report error cs1533.
18963
18964 2003-07-25  Martin Baulig  <martin@ximian.com>
18965
18966         * expression.cs (Indexers.GetIndexersForType): Only look in the
18967         interface hierarchy if the requested type is already an
18968         interface.  Fixes #46788 while keeping #46502 fixed.
18969
18970 2003-07-25  Martin Baulig  <martin@ximian.com>
18971
18972         * class.cs (TypeContainer.DefineMembers): Check whether all
18973         readonly fields have been assigned and report warning CS0649 if
18974         not.
18975
18976         * statement.cs (LocalInfo.IsFixed): Always return true if this is
18977         a valuetype.
18978
18979 2003-07-24  Ravi Pratap  <ravi@ximian.com>
18980
18981         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18982         returned from GetMethods to make things consistent with the
18983         assumptions MCS makes about ordering of methods.
18984
18985         This should comprehensively fix bug #45127 and it does :-)
18986
18987         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18988         ordering is actually reverse.
18989
18990         * Clean up some debug messages I left lying around.
18991
18992         * interface.cs (Populate*): Get rid of code which emits attributes
18993         since the stage in which we emit attributes is the 'Emit' stage,
18994         not the define stage.
18995
18996         (Emit): Move attribute emission for interface members here.
18997
18998 2003-07-22  Ravi Pratap  <ravi@ximian.com>
18999
19000         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19001         closely: we eliminate methods in base types when we have an
19002         applicable method in a top-level type.
19003
19004         Please see section 14.5.5.1 for an exact description of what goes
19005         on. 
19006
19007         This fixes bug #45127 and a host of other related to corlib compilation.
19008
19009         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19010         array is the method corresponding to the top-level type (this is
19011         because of the changes made to icall.c) so we change this
19012         accordingly.
19013
19014         (MethodGroupExpr.Name): This too.
19015
19016         * typemanager.cs (GetElementType): New method which does the right
19017         thing when compiling corlib. 
19018
19019         * everywhere: Make use of the above in the relevant places.
19020
19021 2003-07-22  Martin Baulig  <martin@ximian.com>
19022
19023         * cs-parser.jay (invocation_expression): Moved
19024         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19025         `cast_expression', but create a InvocationOrCast which later
19026         resolves to either an Invocation or a Cast.
19027
19028         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19029         method; call this before EmitStatement() to make sure that this
19030         expression can be used as a statement.
19031
19032         * expression.cs (InvocationOrCast): New class; resolves to either
19033         an Invocation or a Cast.
19034
19035         * statement.cs (StatementExpression): Call ResolveStatement() on
19036         the ExpressionStatement before emitting it.
19037
19038 2003-07-21  Martin Baulig  <martin@ximian.com>
19039
19040         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19041         `ref' and `out' attributes match; fixes #46220.
19042         (MemberAccess.ResolveMemberAccess): You can't reference a type
19043         through an expression; fixes #33180.
19044         (Indexers.GetIndexersForType): Don't return the indexers from
19045         interfaces the class implements; fixes #46502.
19046
19047 2003-07-21  Martin Baulig  <martin@ximian.com>
19048
19049         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19050         CS0661 checks; fixes bug #30442.
19051
19052 2003-07-21  Martin Baulig  <martin@ximian.com>
19053
19054         * decl.cs (AdditionResult): Added `Error'.
19055
19056         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19057
19058         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19059         makes cs0031.cs actually work.
19060
19061 2003-07-20  Martin Baulig  <martin@ximian.com>
19062
19063         * namespace.cs: Fixed that bug which caused a crash when compiling
19064         the debugger's GUI.
19065
19066 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19067
19068         * typemanager.cs (LookupTypeReflection): Never expose types which
19069         are NotPublic, NestedPrivate, NestedAssembly, or
19070         NestedFamANDAssem.  We used to return these, and later do a check
19071         that would report a meaningful error, but the problem is that we
19072         would not get the real match, if there was a name override.
19073
19074 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * namespace.cs (Namespace, Name): Do not compute the namespace
19077         name dynamically, compute it in the constructor.  This reduced
19078         memory usage by 1697 KB.
19079
19080         * driver.cs: Use --pause to pause at the end.
19081
19082 2003-07-17  Peter Williams  <peter@newton.cx>
19083
19084         * Makefile: Change the name of the test target so that it doesn't
19085         conflict with the recursive test target.
19086
19087 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19088
19089         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19090         AddressOf): Do not use EmitThis, that was wrong, use the actual
19091         this pointer.
19092
19093 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19094
19095         * class.cs (MethodData.Define): While checking if a method is an
19096         interface implementation, improve the test: If we are not public
19097         (use new test here: use the computed MethodAttributes directly,
19098         instead of the parsed modifier flags) check if the `implementing'
19099         method comes from an interface or not.
19100
19101         * pending.cs (VerifyPendingMethods): Slightly better error
19102         message.
19103
19104         * makefile: add test target that does the mcs bootstrap.
19105
19106 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19107
19108         * interface.cs (Define): Do nothing here since there are no
19109         members to populate etc. Move the attribute emission out of here
19110         since this was just totally the wrong place to put it. Attribute
19111         application happens during the 'Emit' phase, not in the 'Define'
19112         phase.
19113
19114         (Emit): Add this method and move the attribute emission here
19115
19116         * rootcontext.cs (EmitCode): Call the Emit method on interface
19117         types too.
19118
19119 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19120
19121         * expression.cs (OverloadResolve): Report error only if Location
19122         is not 'Null' which means that there was a probe going on.
19123
19124 2003-07-14  Martin Baulig  <martin@ximian.com>
19125
19126         * expression.cs (ConditionalLogicalOperator): New public class to
19127         implement user defined conditional logical operators.
19128         This is section 14.11.2 in the spec and bug #40505.
19129
19130 2003-07-14  Martin Baulig  <martin@ximian.com>
19131
19132         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19133
19134 2003-07-14  Martin Baulig  <martin@ximian.com>
19135
19136         * codegen.cs (EmitContext.InFixedInitializer): New public field.
19137
19138         * ecore.cs (IVariable.VerifyFixed): New interface method.
19139
19140         * expression.cs (Unary.ResolveOperator): When resolving the `&'
19141         operator, check whether the variable is actually fixed.  Fixes bug
19142         #36055.  Set a variable definitely assigned when taking its
19143         address as required by the spec.
19144
19145         * statement.cs (LocalInfo.IsFixed): New field.
19146         (LocalInfo.MakePinned): Set `IsFixed' to true.
19147
19148 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19149
19150         * attribute.cs (Attribute.Resolve): While doing a Member lookup
19151         for .ctors, ensure that we only ask for members declared in the
19152         attribute type (BindingFlags.DeclaredOnly).
19153
19154         Fixes bug #43632.
19155
19156         * expression.cs (Error_WrongNumArguments): Report error 1501
19157         correctly the way CSC does.
19158
19159 2003-07-13  Martin Baulig  <martin@ximian.com>
19160
19161         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19162         lookup on the fully qualified name, to make things like "X.X" work
19163         where "X.X" is a fully qualified type name, but we also have a
19164         namespace "X" in the using list.  Fixes #41975.
19165
19166 2003-07-13  Martin Baulig  <martin@ximian.com>
19167
19168         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19169         function. If we're a CompoundAssign, we need to create an embedded
19170         CompoundAssign, not an embedded Assign.
19171         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19172         Fixes #45854.
19173
19174 2003-07-13  Martin Baulig  <martin@ximian.com>
19175
19176         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19177         work to fix bug #46088.
19178
19179 2003-07-13  Ravi Pratap <ravi@ximian.com>
19180
19181         * class.cs (Operator.Emit): Do not emit attributes here - it is
19182         taken care of by the Method class that we delegate too. This takes
19183         care of bug #45876.
19184
19185 2003-07-10  Martin Baulig  <martin@ximian.com>
19186
19187         * expression.cs (TypeOfVoid): New class.
19188         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
19189
19190 2003-07-10  Martin Baulig  <martin@ximian.com>
19191
19192         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19193         bug #35957.
19194
19195 2003-07-10  Martin Baulig  <martin@ximian.com>
19196
19197         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19198         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19199
19200         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19201
19202         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19203
19204 2003-07-10  Martin Baulig  <martin@ximian.com>
19205
19206         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19207         of decimal.  Fixes #42850.
19208
19209         NOTE: I also fixed the created byte blob, but this doesn't work on
19210         the MS runtime and csc never produces any byte blobs for decimal
19211         arrays.
19212
19213 2003-07-10  Martin Baulig  <martin@ximian.com>
19214
19215         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19216         structs; fixes #32068.
19217         (Block.AddChildVariableNames): Fixed #44302.
19218
19219 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19220
19221         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19222
19223 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * attribute.cs: And this test is onger needed.
19226
19227 2003-07-08  Martin Baulig  <martin@ximian.com>
19228
19229         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19230         inaccessible types.  Fixes #36313.
19231
19232         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19233
19234         * namespace.cs (NamespaceEntry): Create implicit entries for all
19235         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19236         implicit entries for N1.N2 and N1.
19237
19238 2003-07-08  Martin Baulig  <martin@ximian.com>
19239
19240         Rewrote the handling of namespaces to fix a lot of the issues
19241         wrt. `using' aliases etc.
19242
19243         * namespace.cs (Namespace): Splitted this class into a
19244         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19245
19246         * typemanager.cs (TypeManager.IsNamespace): Removed.
19247         (TypeManager.ComputeNamespaces): Only compute namespaces from
19248         loaded assemblies here, not the namespaces from the assembly we're
19249         currently compiling.
19250
19251 2003-07-08  Martin Baulig  <martin@ximian.com>
19252
19253         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19254
19255 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19256
19257         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19258         already fixed it.  
19259
19260         I thought about the memory savings here, but LookupTypeReflection
19261         is used under already very constrained scenarios.  Compiling
19262         corlib or mcs only exposes one hit, so it would not really reduce
19263         any memory consumption.
19264
19265 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19266
19267         * typemanager.cs: fixes bug #45889 by only adding public types from
19268         other assemblies to the list of known types.
19269
19270 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19271
19272         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19273         on the type we resolved.
19274
19275 2003-07-05  Martin Baulig  <martin@ximian.com>
19276
19277         * pending.cs (PendingImplementation.ParentImplements): Don't
19278         create the proxy if the parent is abstract.
19279
19280         * class.cs (TypeContainer.DefineIndexers): Process explicit
19281         interface implementations first.  Fixes #37714.
19282
19283 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19284
19285         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19286         defined recursively;  but since we modify the input parameters
19287         (left is set to `this' temporarily), we reset this value if the
19288         left_is_explicit is false, which gives the original semantics to
19289         the code.  
19290
19291         * literal.cs (NullPointer): new class used to represent a null
19292         literal in a pointer context.
19293
19294         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19295         type is a pointer, use a NullPointer object instead of a
19296         NullLiteral.   Closes 43687
19297
19298         (ExplicitConversion): Convert pointer values using
19299         the conv opcode to the proper type.
19300
19301         * ecore.cs (New): change ValueTypeVariable property into a method,
19302         that returns whether the valuetype is suitable for being used.
19303
19304         * expression.cs (Binary.DoNumericPromotions): Only return if we
19305         the int constant was a valid uint, and we can return both left and
19306         right as uints.  If not, we continue processing, to trigger the
19307         type conversion.  This fixes 39018.
19308
19309         * statement.cs (Block.EmitMeta): During constant resolution, set
19310         the CurrentBlock property on the emitcontext, so that we resolve
19311         constants propertly.
19312
19313 2003-07-02  Martin Baulig  <martin@ximian.com>
19314
19315         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19316         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19317
19318         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19319         than emitting it here.
19320
19321         * statement.cs: Fixed some more flow analysis bugs.
19322
19323 2003-07-02  Martin Baulig  <martin@ximian.com>
19324
19325         * class.cs (MethodData.Define): When implementing interface
19326         methods, set Final unless we're Virtual.
19327
19328         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19329         check work for interface methods.
19330
19331 2003-07-01  Martin Baulig  <martin@ximian.com>
19332
19333         * ecore.cs (EmitContext.This): Replaced this property with a
19334         GetThis() method which takes a Location argument.  This ensures
19335         that we get the correct error location for a CS0188.
19336
19337 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19340         ImplicitStandardConversion.
19341
19342         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19343
19344 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19345
19346         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19347         optimization.
19348
19349 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19350
19351         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19352         constructors.
19353
19354         (MethodData.Define): Turn off initlocals for unsafe methods.
19355
19356 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19359         complete;  Fixes #37521.
19360
19361         * delegate.cs: Use Modifiers.TypeAttr to compute the
19362         TypeAttributes, instead of rolling our own.  This makes the flags
19363         correct for the delegates.
19364
19365 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19366
19367         * class.cs (Constructor.Define): Set the private flag for static
19368         constructors as well.
19369
19370         * cs-parser.jay (statement_expression): Set the return value to
19371         null, to avoid a crash when we catch an error.
19372
19373 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * cs-parser.jay: Applied patch from Jackson that adds support for
19376         extern and unsafe modifiers to destructor declarations.
19377
19378         * expression.cs: Report error 21 if the user is trying to index a
19379         System.Array.
19380
19381         * driver.cs: Add an error message, suggested by the bug report.
19382
19383         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19384         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19385
19386 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19387
19388         * namespace.cs: Add some information to reduce FAQs.
19389
19390 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19393         underlying enumeration types.  Fixes #43915.
19394
19395         * expression.cs: Treat ushort/short as legal values to be used in
19396         bitwise operations.
19397
19398 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19399
19400         * delegate.cs: transfer custom attributes for paramenters from
19401         the delegate declaration to Invoke and BeginInvoke.
19402
19403 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19404
19405         * attribute.cs: handle custom marshalers and emit marshal info
19406         for fields, too.
19407
19408 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19409
19410         * makefile.gnu: Added anonymous.cs to the compiler sources.
19411
19412 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19413
19414         * iterators.cs: Change the name of the proxy class to include two
19415         underscores.
19416
19417         * cs-parser.jay: Update grammar to include anonymous methods.
19418
19419         * anonymous.cs: new file.
19420
19421 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19422
19423         * class.cs (Field.Define): Add missing test for pointers and
19424         safety. 
19425
19426 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19427
19428         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19429         we use the stobj opcode.
19430
19431         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19432         since it wasn't the correct fix. 
19433
19434         It still is puzzling that we are required to use stobj for IntPtr
19435         which seems to be a ValueType.
19436
19437 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19438
19439         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19440         during regular simple name resolution.   Now, the trick is that
19441         instead of returning for processing the simplename, we do a
19442         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19443         contextual lookup type).   If a match is found, return that, if
19444         not, return for further composition.
19445
19446         This fixes long-standing 30485.
19447
19448         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19449         using the address to initialize an object, do an Stobj instead of
19450         using the regular Stelem.
19451
19452         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19453         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19454         Because if we are a BaseIndexerAccess that value will be true.
19455         Fixes 43643.
19456
19457         * statement.cs (GotoCase.Resolve): Return after reporting an
19458         error, do not attempt to continue. 
19459
19460         * expression.cs (PointerArithmetic.Emit): If our operand is a
19461         long, convert our constants to match the operand before
19462         multiplying.  Convert to I type before adding.   Fixes 43670.
19463
19464 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19465
19466         * enum.cs (ImplicitConversionExists) : Rename to
19467         ImplicitEnumConversionExists to remove ambiguity. 
19468
19469         * ecore.cs (NullCast): New type of cast expression class which
19470         basically is very similar to EmptyCast with the difference being
19471         it still is a constant since it is used only to cast a null to
19472         something else
19473         (eg. (string) null)
19474
19475         * convert.cs (ImplicitReferenceConversion): When casting a null
19476         literal, we return a NullCast.
19477
19478         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19479         should be around anymore.
19480
19481         The renaming (reported was slightly wrong). Corrections:
19482
19483         ConvertImplicitStandard -> ImplicitConversionStandard
19484         ConvertExplicitStandard -> ExplicitConversionStandard
19485
19486         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19487         before passing them in !
19488
19489         * convert.cs (ImplicitConversionStandard): When comparing for
19490         equal expr and target types, ensure that expr is not a
19491         NullLiteral.
19492
19493         In general, we must not be checking (expr_type ==
19494         target_type) in the top level conversion methods
19495         (ImplicitConversion, ExplicitConversion etc). This checking is
19496         done in the methods that they delegate to.
19497
19498 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19499
19500         * convert.cs: Move Error_CannotConvertType,
19501         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19502         ImplicitNumericConversion, ImplicitConversionExists,
19503         ImplicitUserConversionExists, StandardConversionExists,
19504         FindMostEncompassedType, FindMostSpecificSource,
19505         FindMostSpecificTarget, ImplicitUserConversion,
19506         ExplicitUserConversion, GetConversionOperators,
19507         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19508         TryImplicitIntConversion, Error_CannotConvertImplicit,
19509         ConvertImplicitRequired, ConvertNumericExplicit,
19510         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19511         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19512         its own file.
19513
19514         Perform the following renames:
19515
19516         StandardConversionExists -> ImplicitStandardConversionExists
19517         ConvertImplicit -> ImplicitConversion
19518         ConvertImplicitStandard -> ImplicitStandardConversion
19519         TryImplicitIntConversion -> ImplicitIntConversion
19520         ConvertImplicitRequired -> ImplicitConversionRequired
19521         ConvertNumericExplicit -> ExplicitNumericConversion
19522         ConvertReferenceExplicit -> ExplicitReferenceConversion
19523         ConvertExplicit -> ExplicitConversion
19524         ConvertExplicitStandard -> ExplicitStandardConversion
19525
19526 2003-05-19  Martin Baulig  <martin@ximian.com>
19527
19528         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19529         (TypeInfo): Added support for structs having structs as fields.
19530
19531         * ecore.cs (FieldExpr): Implement IVariable.
19532         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19533         VariableInfo for the field.
19534
19535 2003-05-18  Martin Baulig  <martin@ximian.com>
19536
19537         * expression.cs (This.DoResolve): Report a CS0027 if we're
19538         emitting a field initializer.
19539
19540 2003-05-18  Martin Baulig  <martin@ximian.com>
19541
19542         * expression.cs (This.ResolveBase): New public function.
19543         (This.DoResolve): Check for CS0188.
19544
19545         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19546         This.Resolve().
19547
19548         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19549         `instance_expression' to null if we don't have any non-static
19550         methods.
19551
19552 2003-05-18  Martin Baulig  <martin@ximian.com>
19553
19554         Reworked the way how local variables and parameters are handled by
19555         the flow analysis code.
19556
19557         * statement.cs (TypeInfo, VariableMap): New public classes.
19558         (VariableInfo): New public class.  This is now responsible for
19559         checking whether a variable has been assigned.  It is used for
19560         parameters and local variables.
19561         (Block.EmitMeta): Take the InternalParameters as argument; compute
19562         the layout of the flow vectors here.
19563         (Block.LocalMap, Block.ParameterMap): New public properties.
19564         (FlowBranching): The .ctor doesn't get the InternalParameters
19565         anymore since Block.EmitMeta() now computes the layout of the flow
19566         vector.
19567         (MyStructInfo): This class is now known as `StructInfo' and nested
19568         in `TypeInfo'; we don't access this directly anymore.
19569
19570         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19571         property and removed IsAssigned(), IsFieldAssigned(),
19572         SetAssigned() and SetFieldAssigned(); we now call them on the
19573         VariableInfo so we don't need to duplicate this code everywhere.
19574
19575         * expression.cs (ParameterReference): Added `Block block' argument
19576         to the .ctor.
19577         (LocalVariableReference, ParameterReference, This): The new
19578         VariableInfo class is now responsible for all the definite
19579         assignment stuff.
19580
19581         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19582         IsParameterAssigned, SetParameterAssigned): Removed.
19583
19584 2003-05-18  Martin Baulig  <martin@ximian.com>
19585
19586         * typemanager.cs (InitCoreTypes): Try calling
19587         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19588         the 3-args-version.  Corlib now also needs our `void_type'.
19589         (GetMethod): Added overloaded version which takes an optional
19590         `bool report_errors' to allow lookups of optional methods.
19591
19592 2003-05-12  Martin Baulig  <martin@ximian.com>
19593
19594         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19595         only used for locals and not for parameters.
19596
19597 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19598
19599         * support.cs (InternalParameters.ParameterType): Return the
19600         ExternalType of the parameter.
19601
19602         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19603         they were unused.
19604
19605 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19606
19607         * class.cs (MethodData.Define): Do not set the `newslot' on
19608         interface members, if they are also flagged as "override".
19609
19610         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19611         better code for ++i and i++.  This only works for static fields
19612         and local variables.
19613
19614         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19615         want to pull the DeclSpace out of the builder_to_declspace instead
19616         of the TypeBuilder (like in TypeContainer.FindMembers).
19617
19618         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19619         instead of LookupTypeContainer.  Fixes the crash on .NET for
19620         looking up interface members.
19621
19622         * const.cs: Create our own emit context during the Definition
19623         stage, so that constants are evaluated in the proper context, when
19624         a recursive definition happens.
19625
19626 2003-05-11  Martin Baulig  <martin@ximian.com>
19627
19628         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19629         new block for a switch section.
19630         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19631         the adding/lookup in the switch block.  Fixes #39828.
19632
19633 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19634
19635         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19636         functionality: I needed to convert the data after I had performed
19637         the add/sub operation into the operands type size.
19638
19639         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19640         pass the type for the box operation, otherwise the resulting
19641         object would have been of type object.
19642
19643         (BoxedCast): Add constructor to specify the type to box as.
19644
19645 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
19646
19647         * iterators.cs: I was reusing the `count' variable inadvertently,
19648         take steps to not allow this to happen.
19649
19650 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
19651
19652         * attribute.cs (Attribute.Resolve): Params attributes are encoded
19653         by creating an array at the point where the params starts and
19654         putting all those arguments there, then adjusting the size of the
19655         array.
19656
19657 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
19658
19659         * expression.cs (New.AddressOf): Implement interface
19660         IMemoryLocation.  This is used when the `new' operator is used in
19661         the context of an invocation to a method on a value type.
19662
19663         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19664         example. 
19665
19666         * namespace.cs: Also check the using aliases here.
19667
19668         * driver.cs: Move the test for using validity after the types have
19669         been entered, so we do a single pass that also includes the using
19670         aliases. 
19671
19672         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19673         in the regular case.   CreateSiblingForFinally is doing extra
19674         error checking.
19675
19676         * attribute.cs (GetAttributeArgumentExpression): Store the result
19677         on an out value, and use the return value to indicate failure
19678         instead of using null (which is a valid return for Constant.GetValue).
19679
19680         * statement.cs: Perform the analysis flow for the increment
19681         portion after the statement, because this will be the real flow of
19682         execution.  Fixes #42385
19683
19684         * codegen.cs (EmitContext.EmitArgument,
19685         EmitContext.EmitStoreArgument): New helper functions when the
19686         RemapToProxy flag is set.
19687
19688         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19689         function.
19690
19691         Add support for remapping parameters. 
19692
19693         * iterators.cs: Propagate parameter values;  Store parameter
19694         values in the proxy classes.
19695
19696 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
19697
19698         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
19699         need a proxy reference;  I do not know what I was thinking
19700
19701         * cs-parser.jay (constructor_initializer): catch another error,
19702         and display nice message.
19703
19704         (field_declaration): catch void field declaration
19705         to flag a better error. 
19706
19707         * class.cs (MemberBase.CheckBase): Report an error instead of a
19708         warning if a new protected member is declared in a struct. 
19709         (Field.Define): catch the error of readonly/volatile.
19710
19711         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19712
19713         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
19714         volatile variable is taken
19715
19716 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
19717
19718         * statement.cs (Fixed.Resolve): Report an error if we are not in
19719         an unsafe context.
19720
19721 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
19722
19723         * typemanager.cs: reuse the code that handles type clashes for
19724         delegates and enumerations.
19725
19726         * class.cs (Report28): Always report.
19727
19728         * expression.cs (EncodeAsAttribute): Allow nulls here.
19729
19730 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
19731
19732         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19733         the functionality for testing whether an expression is valid for
19734         an attribute here.  Also handle the case of arrays of elements
19735         being stored. 
19736
19737         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19738         encoding a linear array into an array of objects that are suitable
19739         to be passed to an CustomAttributeBuilder.
19740
19741         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19742
19743         * ecore.cs: (FieldExpr): Handle field remapping here.
19744
19745         * iteratators.cs: Pass the instance variable (if the method is an
19746         instance method) to the constructors, so we can access the field
19747         variables on the class.
19748
19749         TODO: Test this with structs.  I think the THIS variable on
19750         structs might have to be a pointer, and not a refenrece
19751
19752 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19755         local variables to fields in a proxy class.
19756
19757         * iterators.cs (PopulateProxy): Rename our internal fields to
19758         <XXX>.  
19759         Create a <THIS> field if we are an instance method, so we can
19760         reference our parent container variables.
19761         (MapVariable): Called back from the EmitContext code to enter a
19762         new variable to field mapping into the proxy class (we just create
19763         a FieldBuilder).
19764
19765         * expression.cs
19766         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19767         for using the remapped locals to fields.
19768
19769         I placed the code here, because that gives the same semantics to
19770         local variables, and only changes the Emit code.
19771
19772         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19773         statements inside iterators.
19774         (VariableInfo): Add a FieldBuilder for the cases when we are
19775         remapping local variables to fields in a proxy class
19776
19777         * ecore.cs (SimpleNameResolve): Avoid testing two times for
19778         current_block != null.
19779
19780         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19781         not cope with strings, as it has been moved to the
19782         TableSwitchEmit.  Fixed bug in switch generation.
19783
19784         * expression.cs (New.DoResolve): Provide more context for the user
19785         when reporting an error.
19786
19787         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19788         pointers. 
19789
19790         * expression.cs (MemberAccess.DoResolve): When we get a type back,
19791         check the permissions for it.  Note than in a type-resolution
19792         context the check was already present in DeclSpace.ResolveType,
19793         but was missing from the MemberAccess.
19794
19795         (ArrayCreation.CheckIndices): warn if the user has
19796         more nested levels of expressions, but there are no more
19797         dimensions specified.  Avoids crash on bug 41906.
19798
19799 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * statement.cs (Block): replace Implicit bool, for a generic
19802         flags.   
19803         New flag: `Unchecked'.  This is used during the EmitMeta phase
19804         (which is out-of-line with the regular Resolve/Emit process for a
19805         statement, as this is done ahead of time, but still gets a chance
19806         to call constant resolve).
19807
19808         (Block.Flags): new enum for adding a new flag.
19809
19810         (Block.EmitMeta): track the state of unchecked.
19811
19812         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19813         to enable constant resolution to work there as well.
19814
19815 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
19816
19817         * typemanager.cs (ienumerable_type): Also look up
19818         System.Collections.IEnumerable. 
19819
19820 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
19821
19822         TODO: Test more than one conditional per method.
19823
19824         * class.cs (Indexer.Define): Report the location where the user is
19825         referencing the unsupported feature.
19826
19827         (MethodData): Overload the use of `conditionals' to
19828         minimize the creation of needless ArrayLists.   This saves roughly
19829         212kb on my machine.
19830
19831         (Method): Implement the new IIteratorContainer interface.
19832         (Method.SetYields): Implement the method by setting the ModFlags
19833         to contain METHOD_YIELDS.
19834
19835         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19836         which just got set to null.
19837
19838         * iterators.cs: New file.
19839
19840         (Yield, YieldBreak): New statements.
19841
19842         * statement.cs (Return.Resolve): Flag an error if we are used in
19843         an iterator method.
19844
19845         * codegen.cs (InIterator): New flag set if the code is being
19846         compiled in an iterator method.
19847
19848         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
19849         internal modifier, and we just use it to avoid adding extra
19850         fields, as this is seldom used.  
19851
19852         * cs-parser.jay: Add yield_statement (yield and yield break).
19853
19854         * driver.cs: New flag -v2 to turn on version 2 features. 
19855
19856         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19857         hashtable when v2 is enabled.
19858
19859 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
19860
19861         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19862         there is already a namespace defined with this name.
19863
19864         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19865         people upgraded their corlibs.
19866
19867         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19868         always use fully qualified types, no need to use the compiler
19869         front end.
19870
19871         (TypeManager.IsNamespace): Use binarysearch.
19872
19873         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19874         AddDelegate): I did not quite use the new IsValid API properly: I
19875         have to pass the short-name and the fullname.  I was passing only
19876         the basename instead of the fullname sometimes. 
19877
19878         (TypeContainer.DefineType): call NamespaceClash.
19879
19880         * interface.cs (Interface.DefineType): use NamespaceClash before
19881         defining the type.
19882
19883         * delegate.cs (Delegate.DefineType): use NamespaceClash before
19884         defining the type.
19885
19886         * enum.cs: (Enum.DefineType): use NamespaceClash before
19887         defining the type.
19888
19889         * typemanager.cs (: 3-line patch that gives us some tasty 11%
19890         speed increase.  First, use the negative_hits cache when we get a
19891         negative.  Second, add the type with its full original name
19892         instead of the new . and + encoded name (reflection uses + to
19893         separate type from a nested type).  Use LookupTypeReflection
19894         directly which bypasses the type->name hashtable (that we already
19895         know does not contain the type.
19896
19897         * decl.cs (DeclSpace.ResolveTypeExpr): track the
19898         location/container type. 
19899
19900         * driver.cs: When passing utf8, use directly the UTF8Encoding.
19901
19902 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19905
19906         * delegate.cs (NewDelegate.Resolve): Test whether an instance
19907         method is being referenced in the method group from a static
19908         context, and report error 120 if so.
19909
19910         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19911         Error118. 
19912
19913         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19914         is created, we create the A namespace).
19915
19916         * cs-parser.jay: A namespace also introduces a DeclarationFound.
19917         Fixes #41591
19918
19919 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
19920
19921         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19922         invocation to ModuleBuilder.GetType with the same values will
19923         return a new type instance, so we need to cache its return
19924         values. 
19925
19926         * expression.cs (Binary.ResolveOperator): Only allow the compare
19927         operators on enums if they are of the same type.
19928
19929         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19930         types of ValueType on their own case.  Before we were giving them
19931         the same treatment as objects.
19932
19933         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19934         fullname.  Short name is used to compare against container name.
19935         Fullname is used to check against defined namespace names.
19936
19937         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19938         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19939
19940         (Method.CheckBase): Call parent.
19941         (MemberBase.CheckBase): Check for protected members on sealed
19942         classes.
19943         (PropertyBase.CheckBase): Call parent.
19944         (Field.Define): Call parent.
19945
19946         * report.cs: Negative error codes are now mapped to 8000 - code,
19947         so that the display is render more nicely.
19948
19949         * typemanager.cs: Do not use try/catch, instead report a regular
19950         error. 
19951
19952         (GetPointerType, GetReferenceType): These methods provide
19953         mechanisms to obtain the T* and T& from a T.  We had the code
19954         previously scattered around the code base, and it also used
19955         TypeManager.LookupType that would go through plenty of caches.
19956         This one goes directly to the type source.
19957
19958         In some places we did the Type.GetType followed by
19959         ModuleBuilder.GetType, but not in others, so this unifies the
19960         processing as well.
19961
19962         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19963         statements now that we have namespace information.
19964
19965         * typemanager.cs (IsNamespace): New method, returns whether the
19966         string presented is a namespace or not.
19967
19968         (ComputeNamespaces): New public entry point, computes the list of
19969         available namespaces, using the GetNamespaces API call in Mono, or
19970         the slower version in MS.NET.   
19971
19972         Now before we start the semantic analysis phase, we have a
19973         complete list of namespaces including everything that the user has
19974         provided.
19975
19976         Deleted old code to cache namespaces in .nsc files.
19977
19978 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
19979
19980         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19981         class/struct location definition Location for the implicit
19982         constructor location.
19983
19984         (Operator.Define): Use the location of the operator for the
19985         implicit Method definition.
19986
19987         (Constructor.Emit): use the constructor location for the implicit
19988         base initializer constructor.
19989
19990         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
19991         and the Expression class now contains two new methods:
19992
19993         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
19994         isolate type lookup from the rest of the resolution process.
19995
19996         Since we use Expressions to hold type definitions due to the way
19997         we parse the input we have historically overloaded Resolve to
19998         perform the Type lookups if a special flag is passed.  Now this is
19999         eliminated and two methods take their place. 
20000
20001         The differences in the two methods between xStep and xTerminal is
20002         that xStep is involved in our current lookup system that uses
20003         SimpleNames to compose a name, while xTerminal is used just to
20004         catch the case where the simplename lookup failed.
20005
20006 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20007
20008         * expression.cs (ResolveMemberAccess): Remove redundant code.
20009         TypeExpr expressions are always born fully resolved.
20010
20011         * interface.cs (PopulateMethod): Do not lookup the types twice.
20012         We were doing it once during SemanticAnalysis and once during
20013         PopulateMethod.
20014
20015         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20016         in local variable type definitions, were being returned as a
20017         SimpleName (we decomposed everything into a string), that is
20018         because primary_expression was being used instead of a type in the
20019         grammar (reduce/reduce conflicts).
20020
20021         The part that was wrong is that we converted the expression into a
20022         string (an oversimplification in one hand, compounded with primary
20023         expressions doing string concatenation).
20024
20025         So things like:
20026
20027         A.B.C [] x;
20028
20029         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20030         using clauses from working on this particular context.  And a type
20031         was being matched directly against "A.B.C[]".
20032
20033         We now use the correct approach, and allow for ComposedCast to be
20034         part of the unary expression.  So the "A.B.C []" become a composed
20035         cast of "A.B.C" (as a nested group of MemberAccess with a
20036         SimpleName at the end) plus the rank composition "[]". 
20037
20038         Also fixes 35567
20039
20040 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20041
20042         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20043         for the access level checking.
20044
20045         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20046         `TypeContainer container', because I kept getting confused when I
20047         was debugging this code.
20048
20049         * expression.cs (Indexers): Instead of tracking getters/setters,
20050         we now track them in parallel.  We create one arraylist less, but
20051         most importantly it is possible now for the LValue code to find a
20052         matching get for a set.
20053
20054         (IndexerAccess.DoResolveLValue): Update the code.
20055         GetIndexersForType has been modified already to extract all the
20056         indexers from a type.  The code assumed it did not.
20057
20058         Also make the code set the correct return type for the indexer.
20059         This was fixed a long time ago for properties, but was missing for
20060         indexers.  It used to be void_type.
20061
20062         (Binary.Emit): Test first for doubles instead of
20063         floats, as they are more common.
20064
20065         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20066         when dealing with floats and the <=, >= operators.  This fixes bug
20067         #39314 
20068
20069         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20070         to load the array value by emitting a load on the foreach variable
20071         type.  This was incorrect.  
20072
20073         We now emit the code to load an element using the the array
20074         variable type, and then we emit the conversion operator.
20075
20076         Fixed #40176
20077
20078 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20079
20080         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20081
20082 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20083
20084         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20085         test for protection before we test for signatures. 
20086
20087         (MethodSignature.ToString): implement.
20088
20089         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20090         to the case where we reduced into a LongConstant.
20091
20092         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20093         depend on whether the information is acurrate, because the
20094         Microsoft runtime will always claim that the array type is public,
20095         regardless of the real state.
20096
20097         If the type is a pointer, another problem happens: the type is
20098         reported as non-public in Microsoft.  
20099
20100         In both cases we have to call CheckAccessLevel recursively with
20101         the underlying type as the argument to be tested.
20102
20103 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * assign.cs (Assign.Emit): If we are dealing with a compound
20106         assignment expression, we should use the code path that stores the
20107         intermediate result in a temporary value.  This fixes #40903.
20108
20109         *expression.cs (Indirection.ToString): Provide ToString method for
20110         debugging. 
20111
20112 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
20113
20114         * class.cs: Null out fields holding references to Block objects so
20115         they can be garbage collected.
20116
20117         * expression.cs (OverloadResolve): Remove unused local.
20118
20119 2003-04-07  Martin Baulig  <martin@ximian.com>
20120
20121         * codegen.cs (EmitContext.CurrentFile): New public field.
20122         (EmitContext.Mark): Use the CurrentFile to check whether the
20123         location is in the correct file.
20124         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20125
20126 2003-04-07  Martin Baulig  <martin@ximian.com>
20127
20128         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20129
20130         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20131         location.  [FIXME: The location argument which gets passed to this
20132         method is sometimes wrong!]
20133
20134 2003-04-07  Nick Drochak <ndrochak@gol.com>
20135
20136         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20137
20138 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
20139
20140         * expression.cs (Indirection.EmitAssign): We were using the
20141         temporary, but returning immediately instead of continuing the
20142         EmitAssing flow.
20143
20144 2003-04-06  Martin Baulig  <martin@ximian.com>
20145
20146         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20147         if it's a nested child, but also deriving from the outer class.
20148         See test 190.cs.
20149
20150         * typemanager.cs (IsNestedChildOf): Make this work if it's a
20151         nested child, but also deriving from the outer class.  See
20152         test-190.cs.
20153         (FilterWithClosure): We may access private members of the outer
20154         class if we're a nested child and deriving from the outer class.
20155         (RealMemberLookup): Only set `closure_private_ok' if the
20156         `original_bf' contained BindingFlags.NonPublic.
20157
20158 2003-04-05  Martin Baulig  <martin@ximian.com>
20159
20160         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20161
20162 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * class.cs (Event.Define): Do not allow abstract events to have
20165         initializers. 
20166
20167 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
20168
20169         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20170         block in event declarations.
20171
20172         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20173         value type, get its address.
20174
20175         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20176         leaving a class on the stack instead of a boolean value (int
20177         0/1).  Change the code so we compare against null, and then the
20178         result against zero.
20179
20180         * class.cs (TypeContainer.GetClassBases): We were checking for the
20181         parent class being sealed too late.
20182
20183         * expression.cs (Binary.Emit): For <= and >= when dealing with
20184         floating point values, use cgt.un and clt.un instead of cgt and
20185         clt alone.
20186
20187 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
20188
20189         * statement.cs: Apply the same optimization as MS: skip the 
20190         GetEnumerator returning an IEnumerator, and use the one returning a 
20191         CharEnumerator instead. This allows us to avoid the try-finally block 
20192         and the boxing.
20193
20194 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
20195
20196         * cs-parser.jay: Attributes cannot be applied to
20197                          namespaces. Fixes #40473
20198
20199 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20200
20201         * class.cs:
20202         (Add*): check if the name is valid using the full name for constants,
20203         fields, properties and events.
20204
20205 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
20206
20207         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20208         char constants to be part of the enumeration.
20209
20210         * expression.cs (Conditional.DoResolve): Add support for operator
20211         true. Implements the missing functionality from 14.12
20212
20213         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20214         operator true/false as required by the spec.
20215
20216         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20217         implicit conversion to boolean.
20218
20219         * statement.cs (Statement.ResolveBoolean): A boolean expression is
20220         also one where the type implements `operator true'. 
20221
20222         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20223         get an expression that will invoke operator true based on an
20224         expression.  
20225
20226         (GetConversionOperators): Removed the hack that called op_True
20227         here.  
20228
20229         (Expression.ResolveBoolean): Move this from Statement.
20230
20231 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20232
20233         * ecore.cs (FieldExpr): do not allow initialization of initonly
20234         fields on derived classes
20235
20236 2003-03-13  Martin Baulig  <martin@ximian.com>
20237
20238         * statement.cs (Block.Emit): Call ig.BeginScope() and
20239         ig.EndScope() when compiling with debugging info; call
20240         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20241
20242 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * expression.cs (Indexers): Do not construct immediately, allow
20245         for new members to be appended as we go.  Fixes 38143
20246
20247 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20248
20249         * expression.cs: save/restore context when resolving an unchecked
20250         expression.
20251
20252 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20253
20254         * cfold.cs: Catch division by zero in modulus operator during
20255         constant folding.
20256
20257 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * interface.cs (Interface.DefineMembers): Avoid defining members
20260         twice. 
20261
20262 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * driver.cs: handle the +/- options for -noconfig
20265
20266         * statement.cs (Unckeched.Resolve): Also track the state of
20267         unchecked in the Resolve phase.
20268
20269 2003-02-27  Martin Baulig  <martin@ximian.com>
20270
20271         * ecore.cs (Expression.MemberLookup): Don't create a
20272         MethodGroupExpr for something which is not a method.  Fixes #38291.
20273
20274 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * class.cs (MemberBase.CheckParameters): Also check that the type
20277         is unmanaged if it is a pointer.
20278
20279         * expression.cs (SizeOf.Resolve): Add location information.
20280
20281         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20282         a managed type is declared.
20283
20284         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20285         parameter modifiers as well.  Fixes bug 38606
20286
20287         * class.cs: Very sad.  Am backing out the speed up changes
20288         introduced by the ArrayList -> Array in the TypeContainer, as they
20289         were not actually that much faster, and introduced a bug (no error
20290         reports on duplicated methods).
20291
20292         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20293         source first, this will guarantee that we have a valid expression
20294         before calling in lower levels functions that will require a
20295         resolved object.  Then use this original_source in the
20296         target.ResolveLValue instead of the original source that was
20297         passed to us.
20298
20299         Another change.  Use target.Resolve instead of LValueResolve.
20300         Although we are resolving for LValues, we will let the Assign code
20301         take care of that (it will be called again from Resolve).  This
20302         basically allows code like this:
20303
20304         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20305         class Y { void A (X x) { x [0] += o; }
20306
20307         The problem was that the indexer was trying to resolve for
20308         set_Item (idx, object o) and never finding one.  The real set_Item
20309         was set_Item (idx, X).  By delaying the process we get the right
20310         semantics. 
20311
20312         Fixes bug 36505
20313
20314 2003-02-23  Martin Baulig  <martin@ximian.com>
20315
20316         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20317         while calling DoEmit ().
20318
20319         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20320         source files; if you use the #line directive inside a method, the
20321         compiler stops emitting line numbers for the debugger until it
20322         reaches the end of the method or another #line directive which
20323         restores the original file.
20324
20325 2003-02-23  Martin Baulig  <martin@ximian.com>
20326
20327         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20328
20329 2003-02-23  Martin Baulig  <martin@ximian.com>
20330
20331         * statement.cs (Block.AddChildVariableNames): We need to call this
20332         recursively, not just for our immediate children.
20333
20334 2003-02-23  Martin Baulig  <martin@ximian.com>
20335
20336         * class.cs (Event.Define): Always make the field private, like csc does.
20337
20338         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20339         actually work, fixes bug #37521.
20340
20341 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20342
20343         * delegate.cs: When creating the various temporary "Parameters"
20344         classes, make sure that we call the ComputeAndDefineParameterTypes
20345         on those new parameters (just like we do with the formal ones), to
20346         allow them to be resolved in the context of the DeclSpace.
20347
20348         This fixes the bug that Dick observed in Bugzilla #38530.
20349
20350 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20351
20352         * expression.cs (ResolveMemberAccess): When resolving a constant,
20353         do not attempt to pull a constant if the value was not able to
20354         generate a valid constant.
20355
20356         * const.cs (LookupConstantValue): Do not report more errors than required.
20357
20358 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20359
20360         * expression.cs: fixes bug #38328.
20361
20362 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20363
20364         * class.cs: Changed all the various members that can be part of a
20365         class from being an ArrayList to be an Array of the right type.
20366         During the DefineType type_list, interface_list, delegate_list and
20367         enum_list are turned into types, interfaces, delegates and enums
20368         arrays.  
20369
20370         And during the member population, indexer_list, event_list,
20371         constant_list, field_list, instance_constructor_list, method_list,
20372         operator_list and property_list are turned into their real arrays.
20373
20374         Although we could probably perform this operation earlier, for
20375         good error reporting we need to keep the lists and remove the
20376         lists for longer than required.
20377
20378         This optimization was triggered by Paolo profiling the compiler
20379         speed on the output of `gen-sample-program.pl' perl script. 
20380
20381         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20382         not crash in methods like MemberLookupFailed that use this field.  
20383
20384         This problem arises when the compiler fails to resolve a type
20385         during interface type definition for example.
20386
20387 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20388
20389         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20390         inherit from System.Object, so we have to stop at null, not only
20391         when reaching System.Object.
20392
20393 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20394
20395         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20396         DeclaredOnly because the parent indexer might have had a different
20397         name, but did not loop until the top of the hierarchy was reached.
20398
20399         The problem this one fixes is 35492: when a class implemented an
20400         indexer from an interface, we were getting the interface method
20401         (which was abstract) and we were flagging an error (can not invoke
20402         abstract method).
20403
20404         This also keeps bug 33089 functioning, and test-148 functioning.
20405
20406         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20407         out if a method is special is to see if it is declared in a
20408         property or event, or whether it is one of the predefined operator
20409         names.   This should fix correctly #36804.
20410
20411 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20412
20413         The goal here is to remove the dependency on EmptyCast.Peel ().
20414         Killing it completely.
20415
20416         The problem is that currently in a number of places where
20417         constants are expected, we have to "probe" for an EmptyCast, and
20418         Peel, which is not the correct thing to do, as this will be
20419         repetitive and will likely lead to errors. 
20420
20421         The idea is to remove any EmptyCasts that are used in casts that
20422         can be reduced to constants, so we only have to cope with
20423         constants. 
20424
20425         This bug hunt was triggered by Bug 37363 and the desire to remove
20426         the duplicate pattern where we were "peeling" emptycasts to check
20427         whether they were constants.  Now constants will always be
20428         constants.
20429
20430         * ecore.cs: Use an enumconstant here instead of wrapping with
20431         EmptyCast.  
20432
20433         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20434         throwing me off.  By handling this we can get rid of a few hacks.
20435
20436         * statement.cs (Switch): Removed Peel() code.
20437
20438 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * class.cs: Location information for error 508
20441
20442         * expression.cs (New.DoResolve): Add a guard against double
20443         resolution of an expression.  
20444
20445         The New DoResolve might be called twice when initializing field
20446         expressions (see EmitFieldInitializers, the call to
20447         GetInitializerExpression will perform a resolve on the expression,
20448         and later the assign will trigger another resolution
20449
20450         This leads to bugs (#37014)
20451
20452         * delegate.cs: The signature for EndInvoke should contain any ref
20453         or out parameters as well.  We were not doing this in the past. 
20454
20455         * class.cs (Field.Define): Do not overwrite the type definition
20456         inside the `volatile' group.  Turns out that volatile enumerations
20457         were changing the type here to perform a validity test, which
20458         broke conversions. 
20459
20460 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20461
20462         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20463         and structs, we do not want to load the instance variable
20464
20465         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20466         enum_type has to be handled like an object reference (implicit
20467         conversions exists from this to object), but the regular IsClass
20468         and IsValueType tests will never return true for this one.
20469
20470         Also we use TypeManager.IsValueType instead of type.IsValueType,
20471         just for consistency with the rest of the code (this is only
20472         needed if we ever use the construct exposed by test-180.cs inside
20473         corlib, which we dont today).
20474
20475 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20476
20477         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20478         just InternalCall.
20479
20480 2003-02-09  Martin Baulig  <martin@ximian.com>
20481
20482         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20483         (Namespace.DefineNamespaces): New static public method; this is
20484         called when we're compiling with debugging to add all namespaces
20485         to the symbol file.
20486
20487         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20488         pass it to the Namespace's .ctor.
20489
20490         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20491         and MethodBase arguments; pass the namespace ID to the symwriter;
20492         pass the MethodBase instead of the token to the symwriter.
20493         (SymbolWriter.DefineNamespace): New method to add a namespace to
20494         the symbol file.
20495
20496 2003-02-09  Martin Baulig  <martin@ximian.com>
20497
20498         * symbolwriter.cs: New file.  This is a wrapper around
20499         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20500         methods here in near future.
20501
20502 2003-02-09  Martin Baulig  <martin@ximian.com>
20503
20504         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20505         ILGenerator.MarkSequencePoint() which are actually used by the
20506         symbol writer.
20507
20508 2003-02-09  Martin Baulig  <martin@ximian.com>
20509
20510         * location.cs (SourceFile): New public sealed class.  This
20511         contains the name and an index which is used in the location's token.
20512         (Location): Reserve an appropriate number of bits in the token for
20513         the source file instead of walking over that list, this gives us a
20514         really huge performance improvement when compiling with debugging.
20515
20516         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20517         `SourceFile' argument instead of a string.
20518         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20519         but don't parse/tokenize here, we need to generate the list of all
20520         source files before we do that.
20521         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20522         the files.
20523
20524         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20525         instead of a string.
20526
20527         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20528         of a string.
20529
20530 2003-02-09  Martin Baulig  <martin@ximian.com>
20531
20532         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20533         filename on `#line default'.
20534
20535 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20536
20537         * statement.cs: don't clear the pinned var when the fixed statement
20538         returns from the method (fixes bug#37752).
20539
20540 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20541
20542         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20543         to IsValueType.
20544
20545 2003-02-07  Martin Baulig  <martin@ximian.com>
20546
20547         * driver.cs: Removed the `--debug-args' command line argument.
20548
20549         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20550         automatically by the AsssemblyBuilder.
20551         (CodeGen.InitializeSymbolWriter): We don't need to call any
20552         initialization function on the symbol writer anymore.  This method
20553         doesn't take any arguments.
20554
20555 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20556
20557         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20558         from referenced assemblies as well.
20559
20560 2003-02-02  Martin Baulig  <martin@ximian.com>
20561
20562         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20563
20564 2003-02-02  Martin Baulig  <martin@ximian.com>
20565
20566         * class.cs (Constructor.Emit): Open the symbol writer before
20567         emitting the constructor initializer.
20568         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20569         single-stepping through constructor initializers.
20570
20571 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20572
20573         * class.cs: Handle error 549: do not allow virtual methods in
20574         sealed classes. 
20575
20576 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20577
20578         * decl.cs: Check access levels when resolving types
20579
20580 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20581
20582         * statement.cs: Add parameters and locals set in catch blocks that might 
20583         return to set vector
20584
20585 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20586
20587         * class.cs (Operator): Set the SpecialName flags for operators.
20588
20589         * expression.cs (Invocation.DoResolve): Only block calls to
20590         accessors and operators on SpecialName methods.
20591
20592         (Cast.TryReduce): Handle conversions from char constants.
20593
20594
20595 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20596
20597         * statement.cs: small memory and time optimization in FlowBranching.
20598
20599 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20600
20601         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20602         problem that the last fix but in the other sid (Set).
20603
20604         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20605         access when there is no indexer in the hierarchy.
20606
20607 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20608
20609         * class.cs: Combine some if statements.
20610
20611 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20612
20613         * driver.cs: fixed bug #37187.
20614
20615 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20616
20617         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20618         any indexer, it's needed to build a list with all the indexers in the
20619         hierarchy (AllGetters), else we have problems. Fixes #35653.
20620
20621 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20622
20623         * class.cs (MethodData.Define): It is wrong for an interface
20624         implementation to be static in both cases: explicit and implicit.
20625         We were only handling this in one case.
20626
20627         Improve the if situation there to not have negations.
20628
20629         * class.cs (Field.Define): Turns out that we do not need to check
20630         the unsafe bit on field definition, only on usage.  Remove the test.
20631
20632 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20633
20634         * driver.cs: use assembly.Location instead of Codebase (the latest
20635         patch made mcs fail when using MS assemblies).
20636
20637 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20638
20639         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20640         get the path to *corlib.dll.
20641
20642 2003-01-21  Nick Drochak <ndrochak@gol.com>
20643
20644         * cs-tokenizer.cs:
20645         * pending.cs:
20646         * typemanager.cs: Remove compiler warnings
20647
20648 2003-01-20  Duncan Mak  <duncan@ximian.com>
20649
20650         * AssemblyInfo.cs: Bump the version number to 0.19.
20651
20652 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20653
20654         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20655
20656 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
20657
20658         * class.cs (Constructor::Emit): Emit debugging info for constructors.
20659
20660 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
20661
20662         * cs-parser.jay: Small fix: we were not comparing the constructor
20663         name correctly.   Thanks to Zoltan for the initial pointer.
20664
20665 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20666
20667         * cs-tokenizer.cs: Set file name when specified with #line
20668
20669 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
20670
20671         * cs-parser.jay: Only perform the constructor checks here if we
20672         are named like the class;  This will help provider a better
20673         error.  The constructor path is taken when a type definition is
20674         not found, but most likely the user forgot to add the type, so
20675         report that rather than the constructor error.
20676
20677 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20678
20679         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20680         allocations.
20681
20682 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20683
20684         * cs-parser.jay: Add cleanup call.
20685
20686 2003-01-13  Duncan Mak  <duncan@ximian.com>
20687
20688         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20689         consistent with other methods.
20690
20691 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20692
20693         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20694
20695 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20696
20697         * attribute.cs: only set GuidAttr to true when we have a
20698         GuidAttribute.
20699
20700 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20701
20702         * ecore.cs:
20703         * expression.cs:
20704         * typemanager.cs: fixes to allow mcs compile corlib with the new
20705         Type.IsSubclassOf fix.
20706
20707 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * expression.cs (LocalVariableReference.DoResolve): Classify a
20710         constant as a value, not as a variable.   Also, set the type for
20711         the variable.
20712
20713         * cs-parser.jay (fixed_statement): take a type instead of a
20714         pointer_type, so we can produce a better error message later.
20715
20716         * statement.cs (Fixed.Resolve): Flag types that are not pointers
20717         as an error.  
20718
20719         (For.DoEmit): Make inifinite loops have a
20720         non-conditional branch back.
20721
20722         (Fixed.DoEmit): First populate the pinned variables, then emit the
20723         statement, then clear the variables.  Before I was emitting the
20724         code once for each fixed piece.
20725
20726
20727 2003-01-08  Martin Baulig  <martin@ximian.com>
20728
20729         * statement.cs (FlowBranching.MergeChild): A break in a
20730         SWITCH_SECTION does not leave a loop.  Fixes #36155.
20731
20732 2003-01-08  Martin Baulig  <martin@ximian.com>
20733
20734         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20735         lives in the same number space than `param_map'.  Fixes #36154.
20736
20737 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
20738
20739         * cs-parser.jay (constructor_declaration): Set the
20740         Constructor.ModFlags before probing for it.  This makes the
20741         compiler report 514, 515 and 132 (the code was there, but got
20742         broken). 
20743
20744         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20745         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20746         (GotoCase.Resolve): Set `Returns' to ALWAYS.
20747
20748 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20749
20750         * enum.cs: create the enum static fields using the enum type.
20751
20752 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20753
20754         * class.cs: don't try to create the ParamBuilder for the return
20755         type if it's not needed (and handle it breaking for the ms runtime
20756         anyway).
20757
20758 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20759
20760         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20761
20762 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
20763
20764         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20765         the command.   This showed up while compiling the JANET source
20766         code, which used \r as its only newline separator.
20767
20768 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * class.cs (Method.Define): If we are an operator (because it
20771         reuses our code), then set the SpecialName and HideBySig.  #36128
20772
20773 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
20774
20775         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20776         exception, report error 120 `object reference required'.
20777
20778         * driver.cs: Add --pause option, used during to measure the size
20779         of the process as it goes with --timestamp.
20780
20781         * expression.cs (Invocation.DoResolve): Do not allow methods with
20782         SpecialName to be invoked.
20783
20784 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
20785
20786         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20787         number before adding it.
20788
20789 2002-12-21  Ravi Pratap  <ravi@ximian.com>
20790
20791         * ecore.cs (StandardImplicitConversion): When in an unsafe
20792         context, we allow conversion between void * to any other pointer
20793         type. This fixes bug #35973.
20794
20795 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20796
20797         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20798         is not thrown when extensionless outputs are used 
20799
20800 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20801
20802         * rootcontext.cs: fixed compilation of corlib.
20803
20804 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
20805
20806         * attribute.cs (Attributes.Contains): Add new method.
20807
20808         * class.cs (MethodCore.LabelParameters): if the parameter is an
20809         `out' parameter, check that no attribute `[In]' has been passed.
20810
20811         * enum.cs: Handle the `value__' name in an enumeration.
20812
20813 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
20814
20815         * decl.cs: Added special case to allow overrides on "protected
20816         internal" methods
20817
20818 2002-12-18  Ravi Pratap  <ravi@ximian.com>
20819
20820         * attribute.cs (Attributes.AddAttributeSection): Rename to this
20821         since it makes much more sense.
20822
20823         (Attributes.ctor): Don't require a Location parameter.
20824
20825         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20826
20827         * attribute.cs (ApplyAttributes): Remove extra Location parameters
20828         since we already have that information per attribute.
20829
20830         * everywhere : make appropriate changes.
20831
20832         * class.cs (LabelParameters): Write the code which actually
20833         applies attributes to the return type. We can't do this on the MS
20834         .NET runtime so we flag a warning in the case an exception is
20835         thrown.
20836
20837 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
20838
20839         * const.cs: Handle implicit null conversions here too.
20840
20841 2002-12-17  Ravi Pratap  <ravi@ximian.com>
20842
20843         * class.cs (MethodCore.LabelParameters): Remove the extra
20844         Type [] parameter since it is completely unnecessary. Instead
20845         pass in the method's attributes so that we can extract
20846         the "return" attribute.
20847
20848 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
20849
20850         * cs-parser.jay (parse): Use Report.Error to flag errors instead
20851         of ignoring it and letting the compile continue.
20852
20853         * typemanager.cs (ChangeType): use an extra argument to return an
20854         error condition instead of throwing an exception.
20855
20856 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
20857
20858         * expression.cs (Unary.TryReduce): mimic the code for the regular
20859         code path.  Perform an implicit cast in the cases where we can
20860         implicitly convert to one of the integral types, and then reduce
20861         based on that constant.   This fixes bug #35483.
20862
20863 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20864
20865         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20866
20867 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20868
20869         * namespace.cs: fixed bug #35489.
20870
20871 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
20872
20873         * class.cs: Remove some dead code.
20874
20875         * cs-parser.jay: Estimate the number of methods needed
20876         (RootContext.MethodCount);
20877
20878         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20879         numbers instead of StringBuilders.
20880
20881         * support.cs (PtrHashtable): Add constructor with initial size;
20882         We can now reduce reallocations of the method table.
20883
20884 2002-12-10  Ravi Pratap  <ravi@ximian.com>
20885
20886         * attribute.cs (ApplyAttributes): Keep track of the emitted
20887         attributes on a per-target basis. This fixes bug #35413.
20888
20889 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
20890
20891         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20892         default to the Windows 1252 encoding.
20893
20894         (UnixParseOption): Support version, thanks to Alp for the missing
20895         pointer. 
20896
20897         * AssemblyInfo.cs: Add nice assembly information.
20898
20899         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20900         (bug 35169).
20901
20902         * cs-parser.jay: Allow a trailing comma before the close bracked
20903         in the attribute_section production.
20904
20905         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20906         address of the instance was being taken, I will take this out,
20907         because we take the address of the object immediately here.
20908
20909 2002-12-09  Ravi Pratap  <ravi@ximian.com>
20910
20911         * typemanager.cs (AreMultipleAllowed): Take care of the most
20912         obvious case where attribute type is not in the current assembly -
20913         stupid me ;-)
20914
20915 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20918         definitions, instead of doing that afterwards.  
20919
20920         Also we use a nice little hack, depending on the constructor, we
20921         know if we are a "composed" name or a simple name.  Hence, we
20922         avoid the IndexOf test, and we avoid 
20923
20924         * codegen.cs: Add code to assist in a bug reporter to track down
20925         the source of a compiler crash. 
20926
20927 2002-12-07  Ravi Pratap  <ravi@ximian.com>
20928
20929         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20930         types have been emitted for a given element and flag an error
20931         if something which does not have AllowMultiple set is used more
20932         than once.
20933
20934         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20935         attribute types and their corresponding AllowMultiple properties
20936
20937         (AreMultipleAllowed): Check the property for a given type.
20938
20939         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20940         property in the case we have a TypeContainer.
20941
20942         (Attributes.AddAttribute): Detect duplicates and just skip on
20943         adding them. This trivial fix catches a pretty gross error in our
20944         attribute emission - global attributes were being emitted twice!
20945
20946         Bugzilla bug #33187 is now fixed.
20947
20948 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
20949
20950         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20951         instead of pp_and).
20952
20953         * expression.cs (Binary.ResolveOperator): I can only use the
20954         Concat (string, string, string) and Concat (string, string,
20955         string, string) if the child is actually a concatenation of
20956         strings. 
20957
20958 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
20959
20960         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20961         context where we need a 2-character lookahead.
20962
20963         * pending.cs (PendingImplementation): Rework so we can keep track
20964         of interface types all the time, and flag those which were
20965         implemented by parents as optional.
20966
20967 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
20968
20969         * expression.cs (Binary.ResolveOperator): Use
20970         String.Concat(string,string,string) or
20971         String.Concat(string,string,string,string) when possible. 
20972
20973         * typemanager: More helper methods.
20974
20975
20976 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20977
20978         * pending.cs: remove the bogus return from GetMissingInterfaces()
20979         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20980
20981 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20982
20983         * namespace.cs: avoid duplicated 'using xxx' being added to
20984         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20985         when we get more than one 'using' statement for the same namespace.
20986         Report a CS0105 warning for it.
20987
20988 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
20989
20990         * cs-tokenizer.cs (consume_identifier): use read directly, instead
20991         of calling getChar/putback, uses internal knowledge of it.    
20992
20993         (xtoken): Reorder tokenizer so most common patterns are checked
20994         first.  This reduces the compilation time in another 5% (from 8.11s
20995         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20996
20997         The parsing time is 22% of the compilation in mcs, and from that
20998         64% is spent on the tokenization process.  
20999
21000         I tried using a binary search for keywords, but this is slower
21001         than the hashtable.  Another option would be to do a couple of
21002         things:
21003
21004                 * Not use a StringBuilder, instead use an array of chars,
21005                   with a set value.  Notice that this way we could catch
21006                   the 645 error without having to do it *afterwards*.
21007
21008                 * We could write a hand-parser to avoid the hashtable
21009                   compares altogether.
21010
21011         The identifier consumption process takes 37% of the tokenization
21012         time.  Another 15% is spent on is_number.  56% of the time spent
21013         on is_number is spent on Int64.Parse:
21014
21015                 * We could probably choose based on the string length to
21016                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21017                   computations. 
21018
21019         Another 3% is spend on wrapping `xtoken' in the `token' function.
21020
21021         Handle 0xa0 as whitespace (#34752)
21022
21023 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * typemanager.cs (IsCLRType): New routine to tell whether a type
21026         is one of the builtin types.  
21027
21028         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21029         typecode in more places instead of doing pointer comparissions.
21030         We could leverage some knowledge about the way the typecodes are
21031         laid out.
21032
21033         New code to cache namespaces in assemblies, it is currently not
21034         invoked, to be used soon.
21035
21036         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21037
21038         * expression.cs (Binary.ResolveOperator): specially handle
21039         strings, and do not perform user-defined operator overloading for
21040         built-in types.
21041
21042 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21045         internalcall as it is a pretty simple operation;  Avoid whenever
21046         possible to call Char.IsLetter.
21047
21048         (consume_identifier): Cut by half the number of
21049         hashtable calls by merging the is_keyword and GetKeyword behavior.
21050
21051         Do not short-circuit, because if we do, we
21052         report errors (ie, #if false && true would produce an invalid
21053         directive error);
21054
21055
21056 2002-11-24  Martin Baulig  <martin@ximian.com>
21057
21058         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21059         check constant ranges and report a CS0221.  Fixes #33186.
21060
21061 2002-11-24  Martin Baulig  <martin@ximian.com>
21062
21063         * cs-parser.jay: Make this work for uninitialized variable
21064         declarations in the `for' initializer.  Fixes #32416.
21065
21066 2002-11-24  Martin Baulig  <martin@ximian.com>
21067
21068         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21069         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21070
21071 2002-11-24  Martin Baulig  <martin@ximian.com>
21072
21073         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21074         argument; if true, we also check for user-defined conversions.
21075         This is only needed if both arguments are of a user-defined type.
21076         Fixes #30443, added test-175.cs.
21077         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21078
21079         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21080
21081 2002-11-24  Martin Baulig  <martin@ximian.com>
21082
21083         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21084         function to get the store opcode.
21085         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21086         only emit the Ldelema if the store opcode is Stobj.  You must run
21087         both test-34 and test-167 to test this.  Fixes #34529.
21088
21089 2002-11-23  Martin Baulig  <martin@ximian.com>
21090
21091         * ecore.cs (Expression.MemberLookup): Added additional
21092         `qualifier_type' argument which is used when we're being called
21093         from MemberAccess.DoResolve() and null if we're called from a
21094         SimpleName lookup.
21095         (Expression.MemberLookupFailed): New method to report errors; this
21096         does the CS1540 check and reports the correct error message.
21097
21098         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21099         argument for the CS1540 check and redone the way how we're dealing
21100         with private members.  See the comment in the source code for details.
21101         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21102         `closure_start_type' to `closure_qualifier_type' and check whether
21103         it's not null.  It was not this filter being broken, it was just
21104         being called with the wrong arguments.
21105
21106         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21107         and pass it the correct `qualifier_type'; this also does the error
21108         handling for us.
21109
21110 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21111
21112         * expression.cs (Invocation.EmitParams): If the we are dealing
21113         with a non-built-in value type, load its address as well.
21114
21115         (ArrayCreation): Use a a pretty constant instead
21116         of the hardcoded value 2.   Use 6 instead of 2 for the number of
21117         static initializers.  
21118
21119         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21120         because they are not really value types, just glorified integers. 
21121
21122         * driver.cs: Do not append .exe, the CSC compiler does not do it.
21123
21124         * ecore.cs: Remove redundant code for enumerations, make them use
21125         the same code path as everything else, fixes the casting issue
21126         with enumerations in Windows.Forms.
21127
21128         * attribute.cs: Do only cast to string if it is a string, the
21129         validation happens later.
21130
21131         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21132         people upgrade their corlibs.
21133
21134         * ecore.cs: Oops, enumerations were not following the entire code path
21135
21136 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
21137
21138         * typemanager.cs (FilterWithClosure): Commented out the test for
21139         1540 in typemanager.cs, as it has problems when accessing
21140         protected methods from a parent class (see test-174.cs). 
21141
21142         * attribute.cs (Attribute.ValidateGuid): new method.
21143         (Attribute.Resolve): Use above.
21144
21145 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
21146
21147         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21148
21149         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21150         handling for enumerations, as we only needed the TypeContainer
21151         functionality to begin with (this is required for the fix below to
21152         work for enums that reference constants in a container class for
21153         example). 
21154
21155         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21156
21157         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21158         a valid TypeBuilder to perform lookups on.o
21159
21160         * class.cs (InheritableMemberSignatureCompare): Use true in the
21161         call to GetGetMethod and GetSetMethod, because we are comparing
21162         the signature, and we need to get the methods *even* if they are
21163         private. 
21164
21165         (PropertyBase.CheckBase): ditto.
21166
21167         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21168         GotoCase.Resolve): Use Peel on EmpytCasts.
21169
21170         * ecore.cs (EmptyCast): drop child, add Peel method.
21171
21172 2002-11-17  Martin Baulig  <martin@ximian.com>
21173
21174         * ecore.cs (EmptyCast.Child): New public property.
21175
21176         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21177         label resolved to an EmptyCast.  Fixes #34162.
21178         (GotoCase.Resolve): Likewise.
21179         (Block.EmitMeta): Likewise.
21180
21181 2002-11-17  Martin Baulig  <martin@ximian.com>
21182
21183         * expression.cs (Invocation.BetterConversion): Prefer int over
21184         uint; short over ushort; long over ulong for integer literals.
21185         Use ImplicitConversionExists instead of StandardConversionExists
21186         since we also need to check for user-defined implicit conversions.
21187         Fixes #34165.  Added test-173.cs.
21188
21189 2002-11-16  Martin Baulig  <martin@ximian.com>
21190
21191         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21192         with the `true' and `false' literals.  Fixes #33151.
21193
21194 2002-11-16  Martin Baulig  <martin@ximian.com>
21195
21196         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21197         October 22nd; don't do the cs1540 check for static members.
21198
21199         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21200         now using our own filter here and doing the cs1540 check again.
21201
21202 2002-11-16  Martin Baulig  <martin@ximian.com>
21203
21204         * support.cs (InternalParameters): Don't crash if we don't have
21205         any fixed parameters.  Fixes #33532.
21206
21207 2002-11-16  Martin Baulig  <martin@ximian.com>
21208
21209         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21210         when looking up static methods to make this work on Windows.
21211         Fixes #33773.
21212
21213 2002-11-16  Martin Baulig  <martin@ximian.com>
21214
21215         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21216         a setter rather than using PropertyInfo.CanWrite.
21217
21218 2002-11-15  Nick Drochak  <ndrochak@gol.com>
21219
21220         * class.cs: Allow acces to block member by subclasses. Fixes build
21221         breaker.
21222
21223 2002-11-14  Martin Baulig  <martin@ximian.com>
21224
21225         * class.cs (Constructor.Emit): Added the extern/block check.
21226         Fixes bug #33678.
21227
21228 2002-11-14  Martin Baulig  <martin@ximian.com>
21229
21230         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21231         iteration while looking for indexers, this is needed because the
21232         indexer may have a different name in our base classes.  Fixed the
21233         error reporting (no indexers at all, not get accessor, no
21234         overloaded match).  Fixes bug #33089.
21235         (IndexerAccess.DoResolveLValue): Likewise.
21236
21237 2002-11-14  Martin Baulig  <martin@ximian.com>
21238
21239         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21240         indexers.  Fixes the first part of bug #33089.
21241         (MethodSignature.InheritableMemberSignatureCompare): Added support
21242         for properties.
21243
21244 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21245
21246         * attribute.cs (Attribute.Resolve): Catch the
21247         NullReferenceException and report it since it isn't supposed to
21248         happen. 
21249
21250 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21253         LogicalOr and LogicalAnd that can benefit from recursively
21254         handling EmitBranchable.  The code now should be nice for Paolo.
21255
21256 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21257
21258         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21259         the Type lookups, as we perform quite a number of lookups on
21260         non-Types.  This can be removed once we can deterministically tell
21261         whether we have a type or a namespace in advance.
21262
21263         But this might require special hacks from our corlib.
21264
21265         * TODO: updated.
21266
21267         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21268         and double which avoids a conversion from an integer to a double.
21269
21270         * expression.cs: tiny optimization, avoid calling IsConstant,
21271         because it effectively performs the lookup twice.
21272
21273 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21274
21275         But a bogus return here to keep the semantics of the old code
21276         until the Mono runtime is fixed.
21277
21278         * pending.cs (GetMissingInterfaces): New method used to remove all
21279         the interfaces that are already implemented by our parent
21280         classes from the list of pending methods. 
21281
21282         * interface.cs: Add checks for calls after ResolveTypeExpr.
21283
21284 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21285
21286         * class.cs (Class.Emit): Report warning 67: event not used if the
21287         warning level is beyond 3.
21288
21289         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21290         being a NullLiteral.
21291
21292         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21293         specifiers. 
21294
21295         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21296         path that might fail if a type can not be resolved.
21297
21298         * expression.cs (Binary.Emit): Emit unsigned versions of the
21299         operators. 
21300
21301         * driver.cs: use error 5.
21302
21303 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21304
21305         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21306
21307 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * cs-parser.jay (switch_section): A beautiful patch from Martin
21310         Baulig that fixed 33094.
21311
21312 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21315         Check whether the base is abstract and report an error if so.
21316
21317         * expression.cs (IndexerAccess.DoResolveLValue,
21318         IndexerAccess.DoResolve): ditto. 
21319
21320         (Invocation.DoResolve): ditto.
21321
21322         (Invocation.FullMethodDesc): Improve the report string.
21323
21324         * statement.cs (Block): Eliminate IsVariableDefined as it is
21325         basically just a wrapper for GetVariableInfo.
21326
21327         * ecore.cs (SimpleName): Use new 
21328
21329         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21330         type, as we return the actual parameter ref/unref state on a
21331         different call.
21332
21333 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21334
21335         * support.cs: Return proper flags REF/OUT fixing the previous
21336         commit.  
21337
21338         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21339         not used to mean `ref' but `ref or out' in ParameterReference
21340
21341         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21342         full type signature instead of calling TypeManger.CSharpName
21343         ourselves. 
21344
21345         * support.cs (InternalParameters.ParameterDesc): Do not compare
21346         directly to the modflags, because REF/OUT will actually be bitsets
21347         if set. 
21348
21349         * delegate.cs (VerifyMethod): Check also the modifiers.
21350
21351         * cs-tokenizer.cs: Fix bug where floating point values with an
21352         exponent where a sign was missing was ignored.
21353
21354         * driver.cs: Allow multiple assemblies to be specified in a single
21355         /r: argument
21356
21357 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21358
21359         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21360         because identifiers after a parenthesis would end up in this kind
21361         of production, and we needed to desamiguate it for having casts
21362         like:
21363
21364                 (UserDefinedType *) xxx
21365
21366 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21367
21368         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21369         we should set on the Bindingflags.NonPublic, but not turn on
21370         private_ok.  private_ok controls whether a Private member is
21371         returned (this is chekced on the filter routine), while the
21372         BindingFlags.NonPublic just controls whether private/protected
21373         will be allowed.   This fixes the problem part of the problem of
21374         private properties being allowed to be used in derived classes.
21375
21376         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21377         so we can call the children DoResolveLValue method (this will
21378         properly signal errors on lvalue assignments to base properties)
21379
21380         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21381         getter are null, and we have a property info, we know that this
21382         happened because the lookup failed, so we report an error 122 for
21383         protection level violation.
21384
21385         We also silently return if setter and getter are null in the
21386         resolve functions, this condition only happens if we have flagged
21387         the error before.  This is the other half of the problem. 
21388
21389         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21390         not have accessibility information, that is why we were returning
21391         true in the filter function in typemanager.cs.
21392
21393         To properly report 122 (property is inaccessible because of its
21394         protection level) correctly, we report this error in ResolveAccess
21395         by failing if both the setter and the getter are lacking (ie, the
21396         lookup failed). 
21397
21398         DoResolve and DoLResolve have been modified to check for both
21399         setter/getter being null and returning silently, the reason being
21400         that I did not want to put the knowledge about this error in upper
21401         layers, like:
21402
21403         int old = Report.Errors;
21404         x = new PropertyExpr (...);
21405         if (old != Report.Errors)
21406                 return null;
21407         else
21408                 return x;
21409
21410         So the property expr is returned, but it is invalid, so the error
21411         will be flagged during the resolve process. 
21412
21413         * class.cs: Remove InheritablePropertySignatureCompare from the
21414         class, as we no longer depend on the property signature to compute
21415         whether it is possible to implement a method or not.
21416
21417         The reason is that calling PropertyInfo.GetGetMethod will return
21418         null (in .NET, in Mono it works, and we should change this), in
21419         cases where the Get Method does not exist in that particular
21420         class.
21421
21422         So this code:
21423
21424         class X { public virtual int A { get { return 1; } } }
21425         class Y : X { }
21426         class Z : Y { public override int A { get { return 2; } } }
21427
21428         Would fail in Z because the parent (Y) would not have the property
21429         defined.  So we avoid this completely now (because the alternative
21430         fix was ugly and slow), and we now depend exclusively on the
21431         method names.
21432
21433         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21434         reference method, instead of using the property.
21435
21436         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21437         routines are gone now.
21438
21439         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21440         names, they were incorrectly named.
21441
21442         * cs-tokenizer.cs: Return are more gentle token on failure. 
21443
21444         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21445         had an out-of-sync index variable, which caused it to remove from
21446         the list of pending methods the wrong method sometimes.
21447
21448 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21449
21450         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21451         CanWrite, because those refer to this particular instance of the
21452         property, and do not take into account the fact that we can
21453         override single members of a property.
21454
21455         Constructor requires an EmitContext.  The resolution process does
21456         not happen here, but we need to compute the accessors before,
21457         because the resolution does not always happen for properties.
21458
21459         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21460         subclass, before we did not update this flag, but we did update
21461         bindingflags. 
21462
21463         (GetAccessors): Drop this routine, as it did not work in the
21464         presence of partially overwritten set/get methods. 
21465
21466         Notice that this broke the cs1540 detection, but that will require
21467         more thinking. 
21468
21469 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21470
21471         * class.cs:
21472         * codegen.cs:
21473         * driver.cs: issue a warning instead of an error if we don't support
21474         debugging for the platform. Also ignore a couple of errors that may
21475         arise when trying to write the symbols. Undo my previous patch.
21476
21477 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21478
21479         * driver.cs: ignore /debug switch except for Unix platforms.
21480
21481 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21482
21483         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21484
21485 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21486
21487         * driver.cs: Do not make mcs-debug conditional, so we do not break
21488         builds that use it.
21489
21490         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21491         review this patch.  But basically after all the children variables
21492         have been merged, the value of "Breaks" was not being set to
21493         new_breaks for Switch blocks.  I think that it should be set after
21494         it has executed.  Currently I set this to the value of new_breaks,
21495         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21496         conservative, but I do not understand this code very well.
21497
21498         I did not break anything in the build, so that is good ;-)
21499
21500         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21501
21502 2002-10-20  Mark Crichton  <crichton@gimp.org>
21503
21504         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21505
21506 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21507
21508         * cfold.cs: Fixed compile blocker.
21509
21510 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21511
21512         * driver.cs: I was chekcing the key, not the file.
21513
21514 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21515
21516         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21517         message that we were generating - we just need to silently return
21518         a null.
21519
21520 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * class.cs (Event.Define): Change my previous commit, as this
21523         breaks the debugger.  This is a temporary hack, as it seems like
21524         the compiler is generating events incorrectly to begin with.
21525
21526         * expression.cs (Binary.ResolveOperator): Added support for 
21527         "U operator - (E x, E y)"
21528
21529         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21530         y)".
21531
21532         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21533         init-only variables, but this path did not take into account that
21534         there might be also instance readonly variables.  Correct this
21535         problem. 
21536
21537         This fixes bug 32253
21538
21539         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21540         delegates as well.
21541
21542         * driver.cs: Change the extension for modules to `netmodule'
21543
21544         * cs-parser.jay: Improved slightly the location tracking for
21545         the debugger symbols.
21546
21547         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21548         modifiers that were specified instead of the hardcoded value
21549         (FamAndAssem).  This was basically ignoring the static modifier,
21550         and others.  Fixes 32429.
21551
21552         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21553         fixed a bug in the process (32476)
21554
21555         * expression.cs (ArrayAccess.EmitAssign): Patch from
21556         hwang_rob@yahoo.ca that fixes bug 31834.3
21557
21558 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * driver.cs: Make the module extension .netmodule.
21561
21562 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21563
21564         * driver.cs: Report an error if the resource file is not found
21565         instead of crashing.
21566
21567         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21568         false, like Emit does.
21569
21570 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21571
21572         * typemanager.cs: Remove unused private member.  Also reported mcs
21573         bug to report this as a warning like csc.
21574
21575 2002-10-15  Martin Baulig  <martin@gnome.org>
21576
21577         * statement.cs (Statement.Emit): Made this a virtual method; emits
21578         the line number info and calls DoEmit().
21579         (Statement.DoEmit): New protected abstract method, formerly knows
21580         as Statement.Emit().
21581
21582         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21583
21584 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21585
21586         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21587         have fixed a remaining problem: not every AddXXXX was adding a
21588         fully qualified name.  
21589
21590         Now everyone registers a fully qualified name in the DeclSpace as
21591         being defined instead of the partial name.  
21592
21593         Downsides: we are slower than we need to be due to the excess
21594         copies and the names being registered this way.  
21595
21596         The reason for this is that we currently depend (on the corlib
21597         bootstrap for instance) that types are fully qualified, because
21598         we dump all the types in the namespace, and we should really have
21599         types inserted into the proper namespace, so we can only store the
21600         basenames in the defined_names array.
21601
21602 2002-10-10  Martin Baulig  <martin@gnome.org>
21603
21604         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21605         from bug #31834, see the bug report for a testcase which is
21606         miscompiled.
21607
21608 2002-10-10  Martin Baulig  <martin@gnome.org>
21609
21610         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21611         flow analysis code for this.
21612
21613         * statement.cs (Do, While, For): Tell the flow analysis code about
21614         infinite loops.
21615         (FlowBranching.UsageVector): Added support for infinite loops.
21616         (Block.Resolve): Moved the dead code elimination here and use flow
21617         analysis to do it.
21618
21619 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21620
21621         * class.cs (Field.Define): Catch cycles on struct type
21622         definitions. 
21623
21624         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21625         fields if the fields are static.  We only need to check instance
21626         fields. 
21627
21628         * expression.cs (As.DoResolve): Test for reference type.
21629
21630         * statement.cs (Using.ResolveExpression): Use
21631         ConvertImplicitRequired, not ConvertImplicit which reports an
21632         error on failture
21633         (Using.ResolveLocalVariableDecls): ditto.
21634
21635         * expression.cs (Binary.ResolveOperator): Report errors in a few
21636         places where we had to.
21637
21638         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21639
21640 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
21641
21642         * expression.cs: Use StoreFromPtr instead of extracting the type
21643         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
21644
21645         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21646         an enumeration value to a System.Enum, but System.Enum is not a
21647         value type, but an class type, so we need to box.
21648
21649         (Expression.ConvertExplicit): One codepath could return
21650         errors but not flag them.  Fix this.  Fixes #31853
21651
21652         * parameter.cs (Resolve): Do not allow void as a parameter type.
21653
21654 2002-10-06  Martin Baulig  <martin@gnome.org>
21655
21656         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21657         if it's a class type and not a struct.  Fixes #31815.
21658
21659 2002-10-06  Martin Baulig  <martin@gnome.org>
21660
21661         * statement.cs: Reworked the flow analysis code a bit to make it
21662         usable for dead code elimination.
21663
21664 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21665
21666         * cs-parser.jay: allow empty source files. Fixes bug #31781.
21667
21668 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21669
21670         * expression.cs (ComposedCast.DoResolveType): A quick workaround
21671         to fix the test 165, will investigate deeper.
21672
21673 2002-10-04  Martin Baulig  <martin@gnome.org>
21674
21675         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21676         finally blocks actually work.
21677         (Try.Resolve): We don't need to create a sibling for `finally' if
21678         there is no finally block.
21679
21680 2002-10-04  Martin Baulig  <martin@gnome.org>
21681
21682         * class.cs (Constructor.Define): The default accessibility for a
21683         non-default constructor is private, not public.
21684
21685 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21686
21687         * class.cs (Constructor): Make AllowedModifiers public, add
21688         EXTERN.
21689
21690         * cs-parser.jay: Perform the modifiers test here, as the
21691         constructor for the Constructor class usually receives a zero
21692         because of the way we create it (first we create, later we
21693         customize, and we were never checking the modifiers).
21694
21695         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21696         is a version of LookupTypeReflection that includes the type-name
21697         cache.  This can be used as a fast path for functions that know
21698         the fully qualified name and are only calling into *.GetType() to
21699         obtain a composed type.
21700
21701         This is also used by TypeManager.LookupType during its type
21702         composition.
21703
21704         (LookupType): We now also track the real type name, as sometimes
21705         we can get a quey for the real type name from things like
21706         ComposedCast.  This fixes bug 31422.
21707
21708         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21709         complete type fullname, it does not have to go through the type
21710         resolution system to obtain the composed version of the type (for
21711         obtaining arrays or pointers).
21712
21713         (Conditional.Emit): Use the EmitBoolExpression to
21714         generate nicer code, as requested by Paolo.
21715
21716         (ArrayCreation.CheckIndices): Use the patch from
21717         hwang_rob@yahoo.ca to validate the array initializers. 
21718
21719 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
21720
21721         * class.cs (ConstructorInitializer.Emit): simplify code by using
21722         Invocation.EmitCall, and at the same time, fix the bugs in calling
21723         parent constructors that took variable arguments. 
21724
21725         * ecore.cs (Expression.ConvertNumericExplicit,
21726         Expression.ImplicitNumericConversion): Remove the code that
21727         manually wrapped decimal (InternalTypeConstructor call is now gone
21728         as well).
21729
21730         * expression.cs (Cast.TryReduce): Also handle decimal types when
21731         trying to perform a constant fold on the type.
21732
21733         * typemanager.cs (IsUnmanagedtype): Partially implemented.
21734
21735         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21736         that only turned off an error report, and did nothing else. 
21737
21738 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
21739
21740         * driver.cs: Handle and ignore /fullpaths
21741
21742 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
21743
21744         * expression.cs (Binary.ResolveOperator): Catch the case where
21745         DoNumericPromotions returns true, 
21746
21747         (Binary.DoNumericPromotions): Simplify the code, and the tests.
21748
21749 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
21750
21751         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21752         report error 70.
21753
21754 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
21755
21756         * ecore.cs (ConvertNumericExplicit): It is not enough that the
21757         conversion exists, but it is also required that the conversion be
21758         performed.  This manifested in "(Type64Enum) 2".  
21759
21760         * class.cs (TypeManager.AddMethod): The fix is not to change
21761         AddEnum, because that one was using a fully qualified name (every
21762         DeclSpace derivative does), but to change the AddMethod routine
21763         that was using an un-namespaced name.  This now correctly reports
21764         the duplicated name.
21765
21766         Revert patch until I can properly fix it.  The issue
21767         is that we have a shared Type space across all namespaces
21768         currently, which is wrong.
21769
21770         Options include making the Namespace a DeclSpace, and merge
21771         current_namespace/current_container in the parser.
21772
21773 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * cs-parser.jay: Improve error reporting when we get a different
21776         kind of expression in local_variable_type and
21777         local_variable_pointer_type. 
21778
21779         Propagate this to avoid missleading errors being reported.
21780
21781         * ecore.cs (ImplicitReferenceConversion): treat
21782         TypeManager.value_type as a target just like object_type.   As
21783         code like this:
21784
21785         ValueType v = 1;
21786
21787         Is valid, and needs to result in the int 1 being boxed before it
21788         is assigned to the value type v.
21789
21790         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21791         to validate the enumeration name.
21792
21793         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21794         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
21795         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21796
21797         * ecore.cs (TryImplicitIntConversion): When doing an
21798         implicit-enumeration-conversion, check if the type is 64-bits and
21799         perform a conversion before passing to EnumConstant.
21800
21801 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
21802
21803         * decl.cs (Error_AmbiguousTypeReference); New routine used to
21804         report ambiguous type references.  Unlike the MS version, we
21805         report what the ambiguity is.   Innovation at work ;-)
21806
21807         (DeclSpace.FindType): Require a location argument to
21808         display when we display an ambiguous error.
21809
21810         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21811
21812         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21813
21814         * expression.cs (EmitDynamicInitializers): Apply patch from
21815         hwang_rob@yahoo.ca that fixes the order in which we emit our
21816         initializers. 
21817
21818 2002-09-21  Martin Baulig  <martin@gnome.org>
21819
21820         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21821         delegate takes no arguments.
21822
21823 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
21824
21825         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21826         from integers.
21827
21828         * expression.cs: Extract the underlying type.
21829
21830         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21831
21832         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21833
21834 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
21835
21836         * class.cs (TypeContainer.DefineType): We can not use the nice
21837         PackingSize with the size set to 1 DefineType method, because it
21838         will not allow us to define the interfaces that the struct
21839         implements.
21840
21841         This completes the fixing of bug 27287
21842
21843         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21844         means also structs.  This fixes part of the problem. 
21845         (Expresion.ImplicitReferenceConversionExists): ditto.
21846
21847         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21848         error if there were no errors reported during the type lookup
21849         process, to avoid duplicates or redundant errors.  Without this
21850         you would get an ambiguous errors plus a type not found.  We have
21851         beaten the user enough with the first error.  
21852
21853         (DeclSparce.FindType): Emit a warning if we have an ambiguous
21854         reference. 
21855
21856         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21857         during the resolution process, stop the lookup, this avoids
21858         repeated error reports (same error twice).
21859
21860         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21861
21862         * typemanager.cs (LookupType): Redo the type lookup code to match
21863         the needs of System.Reflection.  
21864
21865         The issue is that System.Reflection requires references to nested
21866         types to begin with a "+" sign instead of a dot.  So toplevel
21867         types look like: "NameSpace.TopLevelClass", and nested ones look
21868         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21869         levels. 
21870
21871 2002-09-19  Martin Baulig  <martin@gnome.org>
21872
21873         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21874         says that a method always returns or always throws an exception,
21875         don't report the CS0161.
21876
21877         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21878         set `Returns = new_returns'.
21879
21880 2002-09-19  Martin Baulig  <martin@gnome.org>
21881
21882         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21883         to an enum constant, check for a CS0176.
21884
21885 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
21886
21887         * class.cs (TypeContainer.CheckPairedOperators): Now we check
21888         for operators that must be in pairs and report errors.
21889
21890         * ecore.cs (SimpleName.DoResolveType): During the initial type
21891         resolution process, when we define types recursively, we must
21892         check first for types in our current scope before we perform
21893         lookups in the enclosing scopes.
21894
21895         * expression.cs (MakeByteBlob): Handle Decimal blobs.
21896
21897         (Invocation.VerifyArgumentsCompat): Call
21898         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21899         I thought we were supposed to always call this, but there are a
21900         few places in the code where we dont do it.
21901
21902 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
21903
21904         * driver.cs: Add support in -linkres and -resource to specify the
21905         name of the identifier.
21906
21907 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21908
21909         * ecore.cs (StandardConversionExists): Sync with the conversion
21910         code: allow anything-* to void* conversions.
21911
21912         (FindMostSpecificSource): Use an Expression argument
21913         instead of a Type, because we might be handed over a Literal which
21914         gets a few more implicit conversions that plain types do not.  So
21915         this information was being lost.
21916
21917         Also, we drop the temporary type-holder expression when not
21918         required.
21919
21920 2002-09-17  Martin Baulig  <martin@gnome.org>
21921
21922         * class.cs (PropertyBase.CheckBase): Don't check the base class if
21923         this is an explicit interface implementation.
21924
21925 2002-09-17  Martin Baulig  <martin@gnome.org>
21926
21927         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21928         different `IndexerName' attributes.
21929
21930         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21931         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21932         virtual CommonResolve().
21933
21934 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21935
21936         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21937         and convert that to the UnderlyingType.
21938
21939         * statement.cs (Foreach.Resolve): Indexers are just like variables
21940         or PropertyAccesses.
21941
21942         * cs-tokenizer.cs (consume_string): Track line numbers and columns
21943         inside quoted strings, we were not doing this before.
21944
21945 2002-09-16  Martin Baulig  <martin@gnome.org>
21946
21947         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21948         resolve it.  This is needed for the definite assignment check of the
21949         instance expression, fixes bug #29846.
21950         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21951
21952 2002-09-16  Nick Drochak  <ndrochak@gol.com>
21953
21954         * parameter.cs: Fix compile error.  Cannot reference static member
21955         from an instance object.  Is this an mcs bug?
21956
21957 2002-09-14  Martin Baulig  <martin@gnome.org>
21958
21959         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21960         multiple times.  Fixes bug #30295, added test-166.cs.
21961
21962 2002-09-14  Martin Baulig  <martin@gnome.org>
21963
21964         * statement.cs (Block.Emit): Don't emit unreachable code.
21965         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21966         `break' statements.
21967         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21968
21969 2002-09-14  Martin Baulig  <martin@gnome.org>
21970
21971         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21972         is set.
21973
21974 2002-09-14  Martin Baulig  <martin@gnome.org>
21975
21976         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21977         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21978         be false on the ms runtime.
21979
21980 2002-09-13  Martin Baulig  <martin@gnome.org>
21981
21982         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21983         the CS0038 error message.
21984
21985 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
21986
21987         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21988         constant inside, return it.
21989
21990 2002-09-12  Martin Baulig  <martin@gnome.org>
21991
21992         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21993         implicit conversion can be done between enum types.
21994
21995         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21996         check whether an implicit conversion to the current enum's UnderlyingType
21997         exists and report an error if not.
21998
21999         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22000         without debugging support.
22001
22002         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22003         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22004
22005 2002-09-12  Martin Baulig  <martin@gnome.org>
22006
22007         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22008
22009         * ecore.cs (IMemberExpr.DeclaringType): New property.
22010         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22011         nonstatic member of an outer type (CS0038).
22012
22013 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22014
22015         * driver.cs: Activate the using-error detector at warning level
22016         4 (at least for MS-compatible APIs).
22017
22018         * namespace.cs (VerifyUsing): Small buglett fix.
22019
22020         * pending.cs (PendingImplementation): pass the container pointer. 
22021
22022         * interface.cs (GetMethods): Allow for recursive definition.  Long
22023         term, I would like to move every type to support recursive
22024         definitions, not the current ordering mechanism that we have right
22025         now.
22026
22027         The situation is this: Attributes are handled before interfaces,
22028         so we can apply attributes to interfaces.  But some attributes
22029         implement interfaces, we will now handle the simple cases
22030         (recursive definitions will just get an error).  
22031
22032         * parameter.cs: Only invalidate types at the end if we fail to
22033         lookup all types.  
22034
22035 2002-09-09  Martin Baulig  <martin@gnome.org>
22036
22037         * ecore.cs (PropertyExpr.Emit): Also check for
22038         TypeManager.system_int_array_get_length so this'll also work when
22039         compiling corlib.  Fixes #30003.
22040
22041 2002-09-09  Martin Baulig  <martin@gnome.org>
22042
22043         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22044         and throw an exception if we can't get the type's size.  Fixed #30040,
22045         added test-165.cs.
22046
22047 2002-09-09  Martin Baulig  <martin@gnome.org>
22048
22049         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22050
22051         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22052         context.  Fixes bug #30027.
22053
22054         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22055         virtual functions.  Fixes bug #30043, added test-164.cs.
22056
22057 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22058
22059         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22060
22061 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22062
22063         * driver.cs: Use an object to get the windows codepage since it's not a
22064         static property.
22065
22066 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22067
22068         * statement.cs (For.Emit): for infinite loops (test == null)
22069         return whether there is a break inside, not always "true".
22070
22071         * namespace.cs (UsingEntry): New struct to hold the name of the
22072         using definition, the location where it is defined, and whether it
22073         has been used in a successful type lookup.
22074
22075         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22076         strings.
22077
22078         * decl.cs: ditto.
22079
22080 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22081
22082         * attribute.cs : Fix incorrect code which relied on catching
22083         a NullReferenceException to detect a null being passed in
22084         where an object was expected.
22085
22086 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22087
22088         * statement.cs (Try): flag the catch variable as assigned
22089
22090         * expression.cs (Cast): Simplified by using ResolveType instead of
22091         manually resolving.
22092
22093         * statement.cs (Catch): Fix bug by using ResolveType.
22094
22095 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22096
22097         * expression.cs (BetterConversion): Special case for when we have
22098         a NullLiteral as the argument and we have to choose between string
22099         and object types - we choose string the way csc does.
22100
22101         * attribute.cs (Attribute.Resolve): Catch the
22102         NullReferenceException and report error #182 since the Mono
22103         runtime no more has the bug and having this exception raised means
22104         we tried to select a constructor which takes an object and is
22105         passed a null.
22106
22107 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22108
22109         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22110         message (1502, 1503) when we can't locate a method after overload
22111         resolution. This is much more informative and closes the bug
22112         Miguel reported.
22113
22114         * interface.cs (PopulateMethod): Return if there are no argument
22115         types. Fixes a NullReferenceException bug.
22116
22117         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22118         expressions too. Previously we were checking only in one place for
22119         positional arguments leaving out named arguments.
22120
22121         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22122         type to the enum type is not allowed. Remove code corresponding to
22123         that.
22124
22125         (ConvertNumericExplicit): Allow explicit conversions from
22126         the underlying type to enum type. This precisely follows the spec
22127         and closes a bug filed by Gonzalo.
22128
22129 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22130
22131         * compiler.csproj:
22132         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22133
22134 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
22135
22136         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22137         it was important that we stored the right value after the
22138         reduction in `converted'.
22139
22140 2002-09-04  Martin Baulig  <martin@gnome.org>
22141
22142         * location.cs (Location.SymbolDocument): Use full pathnames for the
22143         source files.
22144
22145 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
22146
22147         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22148         of the expression resolve mechanism, because that will catch the
22149         SimpleName error failures.
22150
22151         (Conditional): If we can not resolve the
22152         expression, return, do not crash.
22153
22154 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22155
22156         * cs-tokenizer.cs:
22157         (location): display token name instead of its number.
22158
22159 2002-08-28  Martin Baulig  <martin@gnome.org>
22160
22161         * expression.cs (Binary.ResolveOperator): Don't silently return
22162         but return an error if an operator cannot be applied between two
22163         enum types.
22164
22165 2002-08-28  Martin Baulig  <martin@gnome.org>
22166
22167         * class.cs (Constructor.Define): Set the permission attributes
22168         correctly instead of making all constructors public.
22169
22170 2002-08-28  Martin Baulig  <martin@gnome.org>
22171
22172         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22173         for private members before reporting a CS0103; if we find anything,
22174         it's a CS0122.
22175
22176 2002-08-28  Martin Baulig  <martin@gnome.org>
22177
22178         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22179         to check whether `closure_start_type == closure_invocation_type',
22180         we also need to check whether `m.DeclaringType == closure_invocation_type'
22181         before bypassing the permission checks.  We might be accessing
22182         protected/private members from the base class.
22183         (TypeManager.RealMemberLookup): Only set private_ok if private
22184         members were requested via BindingFlags.NonPublic.
22185
22186         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22187
22188         * expression.cs (MemberAccess.ResolveMemberAccess): Set
22189         MethodGroupExpr.IsExplicitImpl if appropriate.
22190         (Invocation.DoResolve): Don't report the CS0120 for explicit
22191         interface implementations.
22192
22193 2002-08-27  Martin Baulig  <martin@gnome.org>
22194
22195         * expression.cs (Invocation.DoResolve): If this is a static
22196         method and we don't have an InstanceExpression, we must report
22197         a CS0120.
22198
22199 2002-08-25  Martin Baulig  <martin@gnome.org>
22200
22201         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22202         `==' between a valuetype and an object.
22203
22204 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
22205
22206         * ecore.cs (TypeExpr): Provide a ToString method.
22207
22208 2002-08-24  Martin Baulig  <martin@gnome.org>
22209
22210         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22211         now called proggie.dbg and it's a binary file.
22212
22213 2002-08-23  Martin Baulig  <martin@gnome.org>
22214
22215         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22216
22217 2002-08-23  Martin Baulig  <martin@gnome.org>
22218
22219         * struct.cs (MyStructInfo.ctor): Make this work with empty
22220         structs; it's not allowed to use foreach() on null.
22221
22222 2002-08-23  Martin Baulig  <martin@gnome.org>
22223
22224         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22225         writer the full pathname of the generated assembly.
22226
22227 2002-08-23  Martin Baulig  <martin@gnome.org>
22228
22229         * statements.cs (FlowBranching.UsageVector.MergeChildren):
22230         A `finally' block never returns or breaks; improved handling of
22231         unreachable code.
22232
22233 2002-08-23  Martin Baulig  <martin@gnome.org>
22234
22235         * statement.cs (Throw.Resolve): Allow `throw null'.
22236
22237 2002-08-23  Martin Baulig  <martin@gnome.org>
22238
22239         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22240         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22241         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22242         MemberLookup would return a wrong event if this is an explicit
22243         interface implementation and the class has an event with the same
22244         name.
22245
22246 2002-08-23  Martin Baulig  <martin@gnome.org>
22247
22248         * statement.cs (Block.AddChildVariableNames): New public method.
22249         (Block.AddChildVariableName): Likewise.
22250         (Block.IsVariableNameUsedInChildBlock): Likewise.
22251         (Block.AddVariable): Check whether a variable name has already
22252         been used in a child block.
22253
22254         * cs-parser.jay (declare_local_variables): Mark all variable names
22255         from the current block as being used in a child block in the
22256         implicit block.
22257
22258 2002-08-23  Martin Baulig  <martin@gnome.org>
22259
22260         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22261         find the symbol writer.
22262
22263         * driver.cs: csc also allows the arguments to /define being
22264         separated by commas, not only by semicolons.
22265
22266 2002-08-23  Martin Baulig  <martin@gnome.org>
22267
22268         * interface.cs (Interface.GetMembers): Added static check for events.
22269
22270 2002-08-15  Martin Baulig  <martin@gnome.org>
22271
22272         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22273         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22274
22275         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22276         why the MethodData.EmitDestructor() change was necessary.
22277
22278 2002-08-20  Martin Baulig  <martin@gnome.org>
22279
22280         * class.cs (TypeContainer.FindMembers): Added static check for events.
22281
22282         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22283
22284         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22285         use Type.GetEvents(), not Type.FindMembers().
22286
22287 2002-08-20  Martin Baulig  <martin@gnome.org>
22288
22289         * decl.cs (MemberCache): Added a special method cache which will
22290         be used for method-only searched.  This ensures that a method
22291         search will return a MethodInfo with the correct ReflectedType for
22292         inherited methods.      
22293
22294 2002-08-20  Martin Baulig  <martin@gnome.org>
22295
22296         * decl.cs (DeclSpace.FindMembers): Made this public.
22297
22298 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22299
22300         * delegate.cs: fixed build on windows.
22301         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22302
22303 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22304
22305         * ecore.cs (StandardConversionExists): Return a false
22306         if we are trying to convert the void type to anything else
22307         since that is not allowed.
22308
22309         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22310         we flag error 70 in the event an event is trying to be accessed
22311         directly from outside the declaring type.
22312
22313 2002-08-20  Martin Baulig  <martin@gnome.org>
22314
22315         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22316         MemberCache from typemanager.cs to decl.cs.
22317
22318 2002-08-19  Martin Baulig  <martin@gnome.org>
22319
22320         * class.cs (TypeContainer): Implement IMemberContainer.
22321         (TypeContainer.DefineMembers): Create the MemberCache.
22322         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22323         return public members if BindingFlags.Public was given, check
22324         whether members are static.
22325
22326 2002-08-16  Martin Baulig  <martin@gnome.org>
22327
22328         * decl.cs (DeclSpace.Define): Splitted this in Define and
22329         DefineMembers.  DefineMembers is called first and initializes the
22330         MemberCache.
22331
22332         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22333         DefineMembers() on all our DeclSpaces.
22334
22335         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22336         but call DefineMembers() on all nested interfaces.  We call their
22337         Define() in our new Define() function.
22338
22339         * interface.cs (Interface): Implement IMemberContainer.
22340         (Interface.Define): Moved all code except the attribute stuf to
22341         DefineMembers().
22342         (Interface.DefineMembers): Initialize the member cache.
22343
22344         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22345         need this anymore since we can use MemberCache.FindMembers directly.
22346
22347 2002-08-19  Martin Baulig  <martin@gnome.org>
22348
22349         * typemanager.cs (MemberCache): When creating the cache for an
22350         interface type, add all inherited members.
22351         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22352         to `out bool used_cache' and documented it.
22353         (TypeManager.MemberLookup): If we already used the cache in the first
22354         iteration, we don't need to do the interfaces check.
22355
22356 2002-08-19  Martin Baulig  <martin@gnome.org>
22357
22358         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22359         here from IMemberFinder and don't implement this interface anymore.
22360         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22361
22362         * typemanager.cs (IMemberFinder): This interface is now only used by
22363         classes which actually support the member cache.
22364         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22365         since we only put DeclSpaces into this Hashtable.
22366         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22367         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22368
22369 2002-08-16  Martin Baulig  <martin@gnome.org>
22370
22371         * typemanager.cs (ICachingMemberFinder): Removed.
22372         (IMemberFinder.MemberCache): New property.
22373         (TypeManager.FindMembers): Merged this with RealFindMembers().
22374         This function will never be called from TypeManager.MemberLookup()
22375         so we can't use the cache here, just the IMemberFinder.
22376         (TypeManager.MemberLookup_FindMembers): Check whether the
22377         IMemberFinder has a MemberCache and call the cache's FindMembers
22378         function.
22379         (MemberCache): Rewrote larger parts of this yet another time and
22380         cleaned it up a bit.
22381
22382 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22383
22384         * driver.cs (LoadArgs): Support quoting.
22385
22386         (Usage): Show the CSC-like command line arguments.
22387
22388         Improved a few error messages.
22389
22390 2002-08-15  Martin Baulig  <martin@gnome.org>
22391
22392         * typemanager.cs (IMemberContainer.Type): New property.
22393         (IMemberContainer.IsInterface): New property.
22394
22395         The following changes are conditional to BROKEN_RUNTIME, which is
22396         defined at the top of the file.
22397
22398         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22399         class'es members, but add all members from TypeHandle.ObjectType
22400         if we're an interface.
22401         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22402         is the current type.
22403         (MemberCache.CacheEntry.Container): Removed this field.
22404         (TypeHandle.GetMembers): Include inherited members.
22405
22406 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22407
22408         * typemanager.cs: fixed compilation and added a comment on a field that
22409         is never used.
22410
22411 2002-08-15  Martin Baulig  <martin@gnome.org>
22412
22413         * class.cs (ConstructorInitializer.Resolve): In the
22414         Expression.MemberLookup call, use the queried_type as
22415         invocation_type.
22416
22417         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22418         declared' attribute, it's always true.
22419         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22420         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22421         temporary wrapper for FindMembers which tells MemberLookup whether
22422         members from the base classes are included in the return value.
22423         This will go away soon.
22424         (TypeManager.MemberLookup): Use this temporary hack here; once the
22425         new MemberCache is completed, we don't need to do the DeclaredOnly
22426         looping here anymore since the MemberCache will take care of this.
22427         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22428         (MemberCache): When creating the MemberCache for a class, get
22429         members from the current class and all its base classes.
22430         (MemberCache.CacheEntry.Container): New field.  This is a
22431         temporary hack until the Mono runtime is fixed to distinguish
22432         between ReflectedType and DeclaringType.  It allows us to use MCS
22433         with both the MS runtime and the unfixed Mono runtime without
22434         problems and without accecting performance.
22435         (MemberCache.SearchMembers): The DeclaredOnly looping from
22436         TypeManager.MemberLookup is now done here.      
22437
22438 2002-08-14  Martin Baulig  <martin@gnome.org>
22439
22440         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22441         Type.GetFields on dynamic types but get the fields from the
22442         corresponding TypeContainer.
22443         (MyStructInfo.GetStructInfo): Added check for enum types.
22444
22445         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22446         (MemberList.SyncRoot): Implemented.
22447         (TypeManager.FilterWithClosure): No need to check permissions if
22448         closure_start_type == closure_invocation_type, don't crash if
22449         closure_invocation_type is null.
22450
22451 2002-08-13  Martin Baulig  <martin@gnome.org>
22452
22453         Rewrote TypeContainer.FindMembers to use a member cache.  This
22454         gives us a speed increase of about 35% for the self-hosting MCS
22455         build and of about 15-20% for the class libs (both on GNU/Linux).
22456
22457         * report.cs (Timer): New class to get enhanced profiling.  This
22458         whole class is "TIMER" conditional since it remarkably slows down
22459         compilation speed.
22460
22461         * class.cs (MemberList): New class.  This is an IList wrapper
22462         which we're now using instead of passing MemberInfo[]'s around to
22463         avoid copying this array unnecessarily.
22464         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22465         (ICachingMemberFinder, IMemberContainer): New interface.
22466         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22467         has already been checked, otherwise use it for the name comparision.
22468         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22469         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22470         if possible.  Returns a MemberList, not a MemberInfo [].
22471         (TypeHandle): New class, implements IMemberContainer.  We create
22472         one instance of this class per type, it contains a MemberCache
22473         which is used to do the member lookups.
22474         (MemberCache): New class.  Each instance of this class contains
22475         all members of a type and a name-based hash table.
22476         (MemberCache.FindMembers): This is our new member lookup
22477         function.  First, it looks up all members of the requested name in
22478         the hash table.  Then, it walks this list and sorts out all
22479         applicable members and returns them.
22480
22481 2002-08-13  Martin Baulig  <martin@gnome.org>
22482
22483         In addition to a nice code cleanup, this gives us a performance
22484         increase of about 1.4% on GNU/Linux - not much, but it's already
22485         half a second for the self-hosting MCS compilation.
22486
22487         * typemanager.cs (IMemberFinder): New interface.  It is used by
22488         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22489         Enum, Delegate or Interface.
22490         (TypeManager.finder_to_member_finder): New PtrHashtable.
22491         (TypeManager.finder_to_container): Removed.
22492         (TypeManager.finder_to_delegate): Removed.
22493         (TypeManager.finder_to_interface): Removed.
22494         (TypeManager.finder_to_enum): Removed.
22495
22496         * interface.cs (Interface): Implement IMemberFinder.
22497
22498         * delegate.cs (Delegate): Implement IMemberFinder.
22499
22500         * enum.cs (Enum): Implement IMemberFinder.
22501
22502         * class.cs (TypeContainer): Implement IMemberFinder.
22503
22504 2002-08-12  Martin Baulig  <martin@gnome.org>
22505
22506         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22507
22508 2002-08-12  Martin Baulig  <martin@gnome.org>
22509
22510         * ecore.cs (ITypeExpression): New interface for expressions which
22511         resolve to a type.
22512         (TypeExpression): Renamed to TypeLookupExpression.
22513         (Expression.DoResolve): If we're doing a types-only lookup, the
22514         expression must implement the ITypeExpression interface and we
22515         call DoResolveType() on it.
22516         (SimpleName): Implement the new ITypeExpression interface.
22517         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22518         hack, the situation that we're only looking up types can't happen
22519         anymore when this method is called.  Moved the type lookup code to
22520         DoResolveType() and call it.
22521         (SimpleName.DoResolveType): This ITypeExpression interface method
22522         is now doing the types-only lookup.
22523         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22524         (ResolveFlags): Added MaskExprClass.
22525
22526         * expression.cs (MemberAccess): Implement the ITypeExpression
22527         interface.
22528         (MemberAccess.DoResolve): Added support for a types-only lookup
22529         when we're called via ITypeExpression.DoResolveType().
22530         (ComposedCast): Implement the ITypeExpression interface.
22531
22532         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22533         Expression.Resolve() with ResolveFlags.Type instead.
22534
22535 2002-08-12  Martin Baulig  <martin@gnome.org>
22536
22537         * interface.cs (Interface.Define): Apply attributes.
22538
22539         * attribute.cs (Attribute.ApplyAttributes): Added support for
22540         interface attributes.
22541
22542 2002-08-11  Martin Baulig  <martin@gnome.org>
22543
22544         * statement.cs (Block.Emit): Only check the "this" variable if we
22545         do not always throw an exception.
22546
22547         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22548         whether the property has a set accessor.
22549
22550 2002-08-11  Martin Baulig  <martin@gnome.org>
22551
22552         Added control flow analysis support for structs.
22553
22554         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22555         with control flow analysis turned off.
22556         (IVariable): New interface.
22557         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22558         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22559         (FieldExpr.DoResolve): Resolve the instance expression with flow
22560         analysis turned off and do the definite assignment check after the
22561         resolving when we know what the expression will resolve to.
22562
22563         * expression.cs (LocalVariableReference, ParameterReference):
22564         Implement the new IVariable interface, only call the flow analysis
22565         code if ec.DoFlowAnalysis is true.
22566         (This): Added constructor which takes a Block argument.  Implement
22567         the new IVariable interface.
22568         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22569         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22570         This does the definite assignment checks for struct members.
22571
22572         * class.cs (Constructor.Emit): If this is a non-static `struct'
22573         constructor which doesn't have any initializer, call
22574         Block.AddThisVariable() to tell the flow analysis code that all
22575         struct elements must be initialized before control returns from
22576         the constructor.
22577
22578         * statement.cs (MyStructInfo): New public class.
22579         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22580         argument to this indexer.  If non-zero, check an individual struct
22581         member, not the whole struct.
22582         (FlowBranching.CheckOutParameters): Check struct members.
22583         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22584         overloaded versions of these methods which take an additional
22585         `int field_idx' argument to check struct members.
22586         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22587         overloaded versions of these methods which take an additional
22588         `string field_name' argument to check struct member.s
22589         (VariableInfo): Implement the IVariable interface.
22590         (VariableInfo.StructInfo): New public property.  Returns the
22591         MyStructInfo instance of the variable if it's a struct or null.
22592         (Block.AddThisVariable): New public method.  This is called from
22593         Constructor.Emit() for non-static `struct' constructor which do
22594         not have any initializer.  It creates a special variable for the
22595         "this" instance variable which will be checked by the flow
22596         analysis code to ensure that all of the struct's fields are
22597         initialized before control returns from the constructor.
22598         (UsageVector): Added support for struct members.  If a
22599         variable/parameter is a struct with N members, we reserve a slot
22600         in the usage vector for each member.  A struct is considered fully
22601         initialized if either the struct itself (slot 0) or all its
22602         members are initialized.
22603
22604 2002-08-08  Martin Baulig  <martin@gnome.org>
22605
22606         * driver.cs (Driver.MainDriver): Only report an error CS5001
22607         if there were no compilation errors.
22608
22609         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22610         `UnsafeContext' property to determine whether the parent is in
22611         unsafe context rather than checking the parent's ModFlags:
22612         classes nested in an unsafe class are unsafe as well.
22613
22614 2002-08-08  Martin Baulig  <martin@gnome.org>
22615
22616         * statement.cs (UsageVector.MergeChildren): Distinguish between
22617         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22618         we return.  Added test17() and test18() to test-154.cs.
22619
22620 2002-08-08  Martin Baulig  <martin@gnome.org>
22621
22622         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22623         Family access, make sure the invoking type isn't a subclass of the
22624         queried type (that'd be a CS1540).
22625
22626         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22627         this method which takes an additional `Type invocation_type'.
22628
22629         * expression.cs (BaseAccess.DoResolve): Use the base type as
22630         invocation and query type.
22631         (MemberAccess.DoResolve): If the lookup failed and we're about to
22632         report a CS0122, try a lookup with the ec.ContainerType - if this
22633         succeeds, we must report a CS1540.
22634
22635 2002-08-08  Martin Baulig  <martin@gnome.org>
22636
22637         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22638         (MethodGroupExpr): Implement the IMemberExpr interface.
22639
22640         * expression (MemberAccess.ResolveMemberAccess): No need to have
22641         any special code for MethodGroupExprs anymore, they're now
22642         IMemberExprs.   
22643
22644 2002-08-08  Martin Baulig  <martin@gnome.org>
22645
22646         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22647         Family, FamANDAssem and FamORAssem permissions.
22648         (TypeManager.IsSubclassOrNestedChildOf): New public method.
22649
22650 2002-08-08  Martin Baulig  <martin@gnome.org>
22651
22652         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22653         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22654         or loop block.
22655
22656 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22657
22658         * driver.cs: implemented /resource option to embed managed resources.
22659
22660 2002-08-07  Martin Baulig  <martin@gnome.org>
22661
22662         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22663         (FieldBase.HasFieldInitializer): New public property.
22664         (FieldBase.GetInitializerExpression): New public method.  Resolves and
22665         returns the field initializer and makes sure it is only resolved once.
22666         (TypeContainer.EmitFieldInitializers): Call
22667         FieldBase.GetInitializerExpression to get the initializer, this ensures
22668         that it isn't resolved multiple times.
22669
22670         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
22671         the resolving process (SimpleName/MemberLookup) that we're currently
22672         emitting a field initializer (which must not access any instance members,
22673         this is an error CS0236).
22674
22675         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22676         argument, if the `IsFieldInitializer' flag is set, we must report and
22677         error CS0236 and not an error CS0120.   
22678
22679 2002-08-07  Martin Baulig  <martin@gnome.org>
22680
22681         * ecore.cs (IMemberExpr): New public interface.
22682         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22683         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22684         if the expression is an IMemberExpr.
22685
22686         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22687         to be null, implicitly default to `this' if we're non-static in
22688         this case.  Simplified the code a lot by using the new IMemberExpr
22689         interface.  Also fixed bug #28176 here.
22690
22691 2002-08-06  Martin Baulig  <martin@gnome.org>
22692
22693         * cs-parser.jay (SimpleLookup): Removed.  We need to create
22694         ParameterReferences during semantic analysis so that we can do a
22695         type-only search when resolving Cast, TypeOf and SizeOf.
22696         (block): Pass the `current_local_parameters' to the Block's
22697         constructor.
22698
22699         * class.cs (ConstructorInitializer): Added `Parameters parameters'
22700         argument to the constructor.
22701         (ConstructorInitializer.Resolve): Create a temporary implicit
22702         block with the parameters.
22703
22704         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22705         references here if we aren't doing a type-only search.
22706
22707         * statement.cs (Block): Added constructor which takes a
22708         `Parameters parameters' argument.
22709         (Block.Parameters): New public property.
22710
22711         * support.cs (InternalParameters.Parameters): Renamed `parameters'
22712         to `Parameters' and made it public readonly.
22713
22714 2002-08-06  Martin Baulig  <martin@gnome.org>
22715
22716         * ecore.cs (Expression.Warning): Made this public as well.
22717
22718         * report.cs (Report.Debug): Print the contents of collections.
22719
22720 2002-08-06  Martin Baulig  <martin@gnome.org>
22721
22722         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
22723         used to tell Resolve() which kinds of expressions it may return.
22724         (Expression.Resolve): Added overloaded version of this method which
22725         takes a `ResolveFlags flags' argument.  This can be used to tell
22726         Resolve() which kinds of expressions it may return.  Reports a
22727         CS0118 on error.
22728         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22729         ResolveFlags.SimpleName.
22730         (Expression.Error118): Added overloaded version of this method which
22731         takes a `ResolveFlags flags' argument.  It uses the flags to determine
22732         which kinds of expressions are allowed.
22733
22734         * expression.cs (Argument.ResolveMethodGroup): New public method.
22735         Resolves an argument, but allows a MethodGroup to be returned.
22736         This is used when invoking a delegate.
22737
22738         * TODO: Updated a bit.
22739
22740 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22741
22742         Fixed compilation with csc.
22743
22744         * ecore.cs: Expression.Error made public. Is this correct? Should
22745         Warning be made public too?
22746
22747         * expression.cs: use ea.Location instead of ea.loc.
22748         [FIXME:  Filed as bug #28607: MCS must report these errors.]
22749
22750 2002-08-06  Martin Baulig  <martin@gnome.org>
22751
22752         * ecore.cs (Expression.loc): Moved the location here instead of
22753         duplicating it in all derived classes.
22754         (Expression.Location): New public property.
22755         (Expression.Error, Expression.Warning): Made them non-static and
22756         removed the location argument.
22757         (Expression.Warning): Added overloaded version which takes an
22758         `int level' argument.
22759         (Expression.Error118): Make this non-static and removed the
22760         expression and location arguments.
22761         (TypeExpr): Added location argument to the constructor.
22762
22763         * expression.cs (StaticCallExpr): Added location argument to
22764         the constructor.
22765         (Indirection, PointerArithmetic): Likewise.
22766         (CheckedExpr, UnCheckedExpr): Likewise.
22767         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22768         (StringPtr): Likewise.
22769
22770
22771 2002-08-05  Martin Baulig  <martin@gnome.org>
22772
22773         * expression.cs (BaseAccess.DoResolve): Actually report errors.
22774
22775         * assign.cs (Assign.DoResolve): Check whether the source
22776         expression is a value or variable.
22777
22778         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22779         while resolving the corresponding blocks.
22780
22781         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22782         an error, don't silently return null.
22783
22784         * statement.cs (Block.AddVariable): Do the error reporting here
22785         and distinguish between CS0128 and CS0136.
22786         (Block.DoResolve): Report all unused labels (warning CS0164).
22787         (LabeledStatement): Pass the location to the constructor.
22788         (LabeledStatement.HasBeenReferenced): New property.
22789         (LabeledStatement.Resolve): Set it to true here.
22790
22791         * statement.cs (Return.Emit): Return success even after reporting
22792         a type mismatch error (CS0126 or CS0127), this is what csc does and
22793         it avoids confusing the users with any consecutive errors.
22794
22795 2002-08-05  Martin Baulig  <martin@gnome.org>
22796
22797         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22798
22799         * const.cs (Const.LookupConstantValue): Catch circular definitions.
22800
22801         * expression.cs (MemberAccess.DoResolve): Silently return if an
22802         error has already been reported.
22803
22804         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22805         error has already been reported.
22806
22807 2002-08-05  Martin Baulig  <martin@gnome.org>
22808
22809         * statement.cs (UsageVector): Only initialize the `parameters'
22810         vector if we actually have any "out" parameters.
22811
22812 2002-08-05  Martin Baulig  <martin@gnome.org>
22813
22814         * expression.cs (Binary.ResolveOperator): When combining delegates,
22815         they must have the same type.
22816
22817 2002-08-05  Martin Baulig  <martin@gnome.org>
22818
22819         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22820         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22821         work with the ms runtime and we also don't need it: if we're a
22822         PropertyBuilder and not in the `indexer_arguments' hash, then we
22823         are a property and not an indexer.
22824
22825         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22826         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22827         since the latter one doesn't work with the ms runtime.
22828
22829 2002-08-03  Martin Baulig  <martin@gnome.org>
22830
22831         Fixed bugs #27998 and #22735.
22832
22833         * class.cs (Method.IsOperator): New public field.
22834         (Method.CheckBase): Report CS0111 if there's already a method
22835         with the same parameters in the current class.  Report CS0508 when
22836         attempting to change the return type of an inherited method.
22837         (MethodData.Emit): Report CS0179 if a method doesn't have a body
22838         and it's not marked abstract or extern.
22839         (PropertyBase): New abstract base class for Property and Indexer.
22840         (PropertyBase.CheckBase): Moved here from Property and made it work
22841         for indexers.
22842         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22843         the same so we can reuse it there.
22844         (Property, Indexer): Derive from PropertyBase.
22845         (MethodSignature.inheritable_property_signature_filter): New delegate
22846         to find properties and indexers.
22847
22848         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22849         argument and improved error reporting.
22850
22851         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22852         EmptyReadOnlyParameters and made it a property.
22853
22854         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22855         version of this method which takes a `PropertyInfo indexer'.
22856         (TypeManager.RegisterIndexer): New method.
22857
22858         * class.cs: Added myself as author of this file :-)
22859
22860 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22861
22862         * class.cs: fixed compilation on windoze.
22863
22864 2002-08-03  Martin Baulig  <martin@gnome.org>
22865
22866         * interface.cs (Interface.GetInterfaceBases): Check whether all
22867         base interfaces are at least as accessible than the current one.
22868
22869         * class.cs (TypeContainer.GetClassBases): Check whether base types
22870         are at least as accessible than the current type.
22871         (TypeContainer.AsAccessible): Implemented and made non-static.
22872         (MemberBase.CheckParameters): Report errors if the accessibility
22873         checks fail.
22874
22875         * delegate.cs (Delegate.Delegate): The default visibility is
22876         internal for top-level types and private for nested types.
22877         (Delegate.Define): Report errors if the accessibility checks fail.
22878
22879         * enum.cs (Enum.Enum): The default visibility is internal for
22880         top-level types and private for nested types.
22881         (Enum.DefineType): Compute the correct visibility.
22882
22883         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22884         function which takes a `bool is_toplevel' instead of a TypeContainer.
22885
22886         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22887         builtin type.
22888
22889 2002-08-02  Martin Baulig  <martin@gnome.org>
22890
22891         * expression.cs (LocalVariableReferenc): Added constructor which
22892         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22893         (LocalVariableReference.IsReadOnly): New property.
22894         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22895         variable is readonly, use our own readonly flag to do this; you can
22896         use the new constructor to get a writable reference to a read-only
22897         variable.
22898
22899         * cs-parser.jay (foreach_statement, using_statement): Get a writable
22900         reference to the local variable.
22901
22902 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
22903
22904         * rootcontext.cs (ResolveCore): Also include System.Exception
22905
22906         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22907         we reach an EmptyStatement.
22908
22909         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22910         is also fine.
22911
22912         * expression.cs (Binary.ResolveOperator): Check error result in
22913         two places.
22914
22915         use brtrue/brfalse directly and avoid compares to null.
22916
22917 2002-08-02  Martin Baulig  <martin@gnome.org>
22918
22919         * class.cs (TypeContainer.Define): Define all nested interfaces here.
22920         Fixes bug #28407, added test-155.cs.
22921
22922 2002-08-01  Martin Baulig  <martin@gnome.org>
22923
22924         * class.cs (Event.EmitDefaultMethod): Make this work with static
22925         events.  Fixes #28311, added verify-3.cs.
22926
22927 2002-08-01  Martin Baulig  <martin@gnome.org>
22928
22929         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22930         `is_disposable' fields.
22931         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22932         `hm.is_disposable' if we're using the collection pattern.
22933         (Foreach.EmitCollectionForeach): Use the correct type for the
22934         enumerator's local variable, only emit the try/finally block if
22935         necessary (fixes #27713).
22936
22937 2002-08-01  Martin Baulig  <martin@gnome.org>
22938
22939         * ecore.cs (Expression.report118): Renamed to Error118 and made
22940         it public static.
22941
22942         * statement.cs (Throw.Resolve): Check whether the expression is of
22943         the correct type (CS0118) and whether the type derives from
22944         System.Exception (CS0155).
22945         (Catch.Resolve): New method.  Do the type lookup here and check
22946         whether it derives from System.Exception (CS0155).
22947         (Catch.CatchType, Catch.IsGeneral): New public properties.
22948
22949         * typemanager.cs (TypeManager.exception_type): Added.
22950
22951 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
22952
22953         * driver.cs: Updated About function.
22954
22955 2002-07-31  Martin Baulig  <martin@gnome.org>
22956
22957         Implemented Control Flow Analysis.
22958
22959         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22960         (EmitContext.CurrentBranching): Added.
22961         (EmitContext.StartFlowBranching): Added.
22962         (EmitContext.EndFlowBranching): Added.
22963         (EmitContext.KillFlowBranching): Added.
22964         (EmitContext.IsVariableAssigned): Added.
22965         (EmitContext.SetVariableAssigned): Added.
22966         (EmitContext.IsParameterAssigned): Added.
22967         (EmitContext.SetParameterAssigned): Added.
22968         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22969         Added control flow analysis stuff here.
22970
22971         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22972         resolve the expression as lvalue.
22973         (LocalVariableReference.DoResolve): Check whether the variable has
22974         already been assigned.
22975         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22976         the parameter as assigned here.
22977         (ParameterReference.DoResolve): Check whether the parameter has already
22978         been assigned.
22979         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22980         expression as lvalue.
22981
22982         * statement.cs (FlowBranching): New class for the flow analysis code.
22983         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22984         (LabeledStatement.IsDefined): New public property.
22985         (LabeledStatement.AddUsageVector): New public method to tell flow
22986         analyis that the label may be reached via a forward jump.
22987         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22988         flow analysis.
22989         (VariableInfo.Number): New public field.  This is used by flow analysis
22990         to number all locals of a block.
22991         (Block.CountVariables): New public property.  This is the number of
22992         local variables in this block (including the locals from all parent
22993         blocks).
22994         (Block.EmitMeta): Number all the variables.
22995
22996         * statement.cs: Added flow analysis support to all classes.
22997
22998 2002-07-31  Martin Baulig  <martin@gnome.org>
22999
23000         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23001         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23002         then use this argument.
23003
23004         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23005
23006         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23007         use this to specify /define options.
23008
23009 2002-07-29  Martin Baulig  <martin@gnome.org>
23010
23011         * statement.cs (Fixed): Moved all code that does variable lookups
23012         and resolvings from Emit to Resolve.
23013
23014         * statement.cs (For): Moved all code that does variable lookups
23015         and resolvings from Emit to Resolve.
23016
23017         * statement.cs (Using): Moved all code that does variable lookups
23018         and resolvings from Emit to Resolve.
23019
23020 2002-07-29  Martin Baulig  <martin@gnome.org>
23021
23022         * attribute.cs (Attribute.Resolve): Explicitly catch a
23023         System.NullReferenceException when creating the
23024         CustromAttributeBuilder and report a different warning message.
23025
23026 2002-07-29  Martin Baulig  <martin@gnome.org>
23027
23028         * support.cs (ParameterData.ParameterName): Added method to
23029         get the name of a parameter.
23030
23031         * typemanager.cs (TypeManager.IsValueType): New public method.
23032
23033 2002-07-29  Martin Baulig  <martin@gnome.org>
23034
23035         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23036         is a flag which specifies that it's either ref or out.
23037         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23038         the out parameter to `out Parameter.Modifier mod', also set the
23039         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23040
23041         * support.cs (InternalParameters.ParameterModifier): Distinguish
23042         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23043         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23044
23045         * expression.cs (Argument.GetParameterModifier): Distinguish
23046         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23047         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23048
23049 2002-07-29  Martin Baulig  <martin@gnome.org>
23050
23051         * expression.cs (ParameterReference.ParameterReference): Added
23052         `Location loc' argument to the constructor.
23053
23054         * cs-parser.jay: Pass location to ParameterReference.
23055
23056 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23057
23058         * statement.cs (Try): Initialize the location.
23059
23060         * cs-parser.jay: pass location to Try.
23061
23062         * expression.cs (Unary.Reduce): Change the prototype to return
23063         whether a constant fold could be performed or not.  The result is
23064         returned in an out parameters.  In the case of Indirection and
23065         AddressOf, we want to perform the full tests.
23066
23067 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23068
23069         * statement.cs (Statement.Emit): Flag dead code.
23070
23071 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23072
23073         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23074
23075 2002-07-27  Martin Baulig  <martin@gnome.org>
23076
23077         * class.cs (MethodData.Define): Put back call to
23078         TypeManager.AddMethod(), accidentally commented this out.
23079
23080         * report.cs (Debug): New public method to print debugging information,
23081         this is `[Conditional ("DEBUG")]'.
23082
23083 2002-07-26  Martin Baulig  <martin@gnome.org>
23084
23085         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23086         (switch_statement): Push the current_block to the switch_stack and
23087         pop it again when we're done with the switch.
23088         (switch_section): The new block is a child of the current_block.
23089         Fixes bug #24007, added test-152.cs.
23090
23091 2002-07-27  Martin Baulig  <martin@gnome.org>
23092
23093         * expression.cs (Invocation.EmitArguments): When calling a varargs
23094         function with only its fixed arguments, we need to pass an empty
23095         array.
23096
23097 2002-07-27  Martin Baulig  <martin@gnome.org>
23098
23099         Mono 0.13 has been released.
23100
23101 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23102
23103         * driver.cs: Rename --resource to --linkres, because that is what
23104         we do currently, we dont support --resource yet.
23105
23106         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23107
23108 2002-07-25  Martin Baulig  <martin@gnome.org>
23109
23110         * class.cs (MethodData): New public class.  This is a `method builder'
23111         class for a method or one accessor of a Property/Indexer/Event.
23112         (MethodData.GetMethodFlags): Moved here from MemberBase.
23113         (MethodData.ApplyAttributes): Likewise.
23114         (MethodData.ApplyObsoleteAttribute): Likewise.
23115         (MethodData.ApplyConditionalAttribute): Likewise.
23116         (MethodData.ApplyDllImportAttribute): Likewise.
23117         (MethodData.CheckAbstractAndExternal): Likewise.
23118         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23119         (MethodData.Emit): Formerly known as Method.Emit().
23120         (MemberBase): Moved everything which was specific to a single
23121         accessor/method to MethodData.
23122         (Method): Create a new MethodData and call Define() and Emit() on it.
23123         (Property, Indexer, Event): Create a new MethodData objects for each
23124         accessor and call Define() and Emit() on them.
23125
23126 2002-07-25  Martin Baulig  <martin@gnome.org>
23127
23128         Made MethodCore derive from MemberBase to reuse the code from there.
23129         MemberBase now also checks for attributes.
23130
23131         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23132         (MemberBase.GetMethodFlags): Moved here from class Method and marked
23133         as virtual.
23134         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23135         `CallingConventions cc' and `Attributes opt_attrs' arguments.
23136         (MemberBase.ApplyAttributes): New virtual method; applies the
23137         attributes to a method or accessor.
23138         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23139         (MemberBase.ApplyConditionalAttribute): Likewise.
23140         (MemberBase.ApplyDllImportAttribute): Likewise.
23141         (MemberBase.CheckAbstractAndExternal): Likewise.
23142         (MethodCore.ParameterTypes): This is now a property instead of a
23143         method, it's initialized from DoDefineParameters().
23144         (MethodCore.ParameterInfo): Removed the set accessor.
23145         (MethodCore.DoDefineParameters): New protected virtual method to
23146         initialize ParameterTypes and ParameterInfo.
23147         (Method.GetReturnType): We can now simply return the MemberType.
23148         (Method.GetMethodFlags): Override the MemberBase version and add
23149         the conditional flags.
23150         (Method.CheckBase): Moved some code from Define() here, call
23151         DoDefineParameters() here.
23152         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23153         here to avoid some larger code duplication.
23154         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23155         ensure that abstract and external accessors don't declare a body.
23156
23157         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23158         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23159         lookup in the attribute's parent classes, so we need to abort as soon
23160         as we found the first match.
23161         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23162         the attribute has no arguments.
23163
23164         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23165         of a Method.
23166
23167 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23168
23169         * cs-parser.jay: reverted previous patch.
23170
23171 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23172
23173         * cs-parser.jay: fixed bug #22119.
23174
23175 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23176
23177         * attribute.cs: fixed compilation. The error was:
23178         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
23179         be assigned to before control leaves the current method."
23180         [FIXME:  Filed as bug #28186: MCS must report this error.]
23181
23182 2002-07-25  Martin Baulig  <martin@gnome.org>
23183
23184         * attribute.cs (Attribute.Conditional_GetConditionName): New static
23185         method to pull the condition name ouf of a Conditional attribute.
23186         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23187         the obsolete message and error flag out of an Obsolete attribute.
23188
23189         * class.cs (Method.GetMethodFlags): New public method to get the
23190         TypeManager.MethodFlags for this method.
23191         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23192         private methods.
23193         (Method.Define): Get and apply the Obsolete and Conditional attributes;
23194         if we're overriding a virtual function, set the new private variable
23195         `parent_method'; call the new TypeManager.AddMethod().
23196
23197         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
23198         the MethodBuilder and the Method in a PtrHashtable.
23199         (TypeManager.builder_to_method): Added for this purpose.
23200         (TypeManager.MethodFlags): Added IsObsoleteError.
23201         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
23202         Obsolete and Conditional arguments in MethodBuilders.  If we discover
23203         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23204         the message from the attribute.
23205
23206 2002-07-24  Martin Baulig  <martin@gnome.org>
23207
23208         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23209         preprocessor directives, ensure that the argument to #define/#undef is
23210         exactly one identifier and that it's actually an identifier.
23211
23212         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23213         did not work ....
23214
23215 2002-07-24  Martin Baulig  <martin@gnome.org>
23216
23217         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23218         initialize it to TypeManager.object_type in the constructor.
23219         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23220         of the `hm.get_current' method if we're using the collection pattern.
23221         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23222         for the explicit conversion to make it work when we're using the collection
23223         pattern and the `Current' property has a different return type than `object'.
23224         Fixes #27713.
23225
23226 2002-07-24  Martin Baulig  <martin@gnome.org>
23227
23228         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23229         does not match, but don't report any errors.  This method is called in
23230         order for all methods in a MethodGroupExpr until a matching method is
23231         found, so we don't want to bail out if the first method doesn't match.
23232         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23233         matches, report the 123.  Fixes #28070.
23234
23235 2002-07-24  Martin Baulig  <martin@gnome.org>
23236
23237         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23238         TypeManager.TypeToCoreType() to the top of the method so the
23239         following equality checks will work.  Fixes #28107.
23240
23241 2002-07-24  Martin Baulig  <martin@gnome.org>
23242
23243         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23244         operand is of type uint, and the other operand is of type sbyte,
23245         short or int, the operands are converted to type long." -
23246         Actually do what this comment already told us.  Fixes bug #28106,
23247         added test-150.cs.
23248
23249 2002-07-24  Martin Baulig  <martin@gnome.org>
23250
23251         * class.cs (MethodBase): New abstract class.  This is now a base
23252         class for Property, Indexer and Event to avoid some code duplication
23253         in their Define() and DefineMethods() methods.
23254         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23255         generic methods for Define() and DefineMethods().
23256         (FieldBase): Derive from MemberBase, not MemberCore.
23257         (Property): Derive from MemberBase, not MemberCore.
23258         (Property.DefineMethod): Moved all the code from this method to the
23259         new MethodBase.DefineAccessor(), just call it with appropriate
23260         argumetnts.
23261         (Property.Define): Call the new Property.DoDefine(), this does some
23262         sanity checks and we don't need to duplicate the code everywhere.
23263         (Event): Derive from MemberBase, not MemberCore.
23264         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23265         accessors, this will also make them work with interface events.
23266         (Indexer): Derive from MemberBase, not MemberCore.
23267         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23268         (Indexer.Define): Use the new MethodBase functions.
23269
23270         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23271         argument to the constructor.
23272         (Interface.FindMembers): Added support for interface events.
23273         (Interface.PopluateEvent): Implemented.
23274
23275         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23276
23277 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23278
23279         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23280         but this is required to check for a method name being the same as
23281         the containing class.  
23282
23283         Handle this now.
23284
23285 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23286
23287         * interface.cs: initialize variable.
23288
23289 2002-07-23  Martin Baulig  <martin@gnome.org>
23290
23291         Implemented the IndexerName attribute in interfaces.
23292
23293         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23294         name if this is an explicit interface implementation.
23295         (Indexer.InterfaceIndexerName): New public variable.  If we're
23296         implementing an interface indexer, this is the IndexerName in that
23297         interface.  Otherwise, it's the IndexerName.
23298         (Indexer.DefineMethod): If we're implementing interface indexer,
23299         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23300         and Pending.ImplementIndexer methods.
23301         (Indexer.Define): Also define the PropertyBuilder if we're
23302         implementing an interface indexer and this is neither an explicit
23303         interface implementation nor do the IndexerName match the one in
23304         the interface.
23305
23306         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23307         If a method is defined here, then we always need to create a proxy
23308         for it.  This is used when implementing interface indexers.
23309         (Pending.IsInterfaceIndexer): New public method.
23310         (Pending.ImplementIndexer): New public method.
23311         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23312         This is used when implementing interface indexers to define a proxy
23313         if necessary.
23314         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23315         define a proxy if necessary.
23316
23317         * interface.cs (Interface.IndexerName): New public variable.
23318         (Interface.PopulateIndexer): Set the IndexerName.
23319         (Interface.DefineIndexers): New private method.  Populate all the
23320         indexers and make sure their IndexerNames match.
23321
23322         * typemanager.cs (IndexerPropertyName): Added support for interface
23323         indexers.
23324
23325 2002-07-22  Martin Baulig  <martin@gnome.org>
23326
23327         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23328         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23329         ret if HasReturnLabel.
23330         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23331         variables.
23332
23333         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23334         and set the ec.LoopBeginTryCatchLevel.
23335         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23336         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23337         the current ec.TryCatchLevel, the branch goes out of an exception
23338         block.  In this case, we need to use Leave and not Br.
23339
23340 2002-07-22  Martin Baulig  <martin@gnome.org>
23341
23342         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23343         block unless the block does not always return or it is contained in
23344         another try { ... } catch { ... } block.  Fixes bug #26506.
23345         Added verify-1.cs to the test suite.
23346
23347 2002-07-22  Martin Baulig  <martin@gnome.org>
23348
23349         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23350         then we do not always return.  Fixes bug #24985.
23351
23352 2002-07-22  Martin Baulig  <martin@gnome.org>
23353
23354         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23355         lookup on a per-class level; ie. walk up the class hierarchy until we
23356         found at least one applicable method, then choose the best among them.
23357         Fixes bug #24463 and test-29.cs.
23358
23359 2002-07-22  Martin Baulig  <martin@gnome.org>
23360
23361         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23362         return types of the methods.  The return type is not part of the
23363         signature and we must not check it to make the `new' modifier work.
23364         Fixes bug #27999, also added test-147.cs.
23365         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23366
23367         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23368         on the method's return type.
23369
23370 2002-07-21  Martin Baulig  <martin@gnome.org>
23371
23372         * assign.cs: Make this work if the rightmost source is a constant and
23373         we need to do an implicit type conversion.  Also adding a few more tests
23374         to test-38.cs which should have caught this.
23375
23376         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23377         target in the makefile for this.  The makefile.gnu is primarily intended
23378         for end-users who don't want to debug the compiler.
23379
23380 2002-07-21  Martin Baulig  <martin@gnome.org>
23381
23382         * assign.cs: Improved the Assign class so it can now handle embedded
23383         assignments (X = Y = Z = something).  As a side-effect this'll now also
23384         consume less local variables.  test-38.cs now passes with MCS, added
23385         a few new test cases to that test.
23386
23387 2002-07-20  Martin Baulig  <martin@gnome.org>
23388
23389         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23390         instructions.  Fixes bug #27977, also added test-146.cs.
23391
23392 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23393
23394         * cs-tokenizer.cs: fixed getHex ().
23395
23396 2002-07-19  Martin Baulig  <martin@gnome.org>
23397
23398         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23399         not Type.GetType() to lookup the array type.  This is needed when
23400         we're constructing an array of a user-defined type.
23401         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23402         single-dimensional arrays, but also for single-dimensial arrays of
23403         type decimal.
23404
23405 2002-07-19  Martin Baulig  <martin@gnome.org>
23406
23407         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23408         this function is called, it's not allowed to share LocalBuilders
23409         among ILGenerators.
23410
23411 2002-07-19  Martin Baulig  <martin@gnome.org>
23412
23413         * expression.cs (Argument.Resolve): Report an error 118 when trying
23414         to pass a type as argument.
23415
23416 2002-07-18  Martin Baulig  <martin@gnome.org>
23417
23418         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23419         Conv_R_Un for the signed `long' type.
23420
23421 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23424         `expr' for the temporary result, as that will fail if we do
23425         multiple resolves on the same expression.
23426
23427 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23428
23429         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23430         ec.TypeContainer for looking up aliases. 
23431
23432         * class.cs (TypeContainer): Remove LookupAlias from here.
23433
23434         * decl.cs (DeclSpace); Move here.
23435
23436 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23437
23438         * class.cs (FindMembers): Only call filter if the constructor
23439         bulider is not null.
23440
23441         Also handle delegates in `NestedTypes' now.  Now we will perform
23442         type lookups using the standard resolution process.  This also
23443         fixes a bug.
23444
23445         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23446         This uses Expressions (the limited kind that can be parsed by the
23447         tree) instead of strings.
23448
23449         * expression.cs (ComposedCast.ToString): Implement, used to flag
23450         errors since now we have to render expressions.
23451
23452         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23453         FormArrayType. 
23454
23455         * ecore.cs (SimpleName.ToString): ditto.
23456
23457         * cs-parser.jay: Instead of using strings to assemble types, use
23458         Expressions to assemble the type (using SimpleName, ComposedCast,
23459         MemberAccess).  This should fix the type lookups in declarations,
23460         because we were using a different code path for this.
23461
23462         * statement.cs (Block.Resolve): Continue processing statements
23463         even when there is an error.
23464
23465 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23466
23467         * class.cs (Event.Define): Also remove the `remove' method from
23468         the list of pending items.
23469
23470         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23471         generate more compact code. 
23472
23473 2002-07-17  Martin Baulig  <martin@gnome.org>
23474
23475         * const.cs (Const.LookupConstantValue): Add support for constant
23476         `unchecked' and `checked' expressions.
23477         Also adding test case test-140.cs for this.
23478
23479 2002-07-17  Martin Baulig  <martin@gnome.org>
23480
23481         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23482         check whether mi.ReturnType implements the IEnumerator interface; the
23483         `==' and the IsAssignableFrom() will fail in this situation.
23484
23485 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23486
23487         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23488         here too.
23489
23490 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23491
23492         * expression.cs: fixed bug #27811.
23493
23494 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23495
23496         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23497         Molaro: when we are a ref, the value already contains a pointer
23498         value, do not take the address of it.
23499
23500 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23501         * removed mb-parser.jay and mb-tokenizer.cs
23502
23503 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23504
23505         * expression.cs: check against the building corlib void type.
23506
23507 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23508
23509         * ecore.cs: fix for valuetype static readonly fields: when 
23510         initializing them, we need their address, not the address of a copy.
23511
23512 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23513
23514         * typemanager.cs: register also enum_type in corlib.
23515
23516 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23517
23518         * class.cs: allow calling this (but not base) initializers in structs.
23519
23520 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23521
23522         * ecore.cs: make sure we compare against the building base types
23523         in GetTypeSize ().
23524
23525 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23526
23527         * typemanager.cs: fix TypeToCoreType() to handle void and object
23528         (corlib gets no more typerefs after this change).
23529
23530 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23531
23532         * expression.cs (ArrayCreation.EmitArrayArguments): use
23533         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23534
23535         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23536         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23537         array indexes, the runtime actually forbids them.
23538
23539         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23540         for array arguments here.
23541
23542         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23543         instead of the default for ValueTypes.
23544
23545         (New.DoEmit): Use IsValueType instead of
23546         IsSubclassOf (value_type)
23547         (New.DoResolve): ditto.
23548         (Invocation.EmitCall): ditto.
23549
23550         * assign.cs (Assign): ditto.
23551
23552         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23553         Statements *are* currently doing part of their resolution during
23554         Emit.  
23555
23556         Expressions do always resolve during resolve, but statements are
23557         only required to propagate resolution to their children.
23558
23559 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23560
23561         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23562
23563         (LoadAssembly): Do not add the dll if it is already specified
23564
23565         (MainDriver): Add the System directory to the link path at the end,
23566         after all the other -L arguments. 
23567
23568         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23569         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23570         ldelem.u1) and using the opposite for sbytes.
23571
23572         This fixes Digger, and we can finally run it.
23573
23574         * driver.cs (UnixParseOption): Move the option parsing here.  
23575         (CSCParseOption): Implement CSC-like parsing of options.
23576
23577         We now support both modes of operation, the old Unix way, and the
23578         new CSC-like way.  This should help those who wanted to make cross
23579         platform makefiles.
23580
23581         The only thing broken is that /r:, /reference: and /lib: are not
23582         implemented, because I want to make those have the same semantics
23583         as the CSC compiler has, and kill once and for all the confussion
23584         around this.   Will be doing this tomorrow.
23585
23586         * statement.cs (Unsafe.Resolve): The state is checked during
23587         resolve, not emit, so we have to set the flags for IsUnsfe here.
23588
23589 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23590
23591         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23592         not catch the Error_ObjectRefRequired in SimpleName (as it is
23593         possible to have a class/instance variable name that later gets
23594         deambiguated), we have to check this here.      
23595
23596 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23597
23598         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23599         make static and put into Expression.
23600
23601         (Event.Define): Register the private field of the event with the 
23602         TypeManager so that GetFieldFromEvent can get at it.
23603
23604         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23605         keep track of the private field associated with an event which
23606         has no accessors.
23607
23608         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23609         private field.
23610
23611         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23612
23613 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23614
23615         * expression.cs (Binary.EmitBranchable): this routine emits the
23616         Binary expression in a branchable context.  This basically means:
23617         we need to branch somewhere, not just get the value on the stack.
23618
23619         This works together with Statement.EmitBoolExpression.
23620
23621         * statement.cs (Statement.EmitBoolExpression): Use
23622         EmitBranchable. 
23623
23624 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23625
23626         * statement.cs (For): Reduce the number of jumps in loops.
23627
23628         (For): Implement loop inversion for the For statement.
23629
23630         (Break): We can be breaking out of a Try/Catch controlled section
23631         (foreach might have an implicit try/catch clause), so we need to
23632         use Leave instead of Br.
23633
23634         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23635         now).  If the instace expression supports IMemoryLocation, we use
23636         the AddressOf method from the IMemoryLocation to extract the
23637         address instead of emitting the instance.
23638
23639         This showed up with `This', as we were emitting the instance
23640         always (Emit) instead of the Address of This.  Particularly
23641         interesting when This is a value type, as we dont want the Emit
23642         effect (which was to load the object).
23643
23644 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
23645
23646         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23647
23648         * statement.cs (Checked): Set the CheckedState during the resolve
23649         process too, as the ConvCast operations track the checked state on
23650         the resolve process, and not emit.
23651
23652         * cs-parser.jay (namespace_member_declaration): Flag that we have
23653         found a declaration when we do.  This is used to flag error 1529
23654
23655         * driver.cs: Report ok when we display the help only.
23656
23657 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
23658
23659         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23660
23661 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
23662
23663         * cs-tokenizer.cs (define): We also have to track locally the
23664         defines.  AllDefines is just used for the Conditional Attribute,
23665         but we also need the local defines for the current source code. 
23666
23667 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
23668
23669         * statement.cs (While, For, Do): These loops can exit through a
23670         Break statement, use this information to tell whether the
23671         statement is the last piece of code.
23672
23673         (Break): Flag that we break.
23674
23675         * codegen.cs (EmitContexts): New `Breaks' state variable.
23676
23677 2002-07-03  Martin Baulig  <martin@gnome.org>
23678
23679         * class.cs (TypeContainer.MethodModifiersValid): Allow override
23680         modifiers in method declarations in structs.  Otherwise, you won't
23681         be able to override things like Object.Equals().
23682
23683 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23684
23685         * class.cs (Method, Property, Indexer): Do not allow the public
23686         modifier to be used in explicit interface implementations.
23687
23688         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23689         override modifiers in method declarations in structs
23690
23691 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
23692
23693         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23694         integer or real overflow, report an error
23695
23696 2002-07-02  Martin Baulig  <martin@gnome.org>
23697
23698         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23699         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23700         to tell the runtime about our newly created System.Object and
23701         System.ValueType types.
23702
23703 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23704
23705         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23706         struct instead of Ldarg/Starg.
23707
23708 2002-07-02  Martin Baulig  <martin@gnome.org>
23709
23710         * expression.cs (Indirection.Indirection): Call
23711         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23712
23713 2002-07-02  Martin Baulig  <martin@gnome.org>
23714
23715         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23716         ValueType, call TypeManager.TypeToCoreType() on it.
23717         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23718         the OpCodes.Newarr argument.
23719
23720 2002-07-02  Martin Baulig  <martin@gnome.org>
23721
23722         * expression.cs (Invocation.EmitCall): When compiling corlib,
23723         replace all calls to the system's System.Array type to calls to
23724         the newly created one.
23725
23726         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23727         System.Array methods.
23728         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23729         from the system's System.Array type which must be replaced.
23730
23731 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23732
23733         * typemanager.cs: load unverifiable_code_ctor so we can build
23734         corlib using the correct type. Avoid using GetTypeCode() with
23735         TypeBuilders.
23736         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23737         TypeManager.object_type to allow building corlib.
23738
23739 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23740
23741         * ecore.cs: handle System.Enum separately in LoadFromPtr().
23742
23743 2002-07-01  Martin Baulig  <martin@gnome.org>
23744
23745         * class.cs: Make the last change actually work, we need to check
23746         whether `ifaces != null' to avoid a crash.
23747
23748 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23749
23750         * class.cs: when we build structs without fields that implement
23751         interfaces, we need to add the interfaces separately, since there is
23752         no API to both set the size and add the interfaces at type creation
23753         time.
23754
23755 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23756
23757         * expression.cs: the dimension arguments to the array constructors
23758         need to be converted if they are a long.
23759
23760 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23761
23762         * class.cs: don't emit ldarg.0 if there is no parent constructor
23763         (fixes showstopper for corlib).
23764
23765 2002-06-29  Martin Baulig  <martin@gnome.org>
23766
23767         MCS now compiles corlib on GNU/Linux :-)
23768
23769         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23770         ie. check for MethodImplOptions.InternalCall.
23771
23772         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23773         and TypeManager.attribute_type are null, so we must explicitly check
23774         whether parent is not null to find out whether it's an attribute type.
23775         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23776         and SetBuilder, not only if the property is neither abstract nor external.
23777         This is necessary to set the MethodImplOptions on the accessor methods.
23778         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23779         SetBuilder, see Property.Emit().
23780
23781         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23782         populate "System.Object", "System.ValueType" and "System.Attribute" since
23783         they've already been populated from BootCorlib_PopulateCoreTypes().
23784
23785 2002-06-29  Martin Baulig  <martin@gnome.org>
23786
23787         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23788         is the NullLiteral, we also need to make sure that target_type is not
23789         an enum type.   
23790
23791 2002-06-29  Martin Baulig  <martin@gnome.org>
23792
23793         * rootcontext.cs (RootContext.ResolveCore): We must initialize
23794         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23795         before calling BootstrapCorlib_ResolveDelegate ().
23796
23797 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23798
23799         * statement.cs: fixed build-breaker. All tests passed ok.
23800
23801 2002-06-27  Martin Baulig  <martin@gnome.org>
23802
23803         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23804         for System.Decimal when compiling corlib.
23805
23806 2002-06-27  Martin Baulig  <martin@gnome.org>
23807
23808         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23809         switch blocks which contain nothing but a default clause.
23810
23811 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
23812
23813        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23814
23815 2002-06-27  Martin Baulig  <martin@gnome.org>
23816
23817         * ecore.cs (PropertyExpr.PropertyExpr): Call
23818         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23819
23820         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23821         is already a TypeBuilder.
23822
23823 2002-06-27  Martin Baulig  <martin@gnome.org>
23824
23825         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23826         `target_type == TypeManager.array_type', not IsAssignableFrom() in
23827         the "from an array-type to System.Array" case.  This makes it work
23828         when compiling corlib.
23829
23830 2002-06-27  Martin Baulig  <martin@gnome.org>
23831
23832         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23833         non-static PropertyExpr, set its InstanceExpression.  This makes
23834         the `ICollection.Count' property work in System/Array.cs.
23835
23836 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
23837
23838         * driver.cs: Made error handling more consistent.  Errors now
23839         tracked by Report class, so many methods which used to return int
23840         now return void.  Main() now prints success/failure and 
23841         errors/warnings message.
23842
23843         Renamed '--probe' compiler argument to '--expect-error'.  Removed
23844         the magic number return values (123 and 124).  Now, if the
23845         expected error occurs, the compiler exits with success (exit value
23846         0).  If the compilation completes without seeing that particular
23847         error, the compiler exits with failure (exit value 1).  The
23848         makefile in mcs/errors has been changed to handle the new behaviour.
23849
23850         * report.cs: Made 'expected error' number a property and renamed
23851         it from 'Probe' to 'ExpectedError'.
23852
23853         * genericparser.cs: Removed error handling support, since it is
23854         now all done by Report class.
23855
23856         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23857         class, so parse() no longer returns an int.
23858
23859         * namespace.cs: Use Report.Error instead of GenericParser.error
23860
23861 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
23862
23863         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23864         TypeContainer.AddOperator): At the front of the list put the
23865         explicit implementations, so they get resolved/defined first. 
23866
23867 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
23868
23869         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23870         interface type is implemented by this TypeContainer.  Used during
23871         explicit interface implementation.
23872
23873         (Property.Define, Indexer.Define, Method.Define): Validate that
23874         the given interface in the explicit implementation is one of the
23875         base classes for the containing type.
23876
23877         Also if we are explicitly implementing an interface, but there is
23878         no match in the pending implementation table, report an error.
23879
23880         (Property.Define): Only define the property if we are
23881         not explicitly implementing a property from an interface.  Use the
23882         correct name also for those properties (the same CSC uses,
23883         although that is really not needed).
23884
23885         (Property.Emit): Do not emit attributes for explicitly implemented
23886         properties, as there is no TypeBuilder.
23887
23888         (Indexer.Emit): ditto.
23889
23890         Hiding then means that we do not really *implement* a pending
23891         implementation, which makes code fail.
23892
23893 2002-06-22  Martin Baulig  <martin@gnome.org>
23894
23895         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23896         the return value of Object.GetType().  [FIXME: we need to do this whenever
23897         we get a type back from the reflection library].
23898
23899 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23900
23901         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23902
23903 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
23904
23905         * attribute.cs: Return null if we can not look up the type.
23906
23907         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23908         the interface types found.
23909
23910         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23911         interface types found.
23912
23913         * typemanager.cs (GetInterfaces): Make this routine returns alll
23914         the interfaces and work around the lame differences between
23915         System.Type and System.Reflection.Emit.TypeBuilder in the results
23916         result for GetInterfaces.
23917
23918         (ExpandInterfaces): Given an array of interface types, expand and
23919         eliminate repeated ocurrences of an interface.  This expands in
23920         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23921         be IA, IB, IC.
23922
23923 2002-06-21  Martin Baulig  <martin@gnome.org>
23924
23925         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23926         on System.Enum.
23927
23928 2002-06-21  Martin Baulig  <martin@gnome.org>
23929
23930         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
23931         and called with one of the core types, return the corresponding typebuilder for
23932         that type.
23933
23934         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23935         element type.
23936
23937 2002-06-21  Martin Baulig  <martin@gnome.org>
23938
23939         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23940         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23941         (Expression.ConvertReferenceExplicit): Likewise.
23942
23943         * expression.cs (ElementAccess.DoResolve): Likewise.
23944         (ElementAccess.DoResolveLValue): Likewise.
23945
23946 2002-06-10  Martin Baulig  <martin@gnome.org>
23947
23948         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23949         add the "value" parameter to the parameter list.
23950
23951         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23952         to our caller.
23953
23954 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
23955
23956         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23957         the argument to an int, uint, long or ulong, per the spec.  Also
23958         catch negative constants in array creation.
23959
23960 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23961
23962         * class.cs: do not allow the same interface to appear twice in
23963         the definition list.
23964
23965 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23966
23967         * ecore.cs: don't use ldlen with System.Array.
23968
23969 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23970
23971         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23972
23973 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23974
23975         * modifiers.cs: produce correct field attributes for protected
23976         internal. Easy fix so miguel can work on ther harder stuff:-)
23977
23978 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
23979
23980         * pending.cs: New file.  Move the code from class.cs here.
23981         Support clearning the pending flag for all methods (when not doing
23982         explicit interface implementation).
23983
23984 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23985
23986         * rootcontext.cs: added a couple more types needed to bootstrap.
23987
23988 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
23989
23990         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23991         constructor in the type, instead of any constructor in the type
23992         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
23993         a bug in the Mono runtime when applying the params attribute). 
23994
23995 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
23996         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23997
23998 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
23999
24000         * expression.cs (Unary.ResolveOperator): Use TypeManager
24001         to resolve the type.
24002
24003 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24004
24005         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24006         attached.
24007
24008         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24009         with each member too.
24010
24011         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24012         field builders too - this takes care of the enum member case.
24013
24014 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24015
24016         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24017         address-of operator on both value types and pointers.
24018
24019 2002-06-10  Martin Baulig  <martin@gnome.org>
24020
24021         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24022         PropertyBuilder to the `property_builders' list.
24023
24024         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24025         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24026         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24027         find any indexers which are inherited from an interface.
24028
24029 2002-06-09  Martin Baulig  <martin@gnome.org>
24030
24031         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24032         the same type as the constant if necessary.  There's also a test-130.cs
24033         for this.
24034
24035         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24036
24037         * typemanager.cs (TypeManager.ChangeType): Previously known as
24038         Enum.ChangeEnumType().
24039
24040 2002-06-09  Martin Baulig  <martin@gnome.org>
24041
24042         * expression.cs (Cast.TryReduce): Added support for consts.
24043
24044 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24045
24046         * class.cs (Accessor): Hold attributes information so we can pass
24047         it along.
24048
24049         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24050         Modify to pass in attributes attached to the methods.
24051
24052         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24053
24054         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24055         to handle the Accessor kind :-)
24056
24057         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24058
24059 2002-06-08  Martin Baulig  <martin@gnome.org>
24060
24061         * expression.cs (Unary.TryReduceNegative): Added support for
24062         ULongConstants.
24063
24064 2002-06-08  Martin Baulig  <martin@gnome.org>
24065
24066         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24067         name can't be found in the `defined_names' - the caller will do a
24068         MemberLookup in this case and thus find methods in System.Enum
24069         such as Enum.IsDefined().
24070
24071 2002-06-08  Martin Baulig  <martin@gnome.org>
24072
24073         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24074         Convert.ChangeType() which works with TypeBuilder created types.
24075         (Enum.LookupEnumValue, Enum.Define): Use it here.
24076
24077         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24078         `TypeBuilder.BaseType != null' check.
24079         (TypeContainer.FindMembers): Only lookup parent members if we
24080         actually have a parent.
24081         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24082         (ConstructorInitializer.Resolve): Likewise.
24083
24084         * interface.cs (Interface.FindMembers): Added
24085         `TypeBuilder.BaseType != null' check.
24086
24087         * rootcontext.cs (RootContext.ResolveCore): Added
24088         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24089         classes_second_stage.
24090
24091         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24092         debug_type and trace_type when compiling with --nostdlib.       
24093
24094 2002-06-07  Martin Baulig  <martin@gnome.org>
24095
24096         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24097         (AddField): Set it to true when adding a non-static field.
24098         (DefineType): Use `have_nonstatic_fields' to find out whether we
24099         have non-static fields, not `Fields != null'.
24100
24101 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24102
24103         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24104         dereferencing a null on the static-field code path)
24105
24106 2002-05-30  Martin Baulig  <martin@gnome.org>
24107
24108         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24109         to take command line arguments.  Use reflection to call the new
24110         custom `Initialize' function on the symbol writer and pass it the
24111         command line arguments.
24112
24113         * driver.cs (--debug-args): New command line argument to pass command
24114         line arguments to the symbol writer.
24115
24116 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
24117
24118         * assign.cs (DoResolve): Forgot to do the implicit conversion to
24119         the target type for indexers and properties.  Thanks to Joe for
24120         catching this.
24121
24122 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
24123
24124         * typemanager.cs (MethodFlags): returns the method flags
24125         (Obsolete/ShouldIgnore) that control warning emission and whether
24126         the invocation should be made, or ignored. 
24127
24128         * expression.cs (Invocation.Emit): Remove previous hack, we should
24129         not do this on matching a base type, we should do this based on an attribute
24130
24131         Only emit calls to System.Diagnostics.Debug and
24132         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24133         on the command line.
24134
24135         * rootcontext.cs: Global settings for tracing and debugging.
24136
24137         * cs-tokenizer.cs (define): New utility function to track
24138         defines.   Set the global settings for TRACE and DEBUG if found.
24139
24140 2002-05-25  Ravi Pratap  <ravi@ximian.com>
24141
24142         * interface.cs (Populate*): Pass in the TypeContainer as well as
24143         the DeclSpace as parameters so that we can create EmitContexts and
24144         then use that to apply attributes etc.
24145
24146         (PopulateMethod, PopulateEvent, PopulateProperty)
24147         (PopulateIndexer): Apply attributes everywhere.
24148
24149         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24150         etc.
24151
24152         (ApplyAttributes): Update accordingly.
24153
24154         We now apply interface attributes for all members too.
24155
24156 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
24157
24158         * class.cs (Indexer.Define); Correctly check if we are explicit
24159         implementation (instead of checking the Name for a ".", we
24160         directly look up if the InterfaceType was specified).
24161
24162         Delay the creation of the PropertyBuilder.
24163
24164         Only create the PropertyBuilder if we are not an explicit
24165         interface implementation.   This means that explicit interface
24166         implementation members do not participate in regular function
24167         lookups, and hence fixes another major ambiguity problem in
24168         overload resolution (that was the visible effect).
24169
24170         (DefineMethod): Return whether we are doing an interface
24171         implementation. 
24172
24173         * typemanager.cs: Temporary hack until we get attributes in
24174         interfaces (Ravi is working on that) and we get IndexerName
24175         support in interfaces.
24176
24177         * interface.cs: Register the indexers as properties.
24178
24179         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24180         warning, I have verified that this is a bug in the .NET runtime
24181         (JavaScript suffers of the same problem).
24182
24183         * typemanager.cs (MemberLookup): When looking up members for
24184         interfaces, the parent of an interface is the implicit
24185         System.Object (so we succeed in searches of Object methods in an
24186         interface method invocation.  Example:  IEnumerable x;  x.ToString
24187         ()) 
24188
24189 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
24190
24191         * class.cs (Event): Events should also register if they do
24192         implement the methods that an interface requires.
24193
24194         * typemanager.cs (MemberLookup); use the new GetInterfaces
24195         method. 
24196
24197         (GetInterfaces): The code used to lookup interfaces for a type is
24198         used in more than one place, factor it here. 
24199
24200         * driver.cs: Track the errors at the bottom of the file, we kept
24201         on going.
24202
24203         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24204         instance if the method we are calling is static!
24205
24206 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
24207
24208         * attribute.cs (ApplyAttributes): Make this function filter out
24209         the IndexerName attribute (as that attribute in reality is never
24210         applied) and return the string constant for the IndexerName
24211         attribute. 
24212
24213         * class.cs (TypeContainer.Emit): Validate that all the indexers
24214         have the same IndexerName attribute, and if so, set the
24215         DefaultName attribute on the class. 
24216
24217         * typemanager.cs: The return value might contain other stuff (not
24218         only methods).  For instance, consider a method with an "Item"
24219         property and an Item method.
24220
24221         * class.cs: If there is a problem with the parameter types,
24222         return. 
24223
24224 2002-05-24  Ravi Pratap  <ravi@ximian.com>
24225
24226         * ecore.cs (ImplicitConversionExists): Wrapper function which also
24227         looks at user defined conversion after making a call to 
24228         StandardConversionExists - we need this for overload resolution.
24229
24230         * expression.cs : Update accordingly the various method calls.
24231
24232         This fixes 2 bugs filed against implicit user defined conversions 
24233
24234 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24235
24236         * statement.cs: Track the result of the assignment.
24237
24238 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24239
24240         * expression.cs (MemberAccess): Improved error reporting for
24241         inaccessible members.
24242
24243 2002-05-22  Martin Baulig  <martin@gnome.org>
24244
24245         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24246         itself with debugging support.
24247
24248 2002-05-22  Martin Baulig  <martin@gnome.org>
24249
24250         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24251         Removed, this isn't needed anymore.
24252
24253 2002-05-20  Martin Baulig  <martin@gnome.org>
24254
24255         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24256         be underlying type for an enum.
24257
24258 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24259
24260         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24261         that splits out the loading of just the core types.
24262
24263         * rootcontext.cs (ResolveCore): Split the struct resolution in
24264         two, so we can load the enumeration underlying types before any
24265         enums are used.
24266
24267         * expression.cs (Is): Bandaid until we fix properly Switch (see
24268         bug #24985 for details).
24269
24270         * typemanager.cs (ImplementsInterface): The hashtable will contain
24271         a null if there are no interfaces implemented.
24272
24273 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24274
24275         * cs-parser.jay (indexer_declarator): It is fine to have array
24276         parameters
24277
24278 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24279
24280         * typemanager.cs: (RegisterBuilder): New function used to register
24281         TypeBuilders that implement interfaces.  Since
24282         TypeBuilder.GetInterfaces (as usual) does not work with lame
24283         Reflection.Emit. 
24284         (AddUserType): register interfaces.
24285
24286         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24287         dealing with TypeBuilder.  Also, arrays are showing up as
24288         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24289         methods can not be invoked on them!
24290
24291         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24292         (ImplicitReferenceConversionExists): Split out from
24293         StandardConversionExists. 
24294
24295         * expression.cs (As): We were only implementing one of the three
24296         cases for the as operator.  We now implement them all.
24297         (Is): Implement the various other cases for Is as well.
24298
24299         * typemanager.cs (CACHE): New define used to control if we want or
24300         not the FindMembers cache.  Seems to have a negative impact on
24301         performance currently
24302
24303         (MemberLookup): Nested types have full acess to
24304         enclosing type members
24305
24306         Remove code that coped with instance/static returns for events, we
24307         now catch this in RealFindMembers.
24308
24309         (RealFindMembers): only perform static lookup if the instance
24310         lookup did not return a type or an event.  
24311
24312 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24313
24314         * assign.cs (CompoundAssign): We pass more semantic information
24315         now to Compound Assignments than we did before: now we have all
24316         the information at hand, and now we resolve the target *before* we
24317         do the expression expansion, which allows the "CacheValue" method
24318         to have the effect we intended (before, a [x] += 1 would generate
24319         two differen ArrayAccess expressions from the ElementAccess,
24320         during the resolution process).
24321
24322         (CompoundAssign.DoResolve): Resolve target and original_source here.
24323
24324 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24325
24326         * expression.cs (ArrayAccess): dropped debugging information. 
24327
24328         * typemanager.cs: Small bug fix: I was always returning i_members,
24329         instead of one of i_members or s_members (depending on which had
24330         the content).
24331
24332         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24333         method is invoked before any code generation takes place, and it
24334         is a mechanism to inform that the expression will be invoked more
24335         than once, and that the method should use temporary values to
24336         avoid having side effects
24337
24338         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24339
24340         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24341         implementation.
24342
24343         * expression.cs (Indirection, ArrayAccess): Add support for
24344         CacheTemporaries in these two bad boys. 
24345
24346         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24347         ldobj or ldind_ref.  
24348         (StoreFromPtr): Handle stobj as well.
24349
24350         * expression.cs (UnaryMutator): Share more code.
24351
24352         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24353         down: I was not tracking the Filter function as well, which
24354         was affecting the results of the cache.
24355
24356 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24357
24358         * attribute.cs: Remove the hack to handle the CharSet property on
24359         StructLayouts. 
24360
24361 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24362
24363         * attribute.cs (DoResolve): More uglyness, we now only try to
24364         resolve the attribute partially, to extract the CharSet
24365         information (only if we are a StructLayout attribute).  Otherwise 
24366
24367         (GetExtraTypeInfo): Add some code to conditionally kill in the
24368         future this.   I am more and more convinced that the .NET
24369         framework has special code to handle the attribute setting on
24370         certain elements.
24371
24372         * expression.cs (IsParamsMethodApplicable): Revert my previous
24373         foreach change here, it was wrong.
24374
24375 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24376
24377         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24378         (pp_expr): do not abort on unknown input, just return.
24379         (eval): abort if there are pending chars.
24380
24381         * attribute.cs (Attribute.Resolve): Positional parameters are
24382         optional.  Deal with that case.
24383
24384         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24385         the Ansi/Unicode/Auto information for the type.
24386
24387         (TypeContainer.DefineType): instantiate the EmitContext here, as
24388         we will be using it during the type definition (to resolve
24389         attributes) and during the emit phase.
24390
24391         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24392         to pull type information out of the attributes
24393
24394         (Attribute.Resolve): track the constructor builder, and allow for
24395         multiple invocations (structs and classes will use this).
24396
24397         * ecore.cs (MemberLookupFinal): new version with all the
24398         parameters customizable.
24399
24400         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24401         constructors.  Return if the result value is null (as the error
24402         would have been flagged already by MemberLookupFinal)
24403
24404         Do not allow instances of abstract classes or interfaces to be
24405         created.
24406
24407         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24408         We have to compare the assembly property here when dealing with
24409         FamANDAssem and Assembly access modifiers, because we might be
24410         creating an assembly from *modules* (that means that we are not
24411         getting TypeBuilders for types defined in other modules that are
24412         part of this assembly).
24413
24414         (Method.Emit): If the method is marked abstract and has a body,
24415         emit an error. 
24416
24417         (TypeContainer.DefineMembers): If both the defined member and the
24418         parent name match are methods, then do not emit any warnings: let
24419         the Method.Define routine take care of flagging warnings.  But if
24420         there is a mismatch (method overrides something else, or method is
24421         overriwritten by something, then emit warning).
24422
24423         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24424         set to null, this means `do not check for the return type on the
24425         signature'. 
24426
24427         (Method.Define): set the return type for the method signature to
24428         null, so that we get methods with the same name and parameters and
24429         different return types.  This is used to flag warning 114 (you are
24430         hiding a method, and you probably want to use the new/override
24431         keywords instead).
24432
24433         * typemanager.cs (MemberLookup): Implemented proper access
24434         control, closing a long standing set of bug reports.  The problem
24435         was that the Framework only has two bits: Public and NonPublic,
24436         and NonPublic includes private and protected methods, but we need
24437         to enforce the FamANDAssem, FamOrAssem and Family. 
24438
24439 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24440
24441         * statement.cs (GotoCase): Return true: Ammounts to giving up
24442         knowledge on whether we return or not, and letting the other case
24443         be responsible for it.
24444
24445 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24446
24447         * driver.cs: Do not load directories for each file processed, only
24448         do it if there is a pattern.
24449
24450         * ecore.cs: Report readonly assigns here as well, as we might have
24451         been resolved only by MemberAccess.
24452
24453         (SimpleName.SimpleNameResolve): Also be useful for LValue
24454         resolution.   We need this to propagate assign to local readonly variables
24455
24456         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24457         do not want to reuse potential criteria memory.
24458
24459         * class.cs (MyEventBuilder): Set reflected_type;
24460
24461         * ecore.cs (Constantify): Added support for constifying bools.
24462
24463         (RootContext.LookupType): Added a cache for values looked up in
24464         the declaration space.
24465
24466         * typemanager.cs (FindMembers): Now is a front-end to
24467         RealFindMembers, and provides a two-level hashtable-based cache to
24468         the request.  
24469
24470         15% performance improvement: from 22.5 to 19.2 seconds.
24471
24472         * expression.cs (IsParamsMethodApplicable): use foreach.
24473         (Invocation.DoResolve): ditto.
24474         (New.DoResolve): ditto.
24475         (ArrayCreation.DoResolve): ditto.
24476
24477         * ecore.cs (FindMostEncompassingType): use foreach.
24478
24479         * delegate.cs (NewDelegate.DoResolve): Use foreach
24480
24481         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24482         (RemoveMethods): use foreach.
24483
24484         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24485         nested foreach statements instead of for, and also break out of
24486         the inner loop once a match is found.
24487
24488         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24489
24490 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24491
24492         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24493         we actually unwrap the expression to allow for extra information
24494         to be extracted. 
24495
24496         * expression.cs: Use Shr_Un on unsigned operations. 
24497
24498 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24499
24500         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24501         applicable operators was not being considered correctly. This closes
24502         the bug Miguel reported.
24503
24504 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24505
24506         * attribute.cs: check that the type derives from System.Attribute
24507         and report the correct error in that case (moved the duplicate code to
24508         its own method, too).
24509
24510 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24511
24512         * attribute.cs: lookup attribute type name as the spec says: first the
24513         bare attribute name and then name + "Attribute" (nant compiles with
24514         mcs after this fix).
24515
24516 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24517
24518         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24519         Because of the way we parse things, we should try to see if a
24520         UIntConstant can fit in an integer.
24521
24522 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24523
24524         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24525         when we are in an explicit context.
24526
24527         (ConvertReferenceExplicit): When converting from Iface type S to Class
24528         T make sure the rules are implemented as an OR.
24529
24530         * parameter.cs (ParameterType): Make it a property for now although the
24531         purpose really isn't anything immediate.
24532
24533         * expression.cs (Is*Applicable): Do better checking on the parameter type
24534         of a ref/out parameter. The ones from the system assemblies are already 
24535         marked with the correct type so we don't need to do any correction.
24536
24537         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24538         the object type is standard too so include that.
24539
24540 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24541
24542         * ecore.cs (StandardConversionExists): Augment with missing code:
24543         deal with IntConstant, LongConstants and Enumerations.
24544
24545         * assign.cs: Report the error, instead of failing silently
24546
24547         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24548         typecontainer that they are declared, because the
24549         typecontainer/namespace will have the list of using clauses that
24550         need to be applied.
24551
24552         Assembly Attributes were escaping the normal registration
24553         mechanism. 
24554
24555         (EmitCode): Apply attributes within an EmitContext that represents
24556         the container they were declared on.
24557
24558         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24559
24560 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24561
24562         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24563         Revamp completely - make much cleaner as we now operate only
24564         on a set of Types.
24565
24566         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24567         to implement the logic detailed in the spec more correctly.
24568
24569         (UserDefinedConversion): Update accordingly.
24570
24571 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24572
24573         * statement.cs: Return flow analysis information up.
24574
24575         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24576         and the default.
24577
24578         (token): Do not consume an extra character before calling
24579         decimal_digits.
24580
24581 2002-05-06  Piers Haken <piersh@friskit.com>
24582
24583         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24584
24585 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24586
24587         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24588         EmitContext during the instance constructor initializer
24589         resolution, to stop access to instance variables.
24590
24591         This is mandated by the spec, last paragraph of the `constructor
24592         initializers' section. 
24593
24594 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24595
24596         * cs-parser.jay, class.cs (Accessor): new class used to represent
24597         an accessor (get or set).  In the past we used `null' to represent
24598         a missing accessor.  But this is ambiguous because there was no
24599         way to tell in abstract indexers/properties if one of them was
24600         specified.
24601
24602         Now there is a way of addressing that.
24603
24604         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24605         instead of FindMembers.
24606
24607         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24608         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24609
24610         * attribute.cs: Treat indexers and properties as the same in terms
24611         of applying attributes
24612
24613         * ecore.cs (FindMostEncompassedType): Use statically initialized
24614         EmptyExpressions()s like we do elsewhere to avoid creating useless
24615         objects (and we take this out of the tight loop).
24616
24617         (GetConversionOperators): Move the code to extract the actual
24618         operators to a separate routine to clean things up.
24619
24620 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24621
24622         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24623         events are always registered FieldBuilders.
24624
24625         * class.cs (FieldBase): New class shared by Fields 
24626
24627         * delegate.cs: If we are a toplevel delegate, use our full name.
24628         If we are a nested delegate, then only use our tail name.
24629
24630 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24631
24632         * expression.cs (IsApplicable): Ensure that we add the "&" to
24633         ref/out types before comparing it with the type of the argument.
24634
24635         (IsParamsMethodApplicable): Ditto.
24636
24637         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24638         silly me ;-)
24639
24640         * delegate.cs : Handle the case when we have more than one applicable
24641         method. Flag an error only when we finish checking all.
24642
24643 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
24644
24645         * expression.cs: Add support for boolean static initializers.
24646
24647 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
24648
24649         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24650
24651         * parameter.cs (ComputeParameterTypes,
24652         ComputeAndDefineParameterTypes): Better error handling: now we
24653         clear the `types' cache if we fail during any of the type lookups.
24654         We also return the status code correctly to our caller
24655
24656         * delegate.cs: If we fail to define a delegate, abort the extra
24657         steps. 
24658
24659         * expression.cs (Binary.ResolveOperator): for
24660         operator==(object,object) and operator !=(object, object) we also
24661         have to verify that there is an implicit conversion from one to
24662         the other.
24663
24664         (ArrayAccess.DoResolve): Array Access can operate on
24665         non-variables. 
24666
24667 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
24668
24669         * assign.cs (CompoundAssign): A new class used as a "flag" that
24670         the assignment actually is happening as part of a compound
24671         assignment operator.
24672
24673         During compound assignment, a few new rules exist to enable things
24674         like:
24675
24676         byte b |= 1 + 2
24677
24678         From the spec:
24679
24680         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24681         to the type of x) if y is implicitly convertible to the type of x,
24682         and the operator is a builtin operator and the return type of the
24683         operator is explicitly convertible to the type of x. 
24684
24685         * rootcontext.cs: Reset warning level to 2.  4 catches various
24686         "interesting" features in mcs, we must clean this up at some
24687         point, but currently am trying to kill other bugs ;-)
24688
24689         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24690         in container classes as well.  
24691
24692         * expression.cs (Binary.ResolveOperator): Handle string case
24693         before anything else (as operator overloading does emit an error
24694         before doing anything else).
24695
24696         This code could go away when we move to a table driven model, but
24697         i could not come up with a good plan last night.
24698
24699 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
24700
24701         * typemanager.cs (CSharpName): reimplementation using regex.
24702         * class.cs: added null check for fields in Emit
24703         * rootcontext.cs: set warninglevel to 4
24704
24705 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
24706
24707         * typemanager.cs (CSharpName): reimplemented with Lupus
24708         suggestion.
24709
24710 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
24711
24712         * statement.cs (If): correclty implement Resolve, because we were
24713         not catching sem errors in there.  The same process is needed
24714         everywhere else. 
24715         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24716
24717
24718         (Statement.Warning_DeadCodeFound): Factorize code.
24719         (While): Report dead code here too.
24720
24721         (Statement): Added Resolve virtual method to allow
24722         for resolution split from the emit code.
24723
24724 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24725
24726         * statement.cs (EmitBoolExpression): No longer try to resolve the
24727         expression here.    
24728         (MakeBoolean): New utility function that resolve, implicitly
24729         converts to boolean and tags the expression. 
24730
24731
24732         (If, Do): Implement dead code elimination.
24733         (While): Implement loop inversion
24734
24735         (Do, While, For, If): Resolve the expression prior to calling our
24736         code generation.
24737
24738 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
24739
24740         * class.cs:
24741           - added method Report28 (warning: program has more than one entry point)
24742           - added method IsEntryPoint, implements paragraph 10.1 of the spec
24743           - modified method Method.Define, the part at the end of the method
24744
24745         * rootcontext.cs: added static public Location EntryPointLocation;
24746           
24747         * ../errors/cs0028.cs : Add test case for the above warning.              
24748
24749         * typemanager.cs:
24750           - modified method CSharpName to allow arrays of primitive type to
24751             be printed nicely (e.g. instead of System.Int32[][] it now prints
24752             int[][])
24753           - added method CSharpSignature: returns the signature of a method
24754             in string format to be used in reporting errors, warnings, etc.
24755
24756         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24757         with String.Empty.
24758
24759 2002-04-26  Ravi Pratap  <ravi@ximian.com>
24760
24761         * delegate.cs (Define): Fix extremely silly bug where I was
24762         setting the type of the 'object' parameter of the BeginInvoke
24763         method to System.IAsyncResult instead of System.Object ;-)
24764
24765 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24766
24767         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24768         here. 
24769
24770         (Constructor.Emit): return if we fail to initialize the
24771         constructor.  Another door closed!  
24772
24773         * expression.cs (New.DoResolve): Improve error message (from -6 to
24774         1501).  Use DeclaredOnly lookup to find the exact constructor.
24775
24776         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24777         loop.  This is useful.
24778
24779         * cs-parser.jay: Adjust the default parameters so that destructors
24780         have the proper signature.
24781
24782 2002-04-26  Martin Baulig  <martin@gnome.org>
24783
24784         * driver.cs (LoadAssembly): If `assembly' contains any characters
24785         which are only valid in path names and not in assembly names
24786         (currently slash, backslash and point), use Assembly.LoadFrom ()
24787         instead of Assembly.Load () on the `assembly' (before iteration
24788         over the link_paths).
24789
24790 2002-04-26  Martin Baulig  <martin@gnome.org>
24791
24792         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24793
24794 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
24795
24796         * class.cs (Property): use the new typemanager.MemberLookup
24797
24798         (TypeContainer.MemberLookup): Implement using the
24799         TypeManager.MemberLookup now. 
24800
24801         * typemanager.cs: Make MemberLookup a function of the TypeManager,
24802         and return MemberInfos, so that these can be used without an
24803         EmitContext (what we had before).
24804
24805 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
24806
24807         * expression.cs: Fix the case where the argument to params if the
24808         type of the params.  I omitted handling this before.   Fixed
24809
24810 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24811
24812         * driver.cs: Call BootCorlib_PopulateCoreType
24813
24814         * class.cs (Property.CheckBase): Check for properties only, not
24815         for all members. 
24816
24817         * interface.cs: Temporary hack: try/catch around the
24818         CustomAttributeBuilder, because I am getting an exception that I
24819         do not understand.
24820
24821         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24822         types whose definitions are required to be there (attributes are
24823         defined before standard types).
24824
24825         Compute definitions as we boot the various types, as they are used
24826         immediately (value_type class will need object_type, but if we do
24827         not initialize object_type, we will pass a null, which will let
24828         the runtime pick the System.Object from the existing corlib, which
24829         is not what we want).
24830
24831 2002-04-22  Patrik Torstensson <totte@labs2.com>
24832
24833         * cs-tokenizer.cs: fixed a number of trim() issues.
24834
24835 2002-04-22  Ravi Pratap  <ravi@ximian.com>
24836
24837         * expression.cs (Argument.Type): Ensure that we return the correct
24838         type when we have out or ref parameters [in which case we 
24839         append a "&"].
24840
24841 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24842
24843         * class.cs (Property, Indexer): Allow extern modifier in there. 
24844
24845         * typemanager.cs (InitBaseTypes): Initializes object_type and
24846         value_type, since those will be used early on during the bootstrap
24847         process to compile corlib.
24848
24849         (InitCoreTypes): Move code from here to InitBaseTypes.
24850
24851 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
24852
24853         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24854         single-dimension arrays as using the ldlen opcode.  
24855
24856         Daniel Lewis discovered this optimization.  
24857
24858         * typemanager.cs: Add signature for System.Array::get_Length
24859
24860 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24861
24862         * statement.cs: report the error when the foreach does not apply to an
24863         array nor a collection.
24864
24865 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * expression.cs: Add implicit conversions to the operator ~.
24868
24869         * constant.cs (DecimalConstant.Emit): Emit decimal value.
24870
24871         * typemanager.cs: Locate the decimal constructor.
24872
24873 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24874
24875         * attribute.cs: use the new property of TypeOf.
24876         * expression.cs: added 'get' property around typearg.
24877
24878         These changes fix a build breaker reported by NickD. Is this the
24879         correct way to fix?  If not, please, revert my changes and make it
24880         work :-).
24881
24882 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
24883
24884         * attribute.cs: Add support for typeof in attribute invocations.
24885         I am not sure that this is right though.
24886
24887 2002-04-14  Duncan Mak  <duncan@ximian.com>
24888
24889         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24890         Binary.Operator.Division case.
24891
24892 2002-04-13  Ravi Pratap  <ravi@ximian.com>
24893
24894         * class.cs (DefineType): Ensure that we do a proper check on
24895         attribute types and also register it with the TypeManager.
24896
24897         (TypeContainer.Targets): The default for attribute types is
24898         AttributeTargets.All.
24899
24900         * attribute.cs (ApplyAttributes): Registering the attribute type
24901         is done elsewhere, not when we discover we have a Usage attribute.
24902
24903 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24904
24905         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24906         and get rid of is_delegate parameter.
24907
24908         * everywhere : update.
24909
24910 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24911
24912         * cs-parser.jay (compilation_unit): Revamp completely to use
24913         some new ideas that I got from Rhys' grammar to solve the problems
24914         with assembly level attributes.
24915
24916         (outer_declaration): New grammar production.
24917
24918         (attribute_sections): Add.
24919
24920         (opt_attributes): Base on attribute_sections
24921
24922         (namespace_declaration): Allow opt_attributes to tackle the case
24923         when we have assembly level attributes - we are clever in this
24924         regard now ;-)
24925
24926         * attribute.cs (ApplyAttributes): Do not worry about assembly 
24927         attributes in the non-global context.
24928
24929         * rootcontext.cs (AddGlobalAttributes): Go back to using this
24930         instead of SetGlobalAttributes.
24931
24932         * class.cs, rootcontext.cs : Ensure we define and generate 
24933         attribute types before anything else.
24934
24935         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24936         and flag the new error -20 for the case when the attribute type
24937         does not have valid targets specified. csc does not catch this.
24938
24939         * ../errors/errors.txt : update for error # -20
24940
24941 2002-04-11  Ravi Pratap  <ravi@ximian.com>
24942
24943         * support.cs (InternalParameters.ParameterModifier): Do some null
24944         checking and return sane values.
24945
24946         * class.cs (Method.Define): If we are a PInvoke method, ensure
24947         that we are static and extern. Report error # 601
24948
24949         * ../errors/cs0601.cs : Add test case for the above error.
24950
24951 2002-04-07  Ravi Pratap  <ravi@ximian.com>
24952
24953         * rootcontext.cs (attribute_types): We need to keep type of
24954         all attribute types separately and emit code for them first.
24955
24956         (RegisterAttribute) : Implement.
24957
24958         * class.cs (DefineType): Check if the current Type is a custom
24959         attribute type and register it accordingly.
24960
24961         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24962         adding the first attribute twice and rename to
24963
24964         (SetGlobalAttributes): this.
24965
24966         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24967         lookups.
24968
24969         * attribute.cs (ApplyAttributes): Take an additional argument telling us
24970         if we are processing global arguments. Hmm, I am unsure of this.
24971
24972 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24973
24974         * expression.cs: added static array of strings to avoid calling
24975         Enum.ToString () for Operator in Binary. Significant recover of
24976         performance.
24977
24978 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
24979
24980         * class.cs (FindMembers): Allow the Builders of the various
24981         members to be null.  If they are skip them.  This only happens
24982         during the PInvoke declaration.
24983
24984 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
24985
24986         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24987         failure, so we do not keep going afterwards.
24988
24989         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24990         wanted to pass `false' as the `is_delegate' argument.  If this is
24991         the case, why not use delegate_type == null to mean `is_delegate =
24992         false' and anything else as is_delegate = true.
24993
24994 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
24995
24996         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24997         code for the section, not the beginning of the tests.
24998
24999 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25000
25001         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25002
25003         * expression.cs (Binary): same.  Warn about errors where we have
25004         Enum/Enum in operator + as well.
25005
25006 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25007
25008         * statement.cs:
25009                 - added support for switch(bool)
25010                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25011                 - add TableSwitchEmit() to handle table-based switch statements
25012
25013 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25014
25015         * expression.cs (Invocation.OverloadResolve): Factor out code which
25016         does parameter compatibility checking with arguments so that we can 
25017         re-use the code even from Delegate.VerifyApplicability
25018
25019         (VerifyArgumentsCompat): Move above code here.
25020
25021         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25022         and instead make a call to the above method.
25023
25024 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25025
25026         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25027         We use it to keep track of classes which are attribute types.
25028
25029 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25030
25031         * delegate.cs (Delegate.Define): Correctly define the types in the
25032         presence of fixed and array parameters.
25033
25034         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25035         doing FindMembers.
25036
25037         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25038         include NonPublic after the first iteration.
25039
25040         * class.cs (Indexer.CheckBase): Only check if both parents are
25041         non-null. 
25042
25043         * cs-parser.jay (accessor_body): If empty, set to null.
25044
25045         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25046         same code path here to resolve constants names that we did have in
25047         MemberAccess.DoResolve.  There is too much code duplicated here.
25048
25049 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25050
25051         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25052
25053         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25054         to MakeUnionSet.
25055
25056         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25057         tokens, numbers and strings.
25058
25059         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25060         parenthesis.
25061
25062         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25063         asyncronous parameters and the regular parameters.  
25064
25065         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25066         specify the target directory.
25067
25068         * expression.cs: (This.DoResolve): Simplify
25069         (As.Emit): Optimize, do not generate IsInst if the expression is
25070         always of the given type.
25071
25072         (Is.DoResolve): Bug fix, we were reporting both always/never for
25073         the is expression.
25074
25075         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25076         creating too many unnecessary arrays.
25077
25078 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25079
25080         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25081         fields instead of rolling our own initializer.   Takes care of all
25082         implicit conversions, and drops unnecessary static checks/argument.
25083
25084 2002-03-31  Dick Porter  <dick@ximian.com>
25085
25086         * driver.cs: use the GetDirectories() return values properly, and
25087         use "/" as path separator.
25088
25089 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25090
25091         * expression.cs (Unary): Optimize - - expr into expr.
25092         (Binary): Optimize a + (-b) into a -b.
25093
25094         * codegen.cs (CodeGen): Made all methods static.
25095
25096 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25097
25098         * rootcontext.cs: 
25099
25100         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25101         TypeBuilder property.
25102
25103         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25104         instead. 
25105
25106         * tree.cs: Removed the various RecordXXXX, and replaced with a
25107         single RecordDecl.  Removed all the accessor methods, and just
25108         left a single access point Type 
25109
25110         * enum.cs: Rename DefineEnum to DefineType.
25111
25112         * decl.cs: New abstract method `DefineType' used to unify the
25113         Defines for Enumerations, Interfaces, TypeContainers and
25114         Delegates.
25115
25116         (FindType): Moved LookupInterfaceOrClass here.  Moved the
25117         LookupBaseClasses method that used to live in class.cs and
25118         interface.cs here, and renamed to FindType.
25119
25120         * delegate.cs: Implement DefineType.  Take advantage of the
25121         refactored pattern for locating the parent builder without taking
25122         the parent_builder argument (which we know does not work if we are
25123         nested, and triggering a toplevel definition).
25124
25125 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25126
25127         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25128         accessibility of a member has changed during override and report
25129         an error if so.
25130
25131         * class.cs (Method.Define, Property.Define): Only complain on
25132         overrides if the method is private, any other accessibility is
25133         fine (and since we just checked the permission is the same, we are
25134         good to go).
25135
25136         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25137         and elif are processed always.  The other pre-processing
25138         directives are only processed if we are "taking" the path
25139
25140 2002-03-29  Martin Baulig  <martin@gnome.org>
25141
25142         * class.cs (Method.Emit): Only emit symbolic debugging info if the
25143         current location is not Null.
25144
25145         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25146         a separate method so we can profile it.
25147
25148         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25149         `span.Seconds' are just seconds, but no minutes or hours.
25150         (MainDriver): Profile the CodeGen.SaveSymbols calls.
25151
25152 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25153
25154         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25155         Remove the gratuitous set of Final:
25156
25157                                 // If an interface implementation, then we can set Final.
25158                                 if (((flags & MethodAttributes.Abstract) == 0) &&
25159                                     implementing.DeclaringType.IsInterface)
25160                                         flags |= MethodAttributes.Final;
25161
25162         I do not know what I was smoking when I used that.
25163
25164
25165         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25166         step into fixing the name resolution issues for delegates and
25167         unifying the toplevel name resolution.
25168
25169 2002-03-28  Martin Baulig  <martin@gnome.org>
25170
25171         * class.cs (Method.Emit): If we have a symbol writer, call its
25172         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25173         tell it about the current method.
25174
25175         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25176         writer that we're going to emit the first byte of IL code for a new
25177         statement (a new source line).
25178         (EmitContext.EmitTopBlock): If we have a symbol writer, call
25179         EmitContext.Mark() before emitting any code.
25180
25181         * location.cs (SymbolDocument): Return null when we're Null.
25182
25183         * statement.cs (Statement): Moved the `Location loc' variable here.
25184         (Statement.EmitBoolExpression): If we have a symbol writer, call
25185         ec.Mark() before emitting any code to tell it that we're at the
25186         beginning of a new statement.
25187         (StatementExpression): Added `Location' argument to the constructor.
25188         (Block): Added public readonly variable `StartLocation' and public
25189         variable `EndLocation'.  The latter is to be set using SetEndLocation().
25190         (Block): Added constructor which takes a start and end location.
25191         (Block.SetEndLocation): New method. This sets the end location.
25192         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25193         local variables we create.
25194         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25195         each statement and do also mark the begin and end of the block.
25196
25197         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25198         tell it the current lexer.Location, use Location.Null for the end of the
25199         block.
25200         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25201         current block, set its end location using SetEndLocation().
25202         (statement_expression): StatementExpression constructor now takes the
25203         lexer.Location as additional argument.
25204         (for_statement, declare_local_variables): Likewise.
25205         (declare_local_variables): When creating a new implicit block, use the
25206         new Block constructor and pass it the lexer.Location.
25207
25208 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25209
25210         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25211         members also on the parent interfaces recursively.
25212
25213 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
25214
25215         * report.cs: Use new formats, since Gonzalo finished the missing
25216         bits. 
25217
25218         * expression.cs (Binary.ResolveOperator): added missing operator|
25219         operator& and operator^ for bool/bool.
25220
25221         * cs-parser.jay: CheckDef now takes a Location argument that is
25222         used to report errors more precisly (instead of reporting the end
25223         of a definition, we try to track something which is a lot closer
25224         to the source of the problem).
25225
25226         * cs-tokenizer.cs: Track global token use, so we can properly flag
25227         the use of #define/#undef after the first token has been seen.
25228
25229         Also, rename the reportXXXX to Error_DescriptiveName
25230
25231         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25232         TypeContainer, so that Enum and Interface can use this too.
25233
25234         * class.cs (TypeContainer.LookupInterfaceOrClass,
25235         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25236         `builder' argument.  Typically this was used to pass the parent
25237         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25238         the definition).  
25239
25240         The problem is that a nested class could trigger the definition of
25241         a toplevel class, and the builder would be obviously wrong in that
25242         case. 
25243
25244         So we drop this argument, and we compute dynamically the
25245         TypeBuilder/ModuleBuilder (the correct information was available
25246         to us anyways from DeclSpace.Parent)
25247
25248         * interface.cs (Interface.DefineInterface): Drop builder
25249         parameter cleanup like class.cs
25250
25251         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25252         like class.cs
25253
25254         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25255         values. 
25256
25257         (Try.Emit): Propagate the returns value from the statement.
25258
25259         (Return.Emit): Even if we are leavning 
25260
25261         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25262
25263         * modifiers.cs: Fix the computation of MethodAttributes flags.
25264
25265 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25266
25267         * driver.cs: allow compilation of files that start with '/'.
25268         Add a default case when checking the argument of --target.
25269
25270 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25271
25272         * interface.cs: Implement the same search algorithm for types in
25273         the interface code.
25274
25275         * delegate.cs: Do not allow multiple definition.
25276
25277         * Recovered ChangeLog that got accidentally amputated
25278
25279         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25280
25281         * rootcontext.cs: Load manually enum to allow core classes to
25282         contain enumerations.
25283
25284         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25285         Update to new static methods in TypeManager.
25286
25287         * typemanager.cs (GetMethod, GetConstructor): Use our
25288         implementation of FindMembers to find the members, since during
25289         corlib compilation, the types are TypeBuilders and GetMethod and
25290         GetConstructor do not work.
25291
25292         Make all methods in TypeManager static.
25293
25294         (InitCodeHelpers): Split the functionality from
25295         the InitCodeTypes function.
25296
25297         * driver.cs: Call InitCodeHelpers after we have populated the
25298         types. 
25299
25300         * cs-parser.jay (delegate_declaration): we did not used to compute
25301         the delegate name correctly for void delegates.
25302
25303 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25304
25305         * rootcontext.cs (RootContext): Init the interface_resolve_order
25306         and type_container_resolve_order always.
25307
25308         (ResolveCore, BootstrapCorlib_ResolveClass,
25309         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25310         compiler when compiling with --nostdlib
25311
25312         * class.cs (TypeContainer.DefineType): Check that our parent is
25313         not null.  This test is most important when we are bootstraping
25314         the core types.
25315
25316         * codegen.cs: Split out the symbol writing code.
25317
25318 2002-03-25  Martin Baulig  <martin@gnome.org>
25319
25320         * driver.cs (-g): Made -g an alias for --debug.
25321
25322 2002-03-24  Martin Baulig  <martin@gnome.org>
25323
25324         * codegen.cs (SymbolWriter): New public variable. Returns the
25325         current symbol writer.
25326         (CodeGen): Added `bool want_debugging_support' argument to the
25327          constructor. If true, tell the ModuleBuild that we want debugging
25328         support and ask it for the ISymbolWriter.
25329         (Save): If we have a symbol writer, call it's Close() method after
25330         saving the assembly.
25331
25332         * driver.c (--debug): New command line argument to create a
25333         debugger information file.
25334
25335         * location.cs (SymbolDocument): New public property. Returns an
25336         ISymbolDocumentWriter object for the current source file or null
25337         if we don't have a symbol writer.
25338
25339 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25340
25341         * driver.cs (LoadAssembly): Correctly return when all the paths
25342         have been tried and not before.
25343
25344         * statement.cs (Switch.Emit): return the actual coverage for this
25345         statement (returns/not-returns)
25346
25347         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25348         switch of the statement if we are the last switch section.  That
25349         kills two problems: try/catch problems (we used to emit an empty
25350         nop at the end) and switch statements where all branches would
25351         return. 
25352
25353 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25354
25355         * driver.cs: Add default assemblies (the equivalent to the
25356         Microsoft CSC.RSP file)
25357
25358         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25359         also update tokens_seen and set it to false.
25360
25361         * driver.cs: Implement --recurse for Mike.
25362
25363         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25364         correctly splitting out the paths.
25365
25366 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25367
25368         * interface.cs (Interface.PopulateProperty): Instead of using
25369         `parent' as the declaration space for the set parameters, use
25370         `this' 
25371
25372         * support.cs (InternalParameters): InternalParameters constructor
25373         takes a DeclSpace instead of a TypeContainer.
25374
25375         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25376         types are being initialized, load the address of it before calling
25377         the function.  
25378
25379         (New): Provide a mechanism to disable the generation of local
25380         value type temporaries when the caller will be providing us with
25381         an address to store it.
25382
25383         (ArrayCreation.EmitDynamicInitializers): Use it.
25384
25385 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25386
25387         * expression.cs (Invocation.EmitArguments): Only probe for array
25388         property if there is more than one argument.  Sorry about that.
25389
25390         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25391         empty param arrays.
25392
25393         * class.cs (Method.LabelParameters): Fix incorrect code path that
25394         prevented the `ParamArrayAttribute' from being applied to the
25395         params attribute.
25396
25397 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25398
25399         * support.cs (ReflectionParameters): Correctly compute whether the
25400         last argument is a params array.  Fixes the problem with
25401         string.Split ('a')
25402
25403         * typemanager.cs: Make the assemblies array always be non-null
25404         (empty, but non-null)
25405
25406         * tree.cs (RecordDecl): New function that abstracts the recording
25407         of names.  This reports error 101, and provides a pointer to the
25408         previous declaration.  Fixes a crash in the compiler.
25409
25410         * cs-parser.jay (constructor_declaration): Update to new grammar,
25411         and provide a constructor_body that can be empty.
25412
25413 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25414
25415         * driver.cs: Add support for --resources.
25416
25417         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25418         Make all types for the various array helper methods be integer.
25419
25420         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25421         CheckState to ConvCast.
25422
25423         (ConvCast): Now it takes a `checked' state argument, to avoid
25424         depending on the emit context for the conversion, and just using
25425         the resolve time setting.
25426
25427         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25428         instead of Invocation.EmitArguments.  We do not emit the original
25429         arguments, instead we emit those which have been converted to
25430         unsigned int expressions.
25431
25432         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25433
25434         * codegen.cs: ditto.
25435
25436         * expression.cs (LocalVariableReference): Drop the use of the
25437         Store function that depended on the variable index.
25438
25439         * statement.cs (VariableInfo): Drop the `Idx' property from this
25440         class, as this is not taking into account the indexes for
25441         temporaries tat we generate during the execution, getting the
25442         indexes wrong.
25443
25444         * class.cs: First emit class initializers, then call the parent
25445         constructor. 
25446
25447         * expression.cs (Binary): Fix opcode emision.
25448         (UnaryMutator.EmitCode): Support checked code generation
25449
25450         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25451         matches for events for both the Static and Instance scans,
25452         pointing to the same element.   Fix that.
25453
25454 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25455
25456         * rootcontext.cs (ResolveTree): Always set the
25457         interface_resolve_order, because nested interfaces will be calling
25458         into us.
25459
25460         * class.cs (GetInterfaceOrClass): Track the same resolution
25461         process used by TypeManager.LookupType.  This fixes the nested
25462         type lookups in class declarations (separate path from
25463         LookupType). 
25464
25465         (TypeContainer.DefineType): Also define nested interfaces.
25466         (TypeContainer.RegisterOrder): New public function used to
25467         register the order in which child interfaces need to be closed.
25468
25469         Nested interfaces need to be closed after their parents have been
25470         created. 
25471
25472         * interface.cs (InterfaceAttr): Put all the logic for computing
25473         the interface attribute here. 
25474
25475         (DefineInterface): Register our interface order with the
25476         RootContext or with the TypeContainer depending on the case.
25477
25478 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25479
25480         * cs-parser.jay: rework foreach statement to work with the new
25481         changes to the policy on SimpleNames.
25482
25483         * report.cs: support Stacktrace on warnings as well.
25484
25485         * makefile: drop --unsafe and /unsafe from the compile.
25486
25487 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25488
25489         * ecore.cs (StandardConversionExists): Modify to take an Expression
25490         as the first parameter. Ensure we do null -> reference type conversion
25491         checking.
25492
25493         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25494         temporary Expression objects.
25495
25496 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25497
25498         * interface.cs: workaround bug in method overloading resolution
25499         (there is already a bugzilla bug for it).
25500
25501 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25502
25503         We could also solve this problem by having a separate path for
25504         performing type lookups, instead of DoResolve, we could have a
25505         ResolveType entry point, and only participating pieces of the
25506         production (simplename, deref, array) would implement this. 
25507
25508         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25509         signal SimpleName to only resolve type names and not attempt to
25510         resolve anything else.
25511
25512         * expression.cs (Cast): Set the flag.
25513
25514         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25515
25516         * class.cs: Only report 108 if there is no `new' modifier.
25517
25518         * cs-parser.jay: rework foreach statement to work with the new
25519         changes to the policy on SimpleNames.
25520
25521         * report.cs: support Stacktrace on warnings as well.
25522
25523         * makefile: drop --unsafe and /unsafe from the compile.
25524
25525 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25526
25527         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25528         lookups here, instead of doing that at parse time.  This means
25529         that our grammar will not introduce `LocalVariableReferences' as
25530         expressions at this point.  That solves the problem of code like
25531         this:
25532
25533         class X {
25534            static void Main ()
25535            { int X = 1;
25536             { X x = null }}}
25537
25538         This is only half the fix.  The full fix requires parameters to
25539         also be handled in this way.
25540
25541         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25542         makes the use more obvious of the DeclSpace.  The
25543         ec.TypeContainer.TypeBuilder is now only used to pull the
25544         TypeBuilder for it.
25545
25546         My theory is that I can get rid of the TypeBuilder completely from
25547         the EmitContext, and have typecasts where it is used (from
25548         DeclSpace to where it matters).  
25549
25550         The only pending problem is that the code that implements Aliases
25551         is on TypeContainer, and probably should go in DeclSpace.
25552
25553         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25554         lookups here, instead of doing that at parse time.  This means
25555         that our grammar will not introduce `LocalVariableReferences' as
25556         expressions at this point.  That solves the problem of code like
25557         this:
25558
25559         class X {
25560            static void Main ()
25561            { int X = 1;
25562             { X x = null }}}
25563
25564         This is only half the fix.  The full fix requires parameters to
25565         also be handled in this way.
25566
25567         * class.cs (Property.DefineMethod): When implementing an interface
25568         method, set newslot, when implementing an abstract method, do not
25569         set the flag (before we tried never setting it, or always setting
25570         it, which is the difference).
25571         (Indexer.DefineMethod): same.
25572         (Method.DefineMethod): same.
25573
25574         * ecore.cs: Only set the status used flag if we get back a Field.
25575
25576         * attribute.cs: Temporary hack, so Paolo can keep working.
25577
25578 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25579
25580         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25581         the unmanaged type in the case we have a MarshalAs attribute.
25582
25583         (Resolve): Handle the case when we are parsing the special MarshalAs
25584         attribute [we need to store the unmanaged type to use later]
25585
25586         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25587         MarshalAs Attribute.
25588
25589         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25590         on parameters and accordingly set the marshalling info.
25591
25592 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25593
25594         * class.cs: Optimizing slightly by removing redundant code after
25595         we switched to the `NoTypes' return value.
25596         (Property.DefineMethod): use NoTypes here too.
25597
25598         This fixes the bug I introduced in my last batch of changes.
25599
25600 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25601
25602         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25603
25604         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25605         Enums since those are types too. 
25606
25607         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25608
25609         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25610         thanks to a call during the lookup process.
25611
25612 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25613
25614         * statement.cs (Foreach): Lots of work to accomodate a particular
25615         kind of foreach statement that I had not kept in mind.  It is
25616         possible to have foreachs on classes that provide a GetEnumerator
25617         method that return objects that implement the "pattern" for using
25618         a foreach, there is no need to support GetEnumerator
25619         specifically. 
25620
25621         This is needed to compile nant.
25622
25623         * decl.cs: Only report 114 if the member is not `Finalize' and if
25624         the warning level is at least 2.
25625
25626         * class.cs: Moved the compare function from Method to
25627         MethodSignature. 
25628
25629         (MethodSignature.InheritableMemberSignatureCompare): Add new
25630         filter function that is used to extract inheritable methods from a
25631         class. 
25632
25633         (Method.Define): Use the new `inheritable_method_signature_filter'
25634         delegate
25635
25636         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25637         command. 
25638
25639 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25640
25641         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25642
25643         * cs-parser.jay: Add opt_semicolon to the interface declaration.
25644
25645         * expression.cs: Pass location information to
25646         ConvertImplicitStandard. 
25647
25648         * class.cs: Added debugging code to track return values from
25649         interfaces. 
25650
25651 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
25652
25653         * expression.cs (Is.DoResolve): If either side of the `is' is an
25654         interface, do not flag the warning.
25655
25656         * ecore.cs (ImplicitReferenceConversion): We need a separate test
25657         for interfaces
25658
25659         * report.cs: Allow for --fatal to be used with --probe.
25660
25661         * typemanager.cs (NoTypes): Move the definition for the empty Type
25662         array here. 
25663
25664         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25665         properties. 
25666         (TypeContainer.DefineProxy): New function used to proxy to parent
25667         implementations when implementing interfaces.
25668         (TypeContainer.ParentImplements): used to lookup if our parent
25669         implements a public function that is required by an interface.
25670         (TypeContainer.VerifyPendingMethods): Hook this up.
25671
25672         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25673         `modules' and `assemblies' arraylists into arrays.  We only grow
25674         these are the very early start up of the program, so this improves
25675         the speedof LookupType (nicely measured).
25676
25677         * expression.cs (MakeByteBlob): Replaced unsafe code with
25678         BitConverter, as suggested by Paolo.
25679
25680         * cfold.cs (ConstantFold.Binary): Special case: perform constant
25681         folding of string concatenation, but if either side is a string,
25682         and the other is not, then return null, and let the runtime use
25683         the concatenation on the string plus the object (using
25684         `Object.ToString'). 
25685
25686 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
25687
25688         Constant Folding has been implemented now.
25689
25690         * expression.cs (Unary.Reduce): Do not throw an exception, catch
25691         the error instead on types that are not supported in one's
25692         complement. 
25693
25694         * constant.cs (Constant and all children): New set of functions to
25695         perform implict and explicit conversions.
25696
25697         * ecore.cs (EnumConstant): Implement the new functions to perform
25698         conversion by proxying to the child expression.
25699
25700         * codegen.cs: (ConstantCheckState): Constant evaluation has its
25701         own separate setting that can not be turned off from the command
25702         line using --unchecked or --checked and is only controlled using
25703         the checked/unchecked statements and expressions.  This setting is
25704         used by the constant folder to flag errors.
25705
25706         * expression.cs (CheckedExpr, UncheckedExpr): Set the
25707         ConstantCheckState as well.   
25708
25709         During Resolve, they also have to flag the state, because the
25710         constant folder runs completely in the Resolve phase.
25711
25712         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25713         well.
25714
25715 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25716
25717         * cfold.cs: New file, this file contains the constant folder.
25718
25719         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25720         argument to track whether we are using the resulting address to
25721         load or store a value and provide better error messages. 
25722
25723         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25724         new AddressOf arguments.
25725
25726         * statement.cs (Foreach.EmitCollectionForeach): Update
25727
25728         * expression.cs (Argument.Emit): Call AddressOf with proper
25729         arguments to track usage.
25730
25731         (New.DoEmit): Call AddressOf with new arguments.
25732
25733         (Unary.Emit): Adjust AddressOf call.
25734
25735 2002-03-01  Ravi Pratap  <ravi@ximian.com>
25736
25737         * cs-parser.jay (member_access): Change the case for pre-defined types
25738         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
25739         this suggestion.
25740
25741         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25742         a method body.
25743
25744         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25745         essentially like methods and apply attributes like MethodImplOptions to them too.
25746
25747         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25748         not being null.
25749
25750         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25751         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25752         is the DeclSpace.
25753
25754         * Update code everywhere accordingly.
25755
25756         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25757
25758         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25759
25760 2002-02-28  Ravi Pratap  <ravi@ximian.com>
25761
25762         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25763         try performing lookups against those instead of jumping straight into using
25764         the 'using' clauses.
25765
25766         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25767
25768         (LookupType): Perform lookups in implicit parents too.
25769
25770         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25771         sequence as RootContext.LookupType. 
25772
25773         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
25774         the various cases of namespace lookups into this method.
25775
25776 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25777
25778         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25779         in positional arguments)
25780
25781         * class.cs (Operator): Update the AllowedModifiers to contain
25782         extern. 
25783
25784         * cs-parser.jay: Update operator declaration to allow for the
25785         operator body to be empty.
25786
25787         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25788         values. 
25789
25790 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
25791
25792         * class.cs (Method.Emit): Label parameters.
25793
25794         * driver.cs: Return 1 or 0 as the program exit code.
25795
25796 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
25797
25798         * expression.cs: Special case the `null' object when trying to
25799         auto-compute the type, as anything can be explicitly converted to
25800         that. 
25801
25802         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25803         spotting this Paolo.
25804
25805         (Expression.ImplicitNumericConversion): Perform comparissions of
25806         the type using the underlying type in the case of an enumeration
25807         rather than using the enumeration type for the compare.
25808
25809         Cope with the underlying == type case, which is not possible to
25810         catch before. 
25811
25812         (Expression.ConvertNumericExplicit): Perform comparissions of
25813         the type using the underlying type in the case of an enumeration
25814         rather than using the enumeration type for the compare.
25815
25816         * driver.cs: If the user does not supply an extension, assume .exe
25817
25818         * cs-parser.jay (if_statement): Rewrote so that we can track the
25819         location for the if statement.
25820
25821         * expression.cs (Binary.ConstantFold): Only concat strings when
25822         the operation is "+", not everything ;-)
25823
25824         * statement.cs (Statement.EmitBoolExpression): Take a location
25825         argument. 
25826         (If, While, Do): Track location.
25827
25828         * expression.cs (Binary.ResolveOperator): In the object + string
25829         case, I was missing a call to ConvertImplicit
25830
25831 2002-02-25  Ravi Pratap  <ravi@ximian.com>
25832
25833         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25834         Location arguments. Ensure we use RootContext.LookupType to do our work
25835         and not try to do a direct Type.GetType and ModuleBuilder.GetType
25836
25837         * interface.cs (PopulateMethod): Handle the type of the parameter being
25838         null gracefully.
25839
25840         * expression.cs (Invocation.BetterFunction): Handle the case when we 
25841         have a params method with no fixed arguments and a call is made with no
25842         arguments.
25843
25844 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
25845
25846         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25847         the verbatim-string-literal
25848
25849         * support.cs (InternalParameters.ParameterModifier): handle null
25850         fixed parameters.
25851         (InternalParameters.ParameterType): ditto.
25852
25853         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25854         duplicating the name of the variable parameter.
25855         (GetParameterByName): Fix bug where we were not looking up array
25856         paramters if they were the only present (thanks Paolo!).
25857         (GetParameterInfo): We only have an empty set of types if both
25858         fixed and array are set to null.
25859         (GetParameterInfo-idx): Handle FixedParameter == null
25860
25861         * cs-parser.jay: Handle the case where there is no catch
25862         statements (missing null test).
25863
25864 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
25865
25866         * driver.cs (MainDriver): Be conservative on our command line
25867         handling.
25868
25869         Catch DirectoryNotFoundException when calling GetFiles.
25870
25871         (SplitPathAndPattern): Used to split the input specification into
25872         a path and a pattern that we can feed to Directory.GetFiles.
25873
25874 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
25875
25876         * statement.cs (Fixed): Implement the last case of the Fixed
25877         statement (string handling).
25878
25879         * expression.cs (StringPtr): New class used to return a char * to
25880         a string;  Used by the Fixed statement.
25881
25882         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
25883
25884         * expression.cs (Binary.ResolveOperator): Remove redundant
25885         MemberLookup pn parent type.
25886         Optimize union call, we do not need a union if the types are the same.
25887         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25888         type.
25889
25890         Specialize the use of MemberLookup everywhere, instead of using
25891         the default settings. 
25892
25893         (StackAlloc): Implement stackalloc keyword.
25894
25895         * cs-parser.jay: Add rule to parse stackalloc.
25896
25897         * driver.cs: Handle /h, /help, /?
25898
25899         * expression.cs (MakeByteBlob): Removed the hacks we had in place
25900         before we supported unsafe code.
25901
25902         * makefile: add --unsafe to the self compilation of mcs.
25903
25904 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
25905
25906         * expression.cs (PointerArithmetic): New class that is used to
25907         perform pointer arithmetic.
25908         (Binary.Resolve): Handle pointer arithmetic
25909         Handle pointer comparission.
25910         (ArrayPtr): Utility expression class that is used to take the
25911         address of an array.
25912
25913         (ElementAccess): Implement array access for pointers
25914
25915         * statement.cs (Fixed): Implement fixed statement for arrays, we
25916         are missing one more case before we are done.
25917
25918         * expression.cs (Indirection): Implement EmitAssign and set the
25919         ExprClass to Variable.  This allows pointer dereferences to be
25920         treated as variables, and to have values assigned to them.
25921
25922         * ecore.cs (Expression.StoreFromPtr): New utility function to
25923         store values dereferencing.
25924
25925 2002-02-20  Ravi Pratap  <ravi@ximian.com>
25926
25927         * expression.cs (Binary.ResolveOperator): Ensure that we are
25928         not trying to operate on a void type - this fixes the reported
25929         bug.
25930
25931         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25932         the parent implementation is sealed.
25933
25934         * ../errors/cs0239.cs : Add.
25935
25936         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25937
25938         * typemanager.cs (unverifiable_code_type): Corresponds to 
25939         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25940         which have unsafe code in them.
25941
25942         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
25943         unsafe context.
25944
25945 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
25946
25947         * cs-tokenizer.cs: Add support for @"litreal strings"
25948
25949         Make tokenizer accept pre-processor directives
25950         on any column (remove the old C-like limitation). 
25951
25952         * rootcontext.cs (EmitCode): Emit any global attributes.
25953         (AddGlobalAttributes): Used to keep track of assembly attributes. 
25954
25955         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25956
25957         * cs-parser.jay: Add support for global attributes.  
25958
25959 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
25960
25961         * expression.cs (Indirection): New helper class.  Unary will
25962         create Indirection classes to be able to implement the
25963         IMemoryLocation interface on it.
25964
25965 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
25966
25967         * cs-parser.jay (fixed_statement): reference the right statement.
25968
25969         * statement.cs (Fixed.Emit): Finish implementing the fixed
25970         statement for the &x case.
25971
25972 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
25973
25974         * class.cs (Property.Define, Method.Define): Remove newslot when
25975         `implementing'.  
25976
25977         * modifiers.cs: My use of NewSlot when `Abstract' was set was
25978         wrong.  NewSlot should only be used if the `new' keyword is present.
25979
25980         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25981         locating our system dir.  Sorry about this.
25982
25983 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25984
25985         * driver.cs (GetSystemDir): Compute correctly the location of our
25986         system assemblies.  I was using the compiler directory instead of
25987         the library directory.
25988
25989 2002-02-13  Ravi Pratap  <ravi@ximian.com>
25990
25991         * expression.cs (BetterFunction): Put back in what Miguel commented out
25992         since it is the correct fix. The problem is elsewhere ;-)
25993
25994         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25995         parameters of the parms method are themselves compatible or not !
25996
25997         (StandardConversionExists): Fix very dangerous bug where we were forgetting
25998         to check that a class implements an interface before saying that an implicit
25999         conversion was allowed. Use ImplementsInterface to do the checking.
26000
26001 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26002
26003         * class.cs (Method.Define): Track whether we are an explicit
26004         implementation or not.  And only call DefineMethodOverride if we
26005         are an explicit implementation.
26006
26007         (Property.DefineMethod): Ditto.
26008
26009 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26010
26011         * expression.cs (BetterFunction): Catch hideous bug which was
26012          preventing us from detecting ambiguous calls due to implicit casts i.e
26013         cs0121.
26014
26015 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26016
26017         * support.cs (Pair): Remove un-needed method.  I figured why I was
26018         getting the error in cs-parser.jay, the variable in a foreach loop
26019         is readonly, and the compiler does not really treat this as a variable.
26020
26021         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26022         instead of EQUALS in grammar.  
26023
26024         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26025
26026         * expression.cs (Unary.DoResolve): Check whether the argument is
26027         managed or not.
26028
26029 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26030
26031         * support.cs: Api for Pair to set a value.  Despite the fact that
26032         the variables are public the MS C# compiler refuses to compile
26033         code that accesses the field if the variable is part of a foreach
26034         statement. 
26035
26036         * statement.cs (Fixed): Begin implementation of the fixed
26037         statement.
26038
26039         (Block.AddVariable): Return the VariableInfo on success and null
26040         on failure instead of true/false. 
26041
26042         * cs-parser.jay (foreach): Catch errors on variables already
26043         defined (we were ignoring this value before) and properly unwind
26044         the block hierarchy
26045
26046         (fixed_statement): grammar for the fixed statement.
26047
26048 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26049
26050         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26051         pointer types to be incretemented.
26052
26053         (SizeOf): Implement.
26054
26055         * cs-parser.jay (pointer_member_access): Implement
26056         expr->IDENTIFIER production.
26057
26058         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26059         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26060         on safe contexts.
26061
26062         (Unary): Implement indirection.
26063
26064         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26065         use in non-unsafe context).
26066
26067         (SimpleName.DoResolve): Check for pointers in field access on safe
26068         contexts. 
26069
26070         (Expression.LoadFromPtr): Factor the load-indirect code in this
26071         function.  This was duplicated in UnboxCast and ParameterReference
26072
26073 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26074
26075         * expression.cs (ComposedCast): report an error if a pointer cast
26076         is used in a safe region.
26077
26078         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26079         pointer type casts in unsafe context.
26080
26081         * codegen.cs (EmitContext): Set up IsUnsafe.
26082
26083         * cs-parser.jay (non_expression_type): Add productions for pointer
26084         casts. 
26085
26086         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26087         code.  We should not use force into static mode if the method is
26088         not virtual.  Fixes bug in MIS
26089
26090         * statement.cs (Do.Emit, While.Emit, For.Emit,
26091         Statement.EmitBoolExpression): Add support to Do and While to
26092         propagate infinite loop as `I do return' semantics.
26093
26094         Improve the For case to also test for boolean constants.
26095
26096         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26097         to the list of attributes we can add.
26098
26099         Remove `EmitContext' argument.
26100
26101         * class.cs (Method.Define): Apply parameter attributes.
26102         (Constructor.Define): Apply parameter attributes.
26103         (MethodCore.LabelParameters): Move here the core of labeling
26104         parameters. 
26105
26106         * support.cs (ReflectionParameters.ParameterModifier,
26107         InternalParameters.ParameterModifier): Use IsByRef on the type and
26108         only return the OUT bit for these parameters instead of in/out/ref
26109         flags.
26110
26111         This is because I miss-understood things.  The ParameterInfo.IsIn
26112         and IsOut represent whether the parameter has the [In] and [Out]
26113         attributes set.  
26114
26115 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
26116
26117         * ecore.cs (FieldExpr.Emit): Release temporaries.
26118
26119         * assign.cs (LocalTemporary.Release): new function.
26120
26121         * codegen.cs (EmitContext.GetTemporaryStorage,
26122         EmitContext.FreeTemporaryStorage): Rework the way we deal with
26123         temporary storage.  Now we can "put back" localbuilders when we
26124         are done with them
26125
26126 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
26127
26128         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26129         need to make a copy of the variable to generate verifiable code.
26130
26131 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
26132
26133         * driver.cs: Compute dynamically the system directory.
26134
26135         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26136         Slower, but more generally useful.  Used by the abstract
26137         registering implementation. 
26138
26139         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26140         the rules for the special rule on Type/instances.  First check if
26141         we have the same name, and if so, try that special static path
26142         rather than the instance path.
26143
26144 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
26145
26146         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26147         for, while and if.
26148
26149         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26150         Enum, ValueType, Delegate or Array for non-corlib compiles.
26151
26152         * cs-tokenizer.cs: Catch long identifiers (645)
26153
26154         * typemanager.cs (IndexerPropetyName): Ravi never tested this
26155         piece of code.
26156
26157         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26158         fix, we were returning too early, so we were not registering
26159         pending methods from abstract classes.
26160
26161         Do not register pending methods if the class is abstract.
26162
26163         * expression.cs (Conditional.DoResolve): Report circular implicit
26164         conversions when we neecd to compute it for conditional
26165         expressions. 
26166
26167         (Is.DoResolve): If the expression is always of the provided type,
26168         flag warning 183.  If the expression can not ever be of the
26169         provided type flag warning 184.
26170
26171         * class.cs: Catch 169 as well.
26172
26173         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26174         read. 
26175
26176 2002-01-18  Nick Drochak  <ndrochak@gol.com>
26177
26178         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
26179
26180 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
26181
26182         * interface.cs: (PopulateMethod): Check for pointers being defined
26183         only if the unsafe context is active.
26184         (PopulateProperty): ditto.
26185         (PopulateIndexer): ditto.
26186
26187         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26188         specified.  If pointers are present, make sure that they are
26189         present in an unsafe context.
26190         (Constructor, Constructor.Define): ditto.
26191         (Field, Field.Define): ditto.
26192         (Property, Property.Define): ditto.
26193         (Event, Event.Define): ditto.
26194
26195         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26196         hashtable if there are classes or structs defined.
26197
26198         * expression.cs (LocalVariableReference.DoResolve): Simplify this
26199         code, as the constant resolution moved.
26200
26201         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26202         the metadata, so we can flag error 133. 
26203
26204         * decl.cs (MemberCore.UnsafeOK): New function to test that a
26205         pointer is being declared in an unsafe context.
26206
26207 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
26208
26209         * modifiers.cs (Modifiers.Check): Require a Location argument.
26210         Report error 227 for Unsafe use.
26211
26212         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26213
26214         * statement.cs (For.Emit): If the test is null, then report that
26215         we do `return', as we wont reach anything afterwards.
26216
26217         (Switch.SwitchGoverningType): Track the expression that matched
26218         the conversion.
26219
26220         * driver.cs: Allow negative numbers as an error code to flag.
26221
26222         * cs-parser.jay: Handle 1551.
26223
26224         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26225
26226 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26227
26228         * cs-parser.jay: Report 1518 (type declaration can only contain
26229         class, struct, interface, enum or delegate)
26230
26231         (switch_label): Report 1523 (keywords `case' or `default' must
26232         preced code)
26233
26234         (opt_switch_sections): Report 1522 (empty switch)
26235
26236         * driver.cs: Report 1515 (response file specified multiple times)
26237         Report 1516 (Source file specified multiple times).
26238
26239         * expression.cs (Argument.Resolve): Signal 1510
26240
26241         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26242         access not allowed in static code)
26243
26244 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26245
26246         * typemanager.cs (IsPointerType): Utility method which we are going
26247         to need a lot.
26248
26249         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26250         the object type, so we take care of that.
26251
26252         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26253
26254         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26255         added to non-params parameters :-)
26256
26257         * typemanager.cs (CSharpName): Include 'void' type too. 
26258
26259         (void_ptr_type): Include in the set of core types.
26260
26261         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26262         duplicating code.
26263
26264         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26265         an unsafe context.
26266
26267         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26268         completely forgotten about it.
26269
26270 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26271
26272         * cs-parser.jay (pointer_type): Add. This begins our implementation
26273         of parsing rules for unsafe code.
26274
26275         (unsafe_statement): Implement.
26276
26277         (embedded_statement): Modify to include the above.
26278
26279         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26280
26281         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26282         if the current context is an unsafe one.
26283
26284         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26285         are handled differently, we need separate rules for them.
26286
26287         (local_variable_declaration): Update to use local_variable_pointer_type
26288         to allow variable declarations of unmanaged pointer types.
26289
26290         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26291         in unsafe contexts.
26292
26293         * ../errors/cs0214.cs : Add.
26294
26295 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26296
26297         * makefile: remove 'response' file when cleaning.
26298
26299 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26300
26301         * cs-parser.jay: Report 1524.
26302
26303 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26304
26305         * typemanager.cs (RegisterMethod): drop checking if we have
26306         registered this from here
26307
26308 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26309
26310         * class.cs (Method.EmitDestructor): Implement calling our base
26311         destructor. 
26312
26313         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26314         value of InFinally.
26315
26316         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26317         this routine and will wrap the call in a try/catch block.  Deal
26318         with the case.
26319
26320 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26321
26322         * ecore.cs (Expression.MemberLookup): instead of taking a
26323         parameter `same_type' that was used to tell whether we could
26324         access private members we compute our containing type from the
26325         EmitContext.
26326
26327         (FieldExpr): Added partial support for volatile fields.  This does
26328         not work for volatile fields exposed from assemblies, as I can not
26329         figure out how to extract the modreq from it.
26330
26331         Updated all the source files to use this.
26332
26333         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26334         because it is referenced by MemberLookup very often. 
26335
26336 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26337
26338         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26339         TypeBuilder.GetCustomAttributes to retrieve what we need.
26340
26341         Get rid of redundant default_member_attr_type as this is the same as
26342         default_member_type which already exists.
26343
26344         * interface.cs, attribute.cs : Update accordingly.
26345
26346 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26347
26348         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26349         work for TYpeBuilders though.  Ravi, can you please fix this?
26350
26351         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26352
26353         * expression.cs (Argument.Emit): Handle the case of ref objects
26354         being passed to ref functions;  
26355
26356         (ParameterReference.EmitLoad): Loads the content of the pointer
26357         without dereferencing.
26358
26359 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26360
26361         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26362
26363 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26364
26365         * class.cs (Indexer.DefineMethod): Incorporate the interface
26366         type in the name of the method if we are doing explicit interface
26367         implementation.
26368
26369         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26370
26371         (BetterConversion): Fix extremely trivial bug where we were referring to
26372         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26373         again !
26374
26375         * ../errors/bug16.cs : Add although we have fixed it.
26376
26377 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26378
26379         * expression.cs (BaseIndexer): Begin implementation.
26380
26381         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26382
26383         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26384         production directly to remove a shift/reduce, and implement
26385         explicit interface implementation.
26386
26387         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26388         after a floating point suffix.
26389
26390         * expression.cs (DoNumericPromotions): Improved the conversion for
26391         uint/uint.  If we have a constant, we avoid doing a typecast to a
26392         larger type.
26393
26394         * class.cs (Indexer): Implement explicit interface implementation
26395         for indexers.
26396
26397 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26398
26399         * class.cs: make the default instance constructor public and hidebysig.
26400
26401 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26402
26403         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26404         so we can call it from elsewhere.
26405
26406         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26407         we emit it internally if the class has a defined indexer; otherwise the user
26408         emits it by decorating the class definition with the DefaultMemberAttribute.
26409
26410         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26411         attribute is not used on a type which defines an indexer.
26412
26413         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26414         character when we skip whitespace.
26415
26416         * ../errors/cs0646.cs : Add.
26417
26418 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26419
26420         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26421         again. 
26422
26423         * makefile: Add practical target `mcs3.exe' which builds the third
26424         generation compiler. 
26425
26426         * expression.cs (New): Fix structures constructor calling.
26427
26428         * class.cs (Property, Method, Indexer): Emit Final flag on the
26429         method if we are an interface implementation and we are not
26430         abstract. 
26431
26432         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26433         whether this property is referencing a `base' method.
26434
26435         * expression.cs (Invocation.EmitCall): take an extra argument:
26436         is_base, this is used to determine whether the `call' or
26437         `callvirt' opcode should be used.
26438
26439
26440         * delegate.cs: update EmitCall.
26441
26442         * class.cs (Method.Define): Set NewSlot for the cases where we are
26443         not implementing an interface method.
26444
26445         (Property.Define): ditto.
26446
26447 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26448
26449         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26450         'r'.  Allows mcs to parse itself fully.
26451
26452 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26453
26454         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26455         of the number of initializers that require the InitializeArray method.
26456
26457         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26458         update the above field where necessary.
26459
26460         (MakeByteBlob): Update accordingly.
26461
26462         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26463         greater than 2.
26464
26465         (EmitDynamicInitializers): Update in accordance with the new optimization.
26466
26467         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26468         same OpCode applies.
26469
26470         * cs-parser.jay : Fix some glaring errors I introduced.
26471
26472 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26473
26474         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26475         so that we can check for name clashes there too.
26476
26477         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26478         for interface indexers.
26479
26480         * interfaces.cs (Define): Emit the default member attribute.
26481
26482         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26483         variable was being referred to while setting the value ;-)
26484
26485 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26486
26487         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26488         byte-by-byte information when we know the data is zero.
26489
26490         Make the block always a multiple of 4, because
26491         DefineInitializedData has a bug.
26492
26493         * assign.cs: Fix, we should assign from the temporary, not from
26494         the source. 
26495
26496         * expression.cs (MakeByteBlob): Fix my incorrect code.
26497
26498 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26499
26500         * typemanager.cs (EnumToUnderlying): This function is used to get
26501         the underlying type from an enumeration, because it does not
26502         always work. 
26503
26504         * constant.cs: Use the I4_S form for values between -128 and 127.
26505
26506         * statement.cs (Block.LookupLabel): Looks up a label.
26507         (Block): Drop support for labeled blocks.
26508
26509         (LabeledStatement): New kind of statement that represents a label
26510         only.
26511
26512         (Goto): Finally implement this bad boy.
26513
26514         * cs-parser.jay: Update to reflect new mechanism to implement
26515         labels.
26516
26517 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26518
26519         * codegen.cs (EmitContext.This): a codegen property that keeps the
26520         a single instance of this instead of creating many different this
26521         instances. 
26522
26523         * delegate.cs (Delegate.DoResolve): Update to use the property;
26524
26525         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26526
26527         * expression.cs (BaseAccess.DoResolve): Ditto.
26528
26529 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26530
26531         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26532         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26533
26534         (InitCoreTypes): Update accordingly.
26535
26536         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26537         so we can quickly store the state.
26538
26539         (ApplyAttributes): Set the correct implementation flags
26540         for InternalCall methods.
26541
26542 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26543
26544         * expression.cs (EmitCall): if a method is not virtual, then do
26545         not use callvirt on it.
26546
26547         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26548         user defined stuff) requires the use of stobj, which takes an
26549         address on the stack instead of an array and an index.  So emit
26550         the Ldelema operation for it.
26551
26552         (EmitStoreOpcode): Use stobj for valuetypes.
26553
26554         (UnaryMutator.EmitCode): Use the right 1 value depending on
26555         whether we are dealing with int64/uint64, float or doubles.
26556
26557         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26558         constructors that I implemented last night.
26559
26560         (Constructor.IsDefault): Fix to work properly for static
26561         constructors.
26562
26563         * cs-parser.jay (CheckDef): report method signature errors.
26564         Update error number 103 to be 132.
26565
26566         * decl.cs: New AdditionResult enumeration value: MethodExists.
26567         Although we do this check for methods later on in the semantic
26568         analysis, catching repeated default constructors is so easy that
26569         we catch these here. 
26570
26571         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26572         promotions code.
26573
26574         (ParameterReference.EmitAssign, Emit): handle
26575         bools as bytes.
26576
26577         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26578         (ArrayAccess.EmitStoreOpcode): ditto.
26579
26580         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26581
26582         * expression.cs (MakeByteBlob): Complete all the missing types
26583         (uint, short, ushort, byte, sbyte)
26584
26585         * class.cs: Only init instance field initializers on instance
26586         constructors. 
26587
26588         Rename `constructors' to instance_constructors. 
26589
26590         (TypeContainer.AddConstructor): Only add constructors to the list
26591         if it is not static.
26592
26593         Make sure that we handle default_static_constructor independently
26594         everywhere where we handle instance_constructors
26595
26596 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26597
26598         * class.cs: Do not lookup or create a base initializer for a
26599         static constructor.
26600
26601         (ConstructorInitializer.Resolve): use the proper type to lookup
26602         for constructors.
26603
26604         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26605
26606         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26607         in DeclSpace. 
26608
26609         * decl.cs: CloseType is now an virtual method, the default
26610         implementation just closes this type.
26611
26612 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26613
26614         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26615         to PreserveSig by default. Also emit HideBySig on such methods.
26616
26617         Basically, set the defaults to standard values.
26618
26619         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26620         argument, if candidate is better, it can't be worse than the best !
26621
26622         (Invocation): Re-write bits to differentiate between methods being
26623         applicable in their expanded form and their normal form - for params
26624         methods of course.
26625
26626         Get rid of use_standard everywhere as only standard conversions are allowed
26627         in overload resolution. 
26628
26629         More spec conformance.
26630
26631 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26632
26633         * driver.cs: Add --timestamp, to see where the compiler spends
26634         most of its time.
26635
26636         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26637         `this' in static code.
26638
26639         (SimpleName.DoResolve): Implement in terms of a helper function
26640         that allows static-references to be passed upstream to
26641         MemberAccess.
26642
26643         (Expression.ResolveWithSimpleName): Resolve specially simple
26644         names when called by MemberAccess to implement the special
26645         semantics. 
26646
26647         (Expression.ImplicitReferenceConversion): Handle conversions from
26648         Null to reference types before others, as Null's type is
26649         System.Object. 
26650
26651         * expression.cs (Invocation.EmitCall): Handle the special case of
26652         calling methods declared on a reference type from a ValueType
26653         (Base classes System.Object and System.Enum)
26654
26655         (MemberAccess.Resolve): Only perform lookups on Enumerations if
26656         the left hand side is a TypeExpr, not on every enumeration. 
26657
26658         (Binary.Resolve): If types are reference types, then do a cast to
26659         object on operators != and == of both arguments.
26660
26661         * typemanager.cs (FindMembers): Extract instance and static
26662         members if requested.
26663
26664         * interface.cs (PopulateProperty): Use void_type instead of null
26665         as the return type for the setter method.
26666
26667         (PopulateIndexer): ditto.
26668
26669 2001-12-27  Ravi Pratap  <ravi@ximian.com>
26670
26671         * support.cs (ReflectionParameters): Fix minor bug where we
26672         were examining the wrong parameter for the ParamArray attribute.
26673
26674         Cope with requests for the type of the parameter at position
26675         greater than the params parameter's. We now return the element
26676         type of the params array as that makes more sense.
26677
26678         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
26679         accordingly as we no longer have to extract the element type
26680         ourselves.
26681
26682         (Invocation.OverloadResolve): Update.
26683
26684 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26685
26686         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26687         against IEnumerator, test whether the return value is a descendant
26688         of the IEnumerator interface.
26689
26690         * class.cs (Indexer.Define): Use an auxiliary method to implement
26691         the other bits of the method definition.  Begin support for
26692         explicit interface implementation.
26693
26694         (Property.DefineMethod): Use TypeManager.void_type instead of null
26695         for an empty return value.
26696
26697 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
26698
26699         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26700         dealing with a FieldExpr which is composed of a FieldBuilder, in
26701         the code path we did extract the constant, but we should have
26702         obtained the underlying value to be able to cast it (otherwise we
26703         end up in an infinite loop, this is what Ravi was running into).
26704
26705         (ArrayCreation.UpdateIndices): Arrays might be empty.
26706
26707         (MemberAccess.ResolveMemberAccess): Add support for section
26708         14.5.4.1 that deals with the special case of E.I when E is a type
26709         and something else, that I can be a reference to a static member.
26710
26711         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26712         handle a particular array type to create byte blobs, it is just
26713         something we dont generate byteblobs for.
26714
26715         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26716         arguments. 
26717
26718         * location.cs (Push): remove the key from the hashtable that we
26719         are about to add.   This happens for empty files.
26720
26721         * driver.cs: Dispose files after we have parsed them.
26722
26723         (tokenize): new function that only runs the tokenizer on its
26724         input, for speed testing.
26725
26726 2001-12-26  Ravi Pratap  <ravi@ximian.com>
26727
26728         * class.cs (Event.Define): Define the private field only if there
26729         are no accessors defined.
26730
26731         * expression.cs (ResolveMemberAccess): If there is no associated
26732         field with the event, that means we have an event defined with its
26733         own accessors and we should flag error cs0070 since transforming
26734         ourselves into a field is not valid in that case.
26735
26736         * ecore.cs (SimpleName.DoResolve): Same as above.
26737
26738         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26739         and charset to sane values.
26740
26741 2001-12-25  Ravi Pratap  <ravi@ximian.com>
26742
26743         * assign.cs (DoResolve): Perform check on events only if they 
26744         are being accessed outside the declaring type.
26745
26746         * cs-parser.jay (event_declarations): Update rules to correctly
26747         set the type of the implicit parameter etc.
26748
26749         (add_accessor, remove_accessor): Set current local parameters.
26750
26751         * expression.cs (Binary): For delegate addition and subtraction,
26752         cast the return value from the method into the appropriate delegate
26753         type.
26754
26755 2001-12-24  Ravi Pratap  <ravi@ximian.com>
26756
26757         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26758         of these as the workaround is unnecessary.
26759
26760         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26761         delegate data - none of that is needed at all.
26762
26763         Re-write bits to extract the instance expression and the delegate method
26764         correctly.
26765
26766         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
26767         on delegates too.
26768
26769         * attribute.cs (ApplyAttributes): New method to take care of common tasks
26770         of attaching attributes instead of duplicating code everywhere.
26771
26772         * everywhere : Update code to do attribute emission using the above method.
26773
26774 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26775
26776         * expression.cs (IsParamsMethodApplicable): if there are not
26777         parameters, return immediately.
26778
26779         * ecore.cs: The 0 literal can be implicity converted to an enum
26780         type. 
26781
26782         (SimpleName.DoResolve): First lookup the type, then lookup the
26783         members. 
26784
26785         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26786         want to get its address.  If the InstanceExpression is not
26787         addressable, store the result in a temporary variable, then get
26788         the address of it.
26789
26790         * codegen.cs: Only display 219 errors on warning level or above. 
26791
26792         * expression.cs (ArrayAccess): Make it implement the
26793         IMemoryLocation interface.
26794
26795         (Binary.DoResolve): handle the operator == (object a, object b)
26796         and operator != (object a, object b) without incurring into a
26797         BoxedCast (because 5 != o should never be performed).
26798
26799         Handle binary enumerator operators.
26800
26801         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26802         value type, otherwise use Ldelem_ref.
26803
26804         Use precomputed names;
26805
26806         (AddressOf): Implement address of
26807
26808         * cs-parser.jay (labeled_statement): Fix recursive block
26809         addition by reworking the production.
26810
26811         * expression.cs (New.DoEmit): New has a special case:
26812                 
26813                  If we are dealing with a ValueType, we have a few
26814                  situations to deal with:
26815                 
26816                     * The target of New is a ValueType variable, that is
26817                       easy, we just pass this as the variable reference
26818                 
26819                     * The target of New is being passed as an argument,
26820                       to a boxing operation or a function that takes a
26821                       ValueType.
26822                 
26823                       In this case, we need to create a temporary variable
26824                       that is the argument of New.
26825
26826
26827 2001-12-23  Ravi Pratap  <ravi@ximian.com>
26828
26829         * rootcontext.cs (LookupType): Check that current_type is not null before
26830         going about looking at nested types.
26831
26832         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26833         not implement the IAssignMethod interface any more.
26834
26835         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26836         where we tranform them into FieldExprs if they are being resolved from within
26837         the declaring type.
26838
26839         * ecore.cs (SimpleName.DoResolve): Do the same here.
26840
26841         * assign.cs (DoResolve, Emit): Clean up code considerably. 
26842
26843         * ../errors/bug10.cs : Add.
26844
26845         * ../errors/cs0070.cs : Add.
26846
26847         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26848
26849         * assign.cs : Get rid of EventIsLocal everywhere.
26850
26851 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26852
26853         * ecore.cs (ConvertIntLiteral): finished the implementation.
26854
26855         * statement.cs (SwitchLabel): Convert the value we are using as a
26856         key before looking up the table.
26857
26858 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26859
26860         * codegen.cs (EmitTopBlock): Require a Location argument now.
26861
26862         * cs-parser.jay (constructor_declarator): We need to setup
26863         current_local_parameters before we parse the
26864         opt_constructor_initializer, to allow the variables to be bound
26865         to the constructor arguments.
26866
26867         * rootcontext.cs (LookupType): First lookup nested classes in our
26868         class and our parents before we go looking outside our class.
26869
26870         * expression.cs (ConstantFold): Extract/debox the values at the
26871         beginnning. 
26872
26873         * rootcontext.cs (EmitCode): Resolve the constants first before we
26874         resolve the types.  This is not really needed, but it helps debugging.
26875
26876         * statement.cs: report location.
26877
26878         * cs-parser.jay: pass location to throw statement.
26879
26880         * driver.cs: Small bug fix.
26881
26882         * report.cs: Updated format to be 4-zero filled digits.
26883
26884 2001-12-22  Ravi Pratap  <ravi@ximian.com>
26885
26886         * expression.cs (CheckIndices): Fix minor bug where the wrong
26887         variable was being referred to ;-)
26888
26889         (DoEmit): Do not call EmitStaticInitializers when the 
26890         underlying type is System.Object.
26891
26892 2001-12-21  Ravi Pratap  <ravi@ximian.com>
26893
26894         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26895         and do the usual workaround for SRE.
26896
26897         * class.cs (MyEventBuilder.EventType): New member to get at the type
26898         of the event, quickly.
26899
26900         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26901
26902         * assign.cs (Assign.DoResolve): Handle the case when the target
26903         is an EventExpr and perform the necessary checks.
26904
26905         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26906         interface.
26907
26908         (SimpleName.MemberStaticCheck): Include check for EventExpr.
26909
26910         (EventExpr): Set the type in the constructor itself since we 
26911         are meant to be born fully resolved.
26912
26913         (EventExpr.Define): Revert code I wrote earlier.
26914                 
26915         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26916         instance expression is null. The instance expression is a This in that case
26917         or a null, depending on whether it is a static method or not.
26918
26919         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26920         refers to more than one method.
26921
26922         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26923         and accordingly flag errors.
26924
26925 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26926
26927         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26928
26929 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26930
26931         * location.cs (ToString): Provide useful rutine.
26932
26933 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26934
26935         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26936         objects, return the actual integral boxed.
26937
26938         * statement.cs (SwitchLabel): define an ILLabel for each
26939         SwitchLabel. 
26940
26941         (Switch.CheckSwitch): If the value is a Literal, extract
26942         the underlying literal.
26943
26944         Also in the unused hashtable we had, add the SwitchLabel so we can
26945         quickly look this value up.
26946
26947         * constant.cs: Implement a bunch of new constants.  Rewrite
26948         Literal based on this.  Made changes everywhere to adapt to this.
26949
26950         * expression.cs (Expression.MakeByteBlob): Optimize routine by
26951         dereferencing array only once, and also copes with enumrations.
26952
26953         bytes are two bytes wide, not one.
26954
26955         (Cast): Perform constant conversions.
26956
26957         * ecore.cs (TryImplicitIntConversion): Return literals instead of
26958         wrappers to the literals here.
26959
26960         * expression.cs (DoNumericPromotions): long literals can converted
26961         to ulong implicity (this is taken care of elsewhere, but I was
26962         missing this spot).
26963
26964         * ecore.cs (Expression.Literalize): Make the return type Literal,
26965         to improve type checking.
26966
26967         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26968
26969 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26970
26971         * literal.cs: Revert code from ravi that checked the bounds.  The
26972         bounds are sane by the definition of the type itself. 
26973
26974         * typemanager.cs: Fix implementation of ImplementsInterface.  We
26975         need to actually look up in our parent hierarchy for interfaces
26976         implemented. 
26977
26978         * const.cs: Use the underlying type for enumerations
26979
26980         * delegate.cs: Compute the basename for the delegate creation,
26981         that should fix the delegate test case, and restore the correct
26982         Type Lookup semantics in rootcontext
26983
26984         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
26985         referencing a nested type with the Reflection API is using the "+"
26986         sign. 
26987
26988         * cs-parser.jay: Do not require EOF token at the end.
26989
26990 2001-12-20  Ravi Pratap  <ravi@ximian.com>
26991
26992         * rootcontext.cs (LookupType): Concatenate type names with
26993         a '.' instead of a '+' The test suite passes again.
26994
26995         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26996         field of the enumeration.
26997
26998         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26999         the case when the member is an EventExpr.
27000
27001         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27002         static has an associated instance expression.
27003
27004         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27005
27006         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27007
27008         * class.cs (Event.Define): Register event and perform appropriate checks
27009         for error #111.
27010
27011         We define the Add and Remove methods even if the use provides none because
27012         in that case, we provide default implementations ourselves.
27013
27014         Define a private field of the type of the event. This is done by the CSC compiler
27015         and we should be doing it too ;-)
27016
27017         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27018         More methods we use in code we generate.
27019
27020         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27021         is important.
27022
27023         (InitCoreTypes): Update accordingly for the above.
27024
27025         * class.cs (Event.Emit): Generate code for default accessors that we provide
27026
27027         (EmitDefaultMethod): Do the job in the above.
27028
27029         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27030         appropriate place.
27031
27032 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27033
27034         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27035         builders even if we were missing one.
27036
27037         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27038         pass the Basename as our class name instead of the Name.  The
27039         basename will be correctly composed for us.
27040
27041         * parameter.cs (Paramters): Now takes a Location argument.
27042
27043         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27044         make all the code call directly LookupType in RootContext and take
27045         this chance to pass the Location information everywhere.
27046
27047         * Everywhere: pass Location information.
27048
27049 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27050
27051         * class.cs (Constructor.Define): Updated way of detecting the
27052         length of the parameters.
27053
27054         (TypeContainer.DefineType): Use basename as the type name for
27055         nested types.
27056
27057         (TypeContainer.Define): Do not recursively define types here, as
27058         definition is taken care in order by the RootContext.
27059
27060         * tree.cs: Keep track of namespaces in a per-file basis.
27061
27062         * parameter.cs (Parameter.ComputeSignature): Update to use
27063         DeclSpace. 
27064
27065         (Parameters.GetSignature): ditto.
27066
27067         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27068         instead of a TypeContainer.
27069
27070         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27071         resolve names.  Because we need to be resolve in our context, not
27072         our parents.
27073
27074         * driver.cs: Implement response files.
27075
27076         * class.cs (TypeContainer.DefineType): If we are defined, do not
27077         redefine ourselves.
27078
27079         (Event.Emit): Emit the code for add/remove handlers.
27080         (Event.Define): Save the MethodBuilders for add/remove.
27081
27082         * typemanager.cs: Use pair here too.
27083
27084         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27085         DictionaryEntry requires the first argument to be non-null.  
27086
27087         (enum_declaration): Compute full name for registering the
27088         enumeration.
27089
27090         (delegate_declaration): Instead of using
27091         formal_parameter_list, use opt_formal_parameter_list as the list
27092         can be empty.
27093
27094         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27095         (EventParsing): New property that controls whether `add' and
27096         `remove' are returned as tokens or identifiers (for events);
27097
27098 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27099
27100         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27101         use MyEventBuilder only and let it wrap the real builder for us.
27102
27103         (MyEventBuilder): Revamp constructor etc.
27104
27105         Implement all operations that we perform on EventBuilder in precisely the same
27106         way here too.
27107
27108         (FindMembers): Update to use the EventBuilder member.
27109
27110         (Event.Emit): Update accordingly.
27111
27112 2001-12-18  Ravi Pratap  <ravi@ximian.com>
27113
27114         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27115         by calling the appropriate methods.
27116
27117         (GetCustomAttributes): Make stubs as they cannot possibly do anything
27118         useful.
27119
27120         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27121
27122 2001-12-17  Ravi Pratap  <ravi@ximian.com>
27123
27124         * delegate.cs (Delegate.Populate): Check that the return type
27125         and various parameters types are indeed accessible.
27126
27127         * class.cs (Constructor.Define): Same here.
27128
27129         (Field.Define): Ditto.
27130
27131         (Event.Define): Ditto.
27132
27133         (Operator.Define): Check that the underlying Method defined itself
27134         correctly - so it's MethodBuilder should not be null.
27135
27136         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27137         expression happens to be null.
27138
27139         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27140         members but as of now we don't seem to be able to do anything really useful with it.
27141
27142         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27143         not the EventBuilder.
27144
27145 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
27146
27147         * cs-tokenizer.cs: Add support for defines.
27148         Add support for #if, #elif, #else, #endif
27149
27150         (eval_var): evaluates a variable.
27151         (eval): stubbed for evaluating functions.
27152
27153         * cs-parser.jay: Pass the defines information
27154
27155         * driver.cs: Add --define command line option.
27156
27157         * decl.cs: Move MemberCore here.
27158
27159         Make it the base class for DeclSpace.  This allows us to catch and
27160         report 108 and 109 for everything now.
27161
27162         * class.cs (TypeContainer.Define): Extract all the members
27163         before populating and emit the warning 108 (new keyword required
27164         to override) instead of having each member implement this.
27165
27166         (MemberCore.Define): New abstract method, we will be using this in
27167         the warning reporting engine in Populate.
27168
27169         (Operator.Define): Adjust to new MemberCore protocol. 
27170
27171         * const.cs (Const): This does not derive from Expression, it is a
27172         temporary object we use to create fields, it is a MemberCore. 
27173
27174         * class.cs (Method.Define): Allow the entry point to be in a
27175         specific class.
27176
27177         * driver.cs: Rewrite the argument handler to clean it up a bit.
27178
27179         * rootcontext.cs: Made it just an auxiliary namespace feature by
27180         making everything static.
27181
27182         * driver.cs: Adapt code to use RootContext type name instead of
27183         instance variable.
27184
27185         * delegate.cs: Remove RootContext argument.
27186
27187         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27188         argument. 
27189
27190         * class.cs (Event.Define): The lookup can fail.
27191
27192         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
27193
27194         * expression.cs: Resolve the this instance before invoking the code.
27195
27196 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
27197
27198         * cs-parser.jay: Add a production in element_access that allows
27199         the thing to become a "type" reference.  This way we can parse
27200         things like "(string [])" as a type.
27201
27202         Note that this still does not handle the more complex rules of
27203         casts. 
27204
27205
27206         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
27207
27208         * ecore.cs: (CopyNewMethods): new utility function used to
27209         assemble the list of methods from running FindMembers.
27210
27211         (MemberLookup): Rework FindMembers so that 
27212
27213 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
27214
27215         * class.cs (TypeContainer): Remove Delegates who fail to be
27216         defined.
27217
27218         * delegate.cs (Populate): Verify that we dont get null return
27219         values.   TODO: Check for AsAccessible.
27220
27221         * cs-parser.jay: Use basename to emit error 574 (destructor should
27222         have the same name as container class), not the full name.
27223
27224         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27225         possible representation.  
27226
27227         Also implements integer type suffixes U and L.
27228
27229 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
27230
27231         * expression.cs (ArrayCreation.DoResolve): We need to do the
27232         argument resolution *always*.
27233
27234         * decl.cs: Make this hold the namespace.  Hold the root context as
27235         well.
27236         (LookupType): Move here.
27237
27238         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27239
27240         * location.cs (Row, Name): Fixed the code, it was always returning
27241         references to the first file.
27242
27243         * interface.cs: Register properties defined through interfaces.
27244
27245         * driver.cs: Add support for globbing on the command line
27246
27247         * class.cs (Field): Make it derive from MemberCore as well.
27248         (Event): ditto.
27249
27250 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27251
27252         * class.cs (Event::Define): Check that the type of the event is a delegate
27253         type else flag error #66.
27254
27255         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27256         same.
27257
27258         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27259         values of EntryPoint, CharSet etc etc.
27260
27261         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27262
27263         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27264         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27265         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27266         which needs this to do its work.
27267
27268         * ../errors/cs0066.cs : Add.
27269
27270 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27271
27272         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27273         helper functions.
27274
27275         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27276         clears out the parameters field.
27277         (MemberSignatureCompare): Cleanup
27278
27279         (MemberCore): New base class used to share code between MethodCore
27280         and Property.
27281
27282         (RegisterRequiredImplementations) BindingFlags.Public requires
27283         either BindingFlags.Instace or Static.  Use instance here.
27284
27285         (Property): Refactored code to cope better with the full spec.
27286
27287         * parameter.cs (GetParameterInfo): Return an empty array instead
27288         of null on error.
27289
27290         * class.cs (Property): Abstract or extern properties have no bodies.
27291
27292         * parameter.cs (GetParameterInfo): return a zero-sized array.
27293
27294         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27295         method modifier validation to the typecontainer so we can reuse
27296         this on properties.
27297
27298         (MethodCore.ParameterTypes): return an empty sized array of types.
27299
27300         (Property.Define): Test property modifier validity.
27301
27302         Add tests for sealed/override too.
27303
27304         (Method.Emit): abstract or extern methods have no bodies.
27305
27306 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27307
27308         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27309         thing.
27310
27311         (Method::Define, ::Emit): Modify accordingly.
27312
27313         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27314
27315         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27316
27317         * makefile: Pass in /unsafe.
27318
27319 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27320
27321         * class.cs (MakeKey): Kill routine.
27322
27323         * class.cs (TypeContainer.Define): Correctly define explicit
27324         method implementations (they require the full interface name plus
27325         the method name).
27326
27327         * typemanager.cs: Deply the PtrHashtable here and stop using the
27328         lame keys.  Things work so much better.
27329
27330         This of course broke everyone who depended on `RegisterMethod' to
27331         do the `test for existance' test.  This has to be done elsewhere.
27332
27333         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27334         the object stupid Equals method (because, that like fails all over
27335         the place).  We still do not use it.
27336
27337         * class.cs (TypeContainer.SetRequiredInterface,
27338         TypeContainer.RequireMethods): Killed these two routines and moved
27339         all the functionality to RegisterRequiredImplementations.
27340
27341         (TypeContainer.RegisterRequiredImplementations): This routine now
27342         registers all the implementations required in an array for the
27343         interfaces and abstract methods.  We use an array of structures
27344         which can be computed ahead of time to reduce memory usage and we
27345         also assume that lookups are cheap as most classes will not
27346         implement too many interfaces.
27347
27348         We also avoid creating too many MethodSignatures.
27349
27350         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27351         clear the "pending" bit if we find that there are problems with
27352         the declaration.
27353
27354         (TypeContainer.VerifyPendingMethods): Update to report errors of
27355         methods that look like implementations but are not.
27356
27357         (TypeContainer.Define): Add support for explicit interface method
27358         implementation. 
27359
27360 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27361
27362         * typemanager.cs: Keep track of the parameters here instead of
27363         being a feature of the TypeContainer.
27364
27365         * class.cs: Drop the registration of parameters here, as
27366         InterfaceMethods are also interface declarations.
27367
27368         * delegate.cs: Register methods with the TypeManager not only with
27369         the TypeContainer.  This code was buggy.
27370
27371         * interface.cs: Full registation here.
27372
27373 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27374
27375         * expression.cs: Remove reducer for binary expressions, it can not
27376         be done this way.
27377
27378         * const.cs: Put here the code that used to go into constant.cs
27379
27380         * constant.cs: Put here the code for constants, this is a new base
27381         class for Literals.
27382
27383         * literal.cs: Make Literal derive from Constant.
27384
27385 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27386
27387         * statement.cs (Return.Emit): Report error 157 if the user
27388         attempts to return from a finally block.
27389
27390         (Return.Emit): Instead of emitting a return, jump to the end of
27391         the function.
27392
27393         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27394         LocalBuilder to store the result of the function.  ReturnLabel is
27395         the target where we jump.
27396
27397
27398 2001-12-09  Radek Doulik  <rodo@ximian.com>
27399
27400         * cs-parser.jay: remember alias in current namespace
27401
27402         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27403         namespaces
27404
27405         * class.cs (LookupAlias): lookup alias in my_namespace
27406
27407         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27408         aliases hashtable
27409         (LookupAlias): lookup alias in this and if needed in parent
27410         namespaces
27411
27412 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27413
27414         * support.cs: 
27415
27416         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27417         making things static.  I need this to avoid passing the
27418         TypeContainer when calling ParameterType.
27419
27420         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27421         that did string manipulation to compute the type and then call
27422         GetType.  Use Parameter.ParameterType instead.
27423
27424         * cs-tokenizer.cs: Consume the suffix for floating values.
27425
27426         * expression.cs (ParameterReference): figure out whether this is a
27427         reference parameter or not.  Kill an extra variable by computing
27428         the arg_idx during emission.
27429
27430         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27431         function that returns whether a parameter is an out/ref value or not.
27432
27433         (Parameter.ParameterType): The type of the parameter (base,
27434         without ref/out applied).
27435
27436         (Parameter.Resolve): Perform resolution here.
27437         (Parameter.ExternalType): The full type (with ref/out applied).
27438
27439         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27440         support for expressions on the using statement.
27441
27442 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27443
27444         * statement.cs (Using.EmitLocalVariableDecls): Split the
27445         localvariable handling of the using statement.
27446
27447         (Block.EmitMeta): Keep track of variable count across blocks.  We
27448         were reusing slots on separate branches of blocks.
27449
27450         (Try.Emit): Emit the general code block, we were not emitting it. 
27451
27452         Check the type of the declaration to be an IDisposable or
27453         something that can be implicity converted to it. 
27454
27455         Emit conversions if required.
27456
27457         * ecore.cs (EmptyExpression): New utility class.
27458         (Expression.ImplicitConversionExists): New utility function.
27459
27460 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27461
27462         * statement.cs (Using): Implement.
27463
27464         * expression.cs (LocalVariableReference): Support read only variables.
27465
27466         * statement.cs: Remove the explicit emit for the Leave opcode.
27467         (VariableInfo): Add a readonly field.
27468
27469 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27470
27471         * ecore.cs (ConvCast): new class used to encapsulate the various
27472         explicit integer conversions that works in both checked and
27473         unchecked contexts.
27474
27475         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27476         properly generate the overflow opcodes.
27477
27478 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27479
27480         * statement.cs: The correct type for the EmptyExpression is the
27481         element_type, not the variable type.  Ravi pointed this out.
27482
27483 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27484
27485         * class.cs (Method::Define): Handle PInvoke methods specially
27486         by using DefinePInvokeMethod instead of the usual one.
27487
27488         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27489         above to do the task of extracting information and defining the method.
27490
27491 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27492
27493         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27494         of the condition for string type.
27495
27496         (Emit): Move that here. 
27497
27498         (ArrayCreation::CheckIndices): Keep string literals in their expression
27499         form.
27500
27501         (EmitDynamicInitializers): Handle strings appropriately.
27502
27503 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27504
27505         * codegen.cs (EmitContext): Replace multiple variables with a
27506         single pointer to the current Switch statement.
27507
27508         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27509         EmitContext.
27510
27511 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27512
27513         * statement.cs 
27514
27515         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27516         default'.
27517
27518         (Foreach.Emit): Foreach on arrays was not setting
27519         up the loop variables (for break/continue).
27520
27521         (GotoCase): Semi-implented.
27522
27523 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27524
27525         * attribute.cs (CheckAttribute): Handle system attributes by using
27526         Attribute.GetAttributes to examine information we need.
27527
27528         (GetValidPlaces): Same here.
27529
27530         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27531
27532         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27533
27534         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27535
27536         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27537
27538         (Method::Emit): Handle the case when we are a PInvoke method.
27539
27540 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27541
27542         * expression.cs: Use ResolveWithSimpleName on compound names.
27543
27544 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27545
27546         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27547         before trying to reduce it.
27548
27549         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27550
27551         * constant.cs (LookupConstantValue): Implement.
27552
27553         (EmitConstant): Use the above in emitting the constant.
27554
27555         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27556         that are user-defined by doing a LookupConstantValue on them.
27557
27558         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27559         too, like above.
27560
27561 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27562
27563         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27564
27565         (BaseAccess.DoResolve): Implement.
27566
27567         (MemberAccess.DoResolve): Split this routine into a
27568         ResolveMemberAccess routine that can be used independently
27569
27570 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27571
27572         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27573         As that share bits of the implementation.  Is returns a boolean,
27574         while As returns the Type that is being probed.
27575
27576 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27577
27578         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27579         instead of a Literal - much easier.
27580
27581         (EnumInTransit): Remove - utterly useless :-)
27582
27583         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27584
27585         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27586
27587         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27588         chain when we have no associated expression.
27589
27590 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27591
27592         * constant.cs (Define): Use Location while reporting the errror.
27593
27594         Also emit a warning when 'new' is used and there is no inherited
27595         member to hide.
27596
27597         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27598         populated.
27599
27600         (LookupEnumValue): Implement to lookup an enum member's value and define it
27601         if necessary.
27602
27603         (Populate): Re-write accordingly to use the above routine.
27604
27605 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27606
27607         * expression.cs (This): Fix prototype for DoResolveLValue to
27608         override the base class DoResolveLValue.
27609
27610         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27611         declarations) 
27612
27613         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27614         (we need to load the address of the field here).  This fixes
27615         test-22. 
27616
27617         (FieldExpr.DoResolveLValue): Call the DoResolve
27618         function to initialize the Instance expression.
27619
27620         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27621         correctly the GetEnumerator operation on a value type.
27622
27623         * cs-parser.jay: Add more simple parsing error catches.
27624
27625         * statement.cs (Switch): Add support for string switches.
27626         Handle null specially.
27627
27628         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27629
27630 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27631
27632         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27633
27634         (declare_local_constant): New helper function.
27635
27636         * statement.cs (AddConstant): Keep a separate record of constants
27637
27638         (IsConstant): Implement to determine if a variable is a constant.
27639
27640         (GetConstantExpression): Implement.
27641
27642         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27643
27644         * statement.cs (IsVariableDefined): Re-write.
27645
27646 2001-11-27  Ravi Pratap  <ravi@ximian.com>
27647
27648         * class.cs (TypeContainer::FindMembers): Look for constants
27649         in the case when we are looking for MemberTypes.Field
27650
27651         * expression.cs (MemberAccess::DoResolve): Check that in the
27652         case we are a FieldExpr and a Literal, we are not being accessed
27653         by an instance reference.
27654
27655         * cs-parser.jay (local_constant_declaration): Implement.
27656
27657         (declaration_statement): Implement for constant declarations.
27658
27659 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
27660
27661         * statement.cs (Switch): Catch double defaults.
27662
27663         (Switch): More work on the switch() statement
27664         implementation.  It works for integral values now, need to finish
27665         string support.
27666
27667
27668 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27669
27670         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27671         integer literals into other integer literals.  To be used by
27672         switch. 
27673
27674 2001-11-24  Ravi Pratap  <ravi@ximian.com>
27675
27676         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27677         some memory.
27678
27679         (EmitDynamicInitializers): Cope with the above since we extract data
27680         directly from ArrayData now.
27681
27682         (ExpectInitializers): Keep track of whether initializers are mandatory
27683         or not.
27684
27685         (Bounds): Make it a hashtable to prevent the same dimension being 
27686         recorded for every element in that dimension.
27687
27688         (EmitDynamicInitializers): Fix bug which prevented the Set array method
27689         from being found.
27690
27691         Also fix bug which was causing the indices to be emitted in the reverse
27692         order.
27693
27694 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27695
27696         * expression.cs (ArrayCreation): Implement the bits that Ravi left
27697         unfinished.  They do not work, because the underlying code is
27698         sloppy.
27699
27700 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27701
27702         * cs-parser.jay: Remove bogus fixme.
27703
27704         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27705         on Switch statement.
27706
27707 2001-11-23  Ravi Pratap  <ravi@ximian.com>
27708
27709         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27710         the same. 
27711
27712         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27713         parameter. Apparently, any expression is allowed. 
27714
27715         (ValidateInitializers): Update accordingly.
27716
27717         (CheckIndices): Fix some tricky bugs thanks to recursion.
27718
27719         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
27720         I was being completely brain-dead.
27721
27722         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27723         and re-write acordingly.
27724
27725         (DelegateInvocation): Re-write accordingly.
27726
27727         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27728
27729         (MakeByteBlob): Handle types more correctly.
27730
27731         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27732         initialization from expressions but it is incomplete because I am a complete
27733         Dodo :-|
27734
27735 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27736
27737         * statement.cs (If.Emit): Fix a bug that generated incorrect code
27738         on If.  Basically, we have to return `true' (ie, we do return to
27739         our caller) only if both branches of the if return.
27740
27741         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27742         short-circuit operators, handle them as short circuit operators. 
27743
27744         (Cast.DoResolve): Resolve type.
27745         (Cast.Cast): Take an expression as the target type.
27746
27747         * cs-parser.jay (cast_expression): Remove old hack that only
27748         allowed a limited set of types to be handled.  Now we take a
27749         unary_expression and we resolve to a type during semantic
27750         analysis.
27751
27752         Use the grammar productions from Rhys to handle casts (this is
27753         not complete like Rhys syntax yet, we fail to handle that corner
27754         case that C# has regarding (-x), but we will get there.
27755
27756 2001-11-22  Ravi Pratap  <ravi@ximian.com>
27757
27758         * class.cs (EmitFieldInitializer): Take care of the case when we have a
27759         field which is an array type.
27760
27761         * cs-parser.jay (declare_local_variables): Support array initialization too.
27762
27763         * typemanager.cs (MakeKey): Implement.
27764
27765         (everywhere): Use the above appropriately.
27766
27767         * cs-parser.jay (for_statement): Update for array initialization while
27768         declaring variables.
27769
27770         * ecore.cs : The error message was correct, it's the variable's names that
27771         were misleading ;-) Make the code more readable.
27772
27773         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27774         the correct type etc.
27775
27776         (ConvertExplicit): Handle Enum types by examining the underlying type.
27777
27778 2001-11-21  Ravi Pratap  <ravi@ximian.com>
27779
27780         * parameter.cs (GetCallingConvention): Always return
27781         CallingConventions.Standard for now.
27782
27783 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27784
27785         * expression.cs (Binary.ResolveOperator): Update the values of `l'
27786         and `r' after calling DoNumericPromotions.
27787
27788         * ecore.cs: Fix error message (the types were in the wrong order).
27789
27790         * statement.cs (Foreach.ProbeCollectionType): Need to pass
27791         BindingFlags.Instance as well 
27792
27793         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27794         implicit int literal conversion in an empty cast so that we
27795         propagate the right type upstream.
27796
27797         (UnboxCast): new class used to unbox value types.
27798         (Expression.ConvertExplicit): Add explicit type conversions done
27799         by unboxing.
27800
27801         (Expression.ImplicitNumericConversion): Oops, forgot to test for
27802         the target type before applying the implicit LongLiterals to ULong
27803         literal cast.
27804
27805 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
27806
27807         * cs-parser.jay (for_statement): Reworked the way For works: now
27808         we declare manually any variables that are introduced in
27809         for_initializer to solve the problem of having out-of-band code
27810         emition (that is what got for broken).
27811
27812         (declaration_statement): Perform the actual variable declaration
27813         that used to be done in local_variable_declaration here.
27814
27815         (local_variable_declaration): Do not declare anything, just pass
27816         the information on a DictionaryEntry
27817
27818 2001-11-20  Ravi Pratap  <ravi@ximian.com>
27819
27820         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27821         re-write of the logic to now make it recursive.
27822
27823         (UpdateIndices): Re-write accordingly.
27824
27825         Store element data in a separate ArrayData list in the above methods.
27826
27827         (MakeByteBlob): Implement to dump the array data into a byte array.
27828
27829 2001-11-19  Ravi Pratap  <ravi@ximian.com>
27830
27831         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27832         into CheckIndices.
27833
27834         * constant.cs (Define): Implement.
27835
27836         (EmitConstant): Re-write fully.
27837
27838         Pass in location info.
27839
27840         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27841         respectively.
27842
27843         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27844         DictionaryEntry since we need location info too.
27845
27846         (constant_declaration): Update accordingly.
27847
27848         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27849         code into another method : UpdateIndices.
27850
27851 2001-11-18  Ravi Pratap  <ravi@ximian.com>
27852
27853         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27854         some type checking etc.
27855
27856 2001-11-17  Ravi Pratap  <ravi@ximian.com>
27857
27858         * expression.cs (ArrayCreation::ValidateInitializers): Implement
27859         bits to provide dimension info if the user skips doing that.
27860
27861         Update second constructor to store the rank correctly.
27862
27863 2001-11-16  Ravi Pratap  <ravi@ximian.com>
27864
27865         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27866         and try to implement.
27867
27868         * ../errors/cs0150.cs : Add.
27869
27870         * ../errors/cs0178.cs : Add.
27871
27872 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
27873
27874         * statement.cs: Implement foreach on multi-dimensional arrays. 
27875
27876         * parameter.cs (Parameters.GetParameterByName): Also lookup the
27877         name of the params argument.
27878
27879         * expression.cs: Use EmitStoreOpcode to get the right opcode while
27880         initializing the array.
27881
27882         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27883         we can use this elsewhere.
27884
27885         * statement.cs: Finish implementation of foreach for single
27886         dimension arrays.
27887
27888         * cs-parser.jay: Use an out-of-band stack to pass information
27889         around, I wonder why I need this.
27890
27891         foreach_block: Make the new foreach_block the current_block.
27892
27893         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27894         function used to return a static Parameters structure.  Used for
27895         empty parameters, as those are created very frequently.
27896
27897         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27898
27899 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27900
27901         * interface.cs : Default modifier is private, not public. The
27902         make verify test passes again.
27903
27904 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27905
27906         * support.cs (ReflectionParameters): Fix logic to determine
27907         whether the last parameter is a params one. Test 9 passes again.
27908
27909         * delegate.cs (Populate): Register the builders we define with
27910         RegisterParameterForBuilder. Test 19 passes again.
27911
27912         * cs-parser.jay (property_declaration): Reference $6 instead
27913         of $$ to get at the location.
27914
27915         (indexer_declaration): Similar stuff.
27916
27917         (attribute): Ditto.
27918
27919         * class.cs (Property): Register parameters for the Get and Set methods
27920         if they exist. Test 23 passes again.
27921
27922         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27923         call to EmitArguments as we are sure there aren't any params arguments. 
27924         Test 32 passes again.
27925
27926         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27927         IndexOutOfRangeException. 
27928
27929         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27930         Test 33 now passes again.
27931
27932 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
27933
27934         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27935         broke a bunch of things.  Will have to come up with a better way
27936         of tracking locations.
27937
27938         * statement.cs: Implemented foreach for single dimension arrays.
27939
27940 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27941
27942         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27943         an error.  This removes the lookup from the critical path.
27944
27945         * cs-parser.jay: Removed use of temporary_loc, which is completely
27946         broken. 
27947
27948 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
27949
27950         * support.cs (ReflectionParameters.ParameterModifier): Report
27951         whether the argument is a PARAMS argument or not.
27952
27953         * class.cs: Set the attribute `ParamArrayAttribute' on the
27954         parameter argument.
27955
27956         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27957         and cons_param_array_attribute (ConstructorInfo for
27958         ParamArrayAttribute)., 
27959
27960         * codegen.cs: Emit the return using the `Return' statement, that
27961         way we can report the error correctly for missing return values. 
27962
27963         * class.cs (Method.Emit): Clean up.
27964
27965         * expression.cs (Argument.Resolve): Take another argument: the
27966         location where this argument is used.  Notice that this is not
27967         part of the "Argument" class as to reduce the size of the
27968         structure (we know the approximate location anyways).
27969
27970         Test if the argument is a variable-reference, if not, then
27971         complain with a 206.
27972
27973         (Argument.Emit): Emit addresses of variables.
27974
27975         (Argument.FullDesc): Simplify.
27976
27977         (Invocation.DoResolve): Update for Argument.Resolve.
27978
27979         (ElementAccess.DoResolve): ditto.
27980
27981         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27982         method should be virtual, as this method is always virtual.
27983
27984         (NewDelegate.DoResolve): Update for Argument.Resolve.
27985
27986         * class.cs (ConstructorInitializer.DoResolve): ditto.
27987
27988         * attribute.cs (Attribute.Resolve): ditto.
27989
27990 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
27991
27992         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27993
27994         * expression.cs (ParameterReference): Drop IStackStorage and implement
27995         IAssignMethod instead. 
27996
27997         (LocalVariableReference): ditto.
27998
27999         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28000         IAssignMethod instead. 
28001
28002 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28003
28004         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28005         enumerations that are used in heavily used structures derive from
28006         byte in a laughable and pathetic attempt to reduce memory usage.
28007         This is the kind of pre-optimzations that you should not do at
28008         home without adult supervision.
28009
28010         * expression.cs (UnaryMutator): New class, used to handle ++ and
28011         -- separatedly from the other unary operators.  Cleans up the
28012         code, and kills the ExpressionStatement dependency in Unary.
28013
28014         (Unary): Removed `method' and `Arguments' from this class, making
28015         it smaller, and moving it all to SimpleCall, so I can reuse this
28016         code in other locations and avoid creating a lot of transient data
28017         strucutres when not required.
28018
28019         * cs-parser.jay: Adjust for new changes.
28020
28021 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28022
28023         * enum.cs (Enum.Populate): If there is a failure during
28024         definition, return
28025
28026         * cs-parser.jay (opt_enum_base): we used to catch type errors
28027         here, but this is really incorrect.  The type error should be
28028         catched during semantic analysis.
28029
28030 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28031
28032         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28033         current_local_parameters as expected since I, in my stupidity, had forgotten
28034         to do this :-)
28035
28036         * attribute.cs (GetValidPlaces): Fix stupid bug.
28037
28038         * class.cs (Method::Emit): Perform check on applicability of attributes.
28039
28040         (Constructor::Emit): Ditto.
28041
28042         (Field::Emit): Ditto.
28043
28044         (Field.Location): Store location information.
28045
28046         (Property, Event, Indexer, Operator): Ditto.
28047
28048         * cs-parser.jay (field_declaration): Pass in location for each field.
28049
28050         * ../errors/cs0592.cs : Add.
28051
28052 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28053
28054         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28055
28056         (InitCoreTypes): Update accordingly.
28057
28058         (RegisterAttrType, LookupAttr): Implement.
28059
28060         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28061         info about the same.
28062
28063         (Resolve): Update to populate the above as necessary.
28064
28065         (Error592): Helper.
28066
28067         (GetValidPlaces): Helper to the above.
28068
28069         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28070
28071         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28072
28073 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28074
28075         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28076
28077         * ../errors/cs0617.cs : Add.
28078
28079 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28080
28081         * enum.cs (Emit): Rename to Populate to be more consistent with what
28082         we expect it to do and when exactly it is called.
28083
28084         * class.cs, rootcontext.cs : Update accordingly.
28085
28086         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28087         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28088
28089         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28090
28091         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28092         of a fieldinfo using the above, when dealing with a FieldBuilder.
28093
28094 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28095
28096         * ../errors/cs0031.cs : Add.
28097
28098         * ../errors/cs1008.cs : Add.
28099
28100         * ../errrors/cs0543.cs : Add.
28101
28102         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28103         enum type.
28104
28105         (FindMembers): Implement.
28106
28107         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28108         enums and delegates too.
28109
28110         (enum_types): Rename to builder_to_enum.
28111
28112         (delegate_types): Rename to builder_to_delegate.
28113
28114         * delegate.cs (FindMembers): Implement.
28115
28116 2001-11-09  Ravi Pratap  <ravi@ximian.com>
28117
28118         * typemanager.cs (IsEnumType): Implement.
28119
28120         * enum.cs (Emit): Re-write parts to account for the underlying type
28121         better and perform checking etc.
28122
28123         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28124         of the underlying type.
28125
28126         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28127         value
28128
28129         * enum.cs (error31): Helper to report error #31.
28130
28131         * cs-parser.jay (enum_declaration): Store location of each member too.
28132
28133         * enum.cs (member_to_location): New hashtable. 
28134
28135         (AddEnumMember): Update location hashtable.
28136
28137         (Emit): Use the location of each member while reporting errors.
28138
28139 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28140
28141         * cs-parser.jay: A for_initializer if is a
28142         local_variable_declaration really ammount to have an implicit
28143         block with the variable declaration and no initializer for for.
28144
28145         * statement.cs (For.Emit): Cope with null initializers.
28146
28147         This fixes the infinite loop on for initializers.
28148
28149 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
28150
28151         * enum.cs: More cleanup.
28152
28153         * ecore.cs: Remove dead code.
28154
28155         * class.cs (Property.Emit): More simplification.
28156         (Event.Emit): ditto.
28157
28158         Reworked to have less levels of indentation.
28159
28160 2001-11-08  Ravi Pratap  <ravi@ximian.com>
28161
28162         * class.cs (Property): Emit attributes.
28163
28164         (Field): Ditto.
28165
28166         (Event): Ditto.
28167
28168         (Indexer): Ditto.
28169
28170         (Operator): Ditto.
28171
28172         * enum.cs (Emit): Ditto.
28173
28174         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28175         Enums too.
28176
28177         * class.cs (Field, Event, etc.): Move attribute generation into the
28178         Emit method everywhere.
28179
28180         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28181         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28182         as we had no way of defining nested enums !
28183
28184         * rootcontext.cs : Adjust code accordingly.
28185
28186         * typemanager.cs (AddEnumType): To keep track of enum types separately.
28187
28188 2001-11-07  Ravi Pratap  <ravi@ximian.com>
28189
28190         * expression.cs (EvalConstantExpression): Move into ecore.cs
28191
28192         * enum.cs (Enum): Rename some members and make them public and readonly
28193         according to our convention.
28194
28195         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28196         nothing else.
28197
28198         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28199
28200         (Enum::Emit): Write a simple version for now which doesn't try to compute
28201         expressions. I shall modify this to be more robust in just a while.
28202
28203         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28204
28205         (TypeContainer::CloseType): Create the Enum types too.
28206
28207         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28208
28209         * expression.cs (EvalConstantExpression): Get rid of completely.
28210
28211         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28212         user-defined values and other cases.
28213
28214         (IsValidEnumLiteral): Helper function.
28215
28216         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
28217         out there in the case we had a literal FieldExpr.
28218
28219         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28220
28221         (Literalize): Revamp a bit to take two arguments.
28222
28223         (EnumLiteral): New class which derives from Literal to wrap enum literals.
28224
28225 2001-11-06  Ravi Pratap  <ravi@ximian.com>
28226
28227         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28228
28229         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28230
28231         (Resolve): Use the above to ensure we have proper initializers.
28232
28233 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28234
28235         * expression.cs (Expression::EvalConstantExpression): New method to 
28236         evaluate constant expressions.
28237
28238         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28239
28240 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28241
28242         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28243         in an array.
28244
28245         (Binary.ResolveOperator): Handle operator != (object a, object b)
28246         and operator == (object a, object b);
28247
28248         (Binary.DoNumericPromotions): Indicate whether the numeric
28249         promotion was possible.
28250
28251         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28252         Implement.  
28253
28254         Made the ArrayAccess implement interface IAssignMethod instead of
28255         IStackStore as the order in which arguments are passed reflects
28256         this.
28257
28258         * assign.cs: Instead of using expr.ExprClass to select the way of
28259         assinging, probe for the IStackStore/IAssignMethod interfaces.
28260
28261         * typemanager.cs: Load InitializeArray definition.
28262
28263         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28264         static data that can be used to initialize arrays. 
28265
28266 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28267
28268         * expression.cs: Handle operator== and operator!= for booleans.
28269
28270         (Conditioal.Reduce): Implement reducer for the ?: operator.
28271
28272         (Conditional.Resolve): Implement dead code elimination.
28273
28274         (Binary.Resolve): Catch string literals and return a new
28275         concatenated string.
28276
28277         (Unary.Reduce): Implement reduction of unary expressions.
28278
28279         * ecore.cs: Split out the expression core handling here.
28280
28281         (Expression.Reduce): New method used to perform constant folding
28282         and CSE.  This is needed to support constant-expressions. 
28283
28284         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28285         targets, and optimize for !x.
28286
28287 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28288
28289         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28290         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28291         set custom atttributes.
28292
28293         * literal.cs (Literal::GetValue): New abstract method to return the actual
28294         value of the literal, cast as an object.
28295
28296         (*Literal): Implement GetValue method.
28297
28298         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28299         expressions to the arraylist but objects of type Argument.
28300
28301         * class.cs (TypeContainer::Emit): Emit our attributes too.
28302
28303         (Method::Emit, Constructor::Emit): Ditto.
28304
28305         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28306         to be ignoring earlier.
28307
28308 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28309
28310         * attribute.cs (AttributeSection::Define): Implement to do the business
28311         of constructing a CustomAttributeBuilder.
28312
28313         (Attribute): New trivial class. Increases readability of code.  
28314
28315         * cs-parser.jay : Update accordingly.
28316
28317         (positional_argument_list, named_argument_list, named_argument): New rules
28318
28319         (attribute_arguments): Use the above so that we are more correct.
28320
28321 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28322
28323         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28324         to perform all checks for a method with a params parameter.
28325
28326         (Invocation::OverloadResolve): Update to use the above method and therefore
28327         cope correctly with params method invocations.
28328
28329         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28330         params too.
28331
28332         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28333         constructors in our parent too because we can't afford to miss out on 
28334         protected ones ;-)
28335
28336         * attribute.cs (AttributeSection): New name for the class Attribute
28337
28338         Other trivial changes to improve readability.
28339
28340         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28341         use the new class names.
28342
28343 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28344
28345         * class.cs (Method::Define): Complete definition for params types too
28346
28347         (Indexer::Define): Ditto.
28348
28349         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28350         Cope everywhere with a request for info about the array parameter.
28351
28352 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28353
28354         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28355
28356         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28357         local_variable_type to extract the string corresponding to the type.
28358
28359         (local_variable_type): Fixup the action to use the new helper method.
28360
28361         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28362         go.
28363
28364         * expression.cs : Clean out code which uses the above.
28365
28366 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28367
28368         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28369         and bale out if necessary by returning a false.
28370
28371         (RegisterProperty): Ditto.
28372
28373         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28374         and print out appropriate error messages.
28375
28376         * interface.cs (everywhere): Ditto.
28377
28378         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28379         location to constructor.
28380
28381         * class.cs (Property, Event, Indexer): Update accordingly.
28382
28383         * ../errors/cs111.cs : Added.
28384
28385         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28386         of a method, as laid down by the spec.
28387
28388         (Invocation::OverloadResolve): Use the above method.
28389
28390 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28391
28392         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28393         now take a TypeContainer and a Parameters object.
28394
28395         (ParameterData): Modify return type of ParameterModifier method to be 
28396         Parameter.Modifier and not a string.
28397
28398         (ReflectionParameters, InternalParameters): Update accordingly.
28399
28400         * expression.cs (Argument::GetParameterModifier): Same here.
28401
28402         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28403         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28404         symbol in it at all so maybe this is only for now.
28405
28406 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28407
28408         * support.cs (InternalParameters): Constructor now takes an extra argument 
28409         which is the actual Parameters class.
28410
28411         (ParameterDesc): Update to provide info on ref/out modifiers.
28412
28413         * class.cs (everywhere): Update call to InternalParameters to pass in
28414         the second argument too.
28415
28416         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28417         to return the modifier info [ref/out etc]
28418
28419         (InternalParameters, ReflectionParameters): Implement the above.
28420
28421         * expression.cs (Argument::ParameterModifier): Similar function to return
28422         info about the argument's modifiers.
28423
28424         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28425         too.
28426
28427         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28428         a new SetFormalParameters object which we pass to InternalParameters.
28429
28430 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28431
28432         * expression.cs (NewArray): Merge into the ArrayCreation class.
28433
28434 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28435
28436         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28437         NewUserdefinedArray into one as there wasn't much of a use in having
28438         two separate ones.
28439
28440         * expression.cs (Argument): Change field's name to ArgType from Type.
28441
28442         (Type): New readonly property which returns the proper type, taking into 
28443         account ref/out modifiers.
28444
28445         (everywhere): Adjust code accordingly for the above.
28446
28447         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28448         whether we are emitting for a ref or out parameter.
28449
28450         * expression.cs (Argument::Emit): Use the above field to set the state.
28451
28452         (LocalVariableReference::Emit): Update to honour the flag and emit the
28453         right stuff.
28454
28455         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28456
28457         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28458
28459         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28460
28461         (ReflectionParameters, InternalParameters): Implement the above method.
28462
28463         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28464         reporting errors.
28465
28466         (Invocation::FullMethodDesc): Ditto. 
28467
28468 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28469
28470         * cs-parser.jay: Add extra production for the second form of array
28471         creation. 
28472
28473         * expression.cs (ArrayCreation): Update to reflect the above
28474         change. 
28475
28476         * Small changes to prepare for Array initialization.
28477
28478 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28479
28480         * typemanager.cs (ImplementsInterface): interface might be null;
28481         Deal with this problem;
28482
28483         Also, we do store negative hits on the cache (null values), so use
28484         this instead of calling t.GetInterfaces on the type everytime.
28485
28486 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28487
28488         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28489
28490         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28491         split functionality out into different classes.
28492
28493         (New::FormArrayType): Move into NewBuiltinArray.
28494
28495         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28496         quite useless.
28497
28498         (NewBuiltinArray): New class to handle creation of built-in arrays.
28499
28500         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28501         account creation of one-dimensional arrays.
28502
28503         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28504
28505         (NewUserdefinedArray::DoResolve): Implement.
28506
28507         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28508
28509         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28510         we maintain inside the TypeManager. This is necessary to perform lookups on the
28511         module builder.
28512
28513         (LookupType): Update to perform GetType on the module builders too.     
28514
28515         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28516
28517         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28518
28519 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28520
28521         * expression.cs (New::DoResolve): Implement guts of array creation.
28522
28523         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28524
28525 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28526
28527         * expression.cs: Fix bug I introduced lsat night that broke
28528         Delegates. 
28529
28530         (Expression.Resolve): Report a 246 error (can not resolve name)
28531         if we find a SimpleName in the stream.
28532
28533         (Expression.ResolveLValue): Ditto.
28534
28535         (Expression.ResolveWithSimpleName): This function is a variant of
28536         ResolveName, this one allows SimpleNames to be returned without a
28537         warning.  The only consumer of SimpleNames is MemberAccess
28538
28539 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28540
28541         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28542         might arrive here.  I have my doubts that this is correct.
28543
28544         * statement.cs (Lock): Implement lock statement.
28545
28546         * cs-parser.jay: Small fixes to support `lock' and `using'
28547
28548         * cs-tokenizer.cs: Remove extra space
28549
28550         * driver.cs: New flag --checked, allows to turn on integer math
28551         checking. 
28552
28553         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28554         Threading.Monitor.Exit 
28555
28556 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28557
28558         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28559         Expression Class to be IndexerAccess.
28560
28561         Notice that Indexer::DoResolve sets the eclass to Value.
28562
28563 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28564
28565         * class.cs (TypeContainer::Emit): Emit code for indexers.
28566
28567         * assign.cs (IAssignMethod): New interface implemented by Indexers
28568         and Properties for handling assignment.
28569
28570         (Assign::Emit): Simplify and reuse code. 
28571
28572         * expression.cs (IndexerAccess, PropertyExpr): Implement
28573         IAssignMethod, clean up old code. 
28574
28575 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28576
28577         * typemanager.cs (ImplementsInterface): New method to determine if a type
28578         implements a given interface. Provides a nice cache too.
28579
28580         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28581         method.
28582
28583         (ConvertReferenceExplicit): Ditto.
28584
28585         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28586         various methods, with correct names etc.
28587
28588         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28589         Operator.UnaryNegation.
28590
28591         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28592         we have a unary plus or minus operator.
28593
28594         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28595         UnaryMinus.
28596
28597         * everywhere : update accordingly.
28598
28599         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28600         respectively.
28601
28602         * class.cs (Method::Define): For the case where we are implementing a method
28603         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28604         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28605
28606 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28607
28608         * interface.cs (FindMembers): Implement to work around S.R.E
28609         lameness.
28610
28611         * typemanager.cs (IsInterfaceType): Implement.
28612
28613         (FindMembers): Update to handle interface types too.
28614
28615         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28616         use IsAssignableFrom as that is not correct - it doesn't work.
28617
28618         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28619         and accordingly override EmitStatement.
28620
28621         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28622         using the correct logic :-)
28623
28624 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28625
28626         * ../errors/cs-11.cs : Add to demonstrate error -11 
28627
28628 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28629
28630         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28631         then pass this as a hint to ResolveLValue.
28632
28633         * expression.cs (FieldExpr): Add Location information
28634
28635         (FieldExpr::LValueResolve): Report assignment to readonly
28636         variable. 
28637
28638         (Expression::ExprClassFromMemberInfo): Pass location information.
28639
28640         (Expression::ResolveLValue): Add new method that resolves an
28641         LValue. 
28642
28643         (Expression::DoResolveLValue): Default invocation calls
28644         DoResolve. 
28645
28646         (Indexers): New class used to keep track of indexers in a given
28647         Type. 
28648
28649         (IStackStore): Renamed from LValue, as it did not really describe
28650         what this did.  Also ResolveLValue is gone from this interface and
28651         now is part of Expression.
28652
28653         (ElementAccess): Depending on the element access type
28654
28655         * typemanager.cs: Add `indexer_name_type' as a Core type
28656         (System.Runtime.CompilerServices.IndexerNameAttribute)
28657
28658         * statement.cs (Goto): Take a location.
28659
28660 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28661
28662         * delegate.cs (Delegate::VerifyDelegate): New method to verify
28663         if two delegates are compatible.
28664
28665         (NewDelegate::DoResolve): Update to take care of the case when
28666         we instantiate a delegate from another delegate.
28667
28668         * typemanager.cs (FindMembers): Don't even try to look up members
28669         of Delegate types for now.
28670
28671 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28672
28673         * delegate.cs (NewDelegate): New class to take care of delegate
28674         instantiation.
28675
28676         * expression.cs (New): Split the delegate related code out into 
28677         the NewDelegate class.
28678
28679         * delegate.cs (DelegateInvocation): New class to handle delegate 
28680         invocation.
28681
28682         * expression.cs (Invocation): Split out delegate related code into
28683         the DelegateInvocation class.
28684
28685 2001-10-17  Ravi Pratap  <ravi@ximian.com>
28686
28687         * expression.cs (New::DoResolve): Implement delegate creation fully
28688         and according to the spec.
28689
28690         (New::DoEmit): Update to handle delegates differently.
28691
28692         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28693         because of which we were printing out arguments in reverse order !
28694
28695         * delegate.cs (VerifyMethod): Implement to check if the given method
28696         matches the delegate.
28697
28698         (FullDelegateDesc): Implement.
28699
28700         (VerifyApplicability): Implement.
28701
28702         * expression.cs (Invocation::DoResolve): Update to accordingly handle
28703         delegate invocations too.
28704
28705         (Invocation::Emit): Ditto.
28706
28707         * ../errors/cs1593.cs : Added.
28708
28709         * ../errors/cs1594.cs : Added.
28710
28711         * delegate.cs (InstanceExpression, TargetMethod): New properties.
28712
28713 2001-10-16  Ravi Pratap  <ravi@ximian.com>
28714
28715         * typemanager.cs (intptr_type): Core type for System.IntPtr
28716
28717         (InitCoreTypes): Update for the same.
28718
28719         (iasyncresult_type, asynccallback_type): Ditto.
28720
28721         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28722         correct.
28723
28724         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28725         too.
28726
28727         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28728         the builders for the 4 members of a delegate type :-)
28729
28730         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28731         type.
28732
28733         * expression.cs (New::DoResolve): Implement guts for delegate creation.
28734
28735         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28736
28737 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
28738
28739         * statement.cs (Break::Emit): Implement.   
28740         (Continue::Emit): Implement.
28741
28742         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28743         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28744         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28745         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
28746         end loop
28747
28748         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28749         properties that track the label for the current loop (begin of the
28750         loop and end of the loop).
28751
28752 2001-10-15  Ravi Pratap  <ravi@ximian.com>
28753
28754         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28755         use of emitting anything at all.
28756
28757         * class.cs, rootcontext.cs : Get rid of calls to the same.
28758
28759         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28760
28761         (Populate): Define the constructor correctly and set the implementation
28762         attributes.
28763
28764         * typemanager.cs (delegate_types): New hashtable to hold delegates that
28765         have been defined.
28766
28767         (AddDelegateType): Implement.
28768
28769         (IsDelegateType): Implement helper method.
28770
28771         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28772
28773         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28774         and accordingly handle it.
28775
28776         * delegate.cs (Populate): Take TypeContainer argument.
28777         Implement bits to define the Invoke method. However, I still haven't figured out
28778         how to take care of the native int bit :-(
28779
28780         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
28781         Qualify the name of the delegate, not its return type !
28782
28783         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28784         conversion.
28785
28786         (StandardConversionExists): Checking for array types turns out to be recursive.
28787
28788         (ConvertReferenceExplicit): Implement array conversion.
28789
28790         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28791
28792 2001-10-12  Ravi Pratap  <ravi@ximian.com>
28793
28794         * cs-parser.jay (delegate_declaration): Store the fully qualified
28795         name as it is a type declaration.
28796
28797         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
28798         readonly.
28799
28800         (DefineDelegate): Renamed from Define. Does the same thing essentially,
28801         as TypeContainer::DefineType.
28802
28803         (Populate): Method in which all the definition of the various methods (Invoke)
28804         etc is done.
28805
28806         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28807         see.
28808
28809         (CloseDelegate): Finally creates the delegate.
28810
28811         * class.cs (TypeContainer::DefineType): Update to define delegates.
28812         (Populate, Emit and CloseType): Do the same thing here too.
28813
28814         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28815         delegates in all these operations.
28816
28817 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
28818
28819         * expression.cs: LocalTemporary: a new expression used to
28820         reference a temporary that has been created.
28821
28822         * assign.cs: Handle PropertyAccess back here, so that we can
28823         provide the proper semantic access to properties.
28824
28825         * expression.cs (Expression::ConvertReferenceExplicit): Implement
28826         a few more explicit conversions. 
28827
28828         * modifiers.cs: `NEW' modifier maps to HideBySig.
28829
28830         * expression.cs (PropertyExpr): Make this into an
28831         ExpressionStatement, and support the EmitStatement code path. 
28832
28833         Perform get/set error checking, clean up the interface.
28834
28835         * assign.cs: recognize PropertyExprs as targets, and if so, turn
28836         them into toplevel access objects.
28837
28838 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
28839
28840         * expression.cs: PropertyExpr::PropertyExpr: use work around the
28841         SRE.
28842
28843         * typemanager.cs: Keep track here of our PropertyBuilders again to
28844         work around lameness in SRE.
28845
28846 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
28847
28848         * expression.cs (LValue::LValueResolve): New method in the
28849         interface, used to perform a second resolution pass for LValues. 
28850
28851         (This::DoResolve): Catch the use of this in static methods.
28852
28853         (This::LValueResolve): Implement.
28854
28855         (This::Store): Remove warning, assigning to `this' in structures
28856         is 
28857
28858         (Invocation::Emit): Deal with invocation of
28859         methods on value types.  We need to pass the address to structure
28860         methods rather than the object itself.  (The equivalent code to
28861         emit "this" for structures leaves the entire structure on the
28862         stack instead of a pointer to it). 
28863
28864         (ParameterReference::DoResolve): Compute the real index for the
28865         argument based on whether the method takes or not a `this' pointer
28866         (ie, the method is static).
28867
28868         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28869         value types returned from functions when we need to invoke a
28870         method on the sturcture.
28871
28872
28873 2001-10-11  Ravi Pratap  <ravi@ximian.com>
28874
28875         * class.cs (TypeContainer::DefineType): Method to actually do the business of
28876         defining the type in the Modulebuilder or Typebuilder. This is to take
28877         care of nested types which need to be defined on the TypeBuilder using
28878         DefineNestedMethod.
28879
28880         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
28881         methods in RootContext, only ported to be part of TypeContainer.
28882
28883         (TypeContainer::GetInterfaceOrClass): Ditto.
28884
28885         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28886
28887         * interface.cs (Interface::DefineInterface): New method. Does exactly
28888         what RootContext.CreateInterface did earlier, only it takes care of nested types 
28889         too.
28890
28891         (Interface::GetInterfaces): Move from RootContext here and port.
28892
28893         (Interface::GetInterfaceByName): Same here.
28894
28895         * rootcontext.cs (ResolveTree): Re-write.
28896
28897         (PopulateTypes): Re-write.
28898
28899         * class.cs (TypeContainer::Populate): Populate nested types too.
28900         (TypeContainer::Emit): Emit nested members too.
28901
28902         * typemanager.cs (AddUserType): Do not make use of the FullName property,
28903         instead just use the name argument passed in as it is already fully
28904         qualified.
28905
28906         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28907         to TypeContainer mapping to see if a type is user-defined.
28908
28909         * class.cs (TypeContainer::CloseType): Implement. 
28910
28911         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28912         the default constructor.
28913
28914         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28915         twice.
28916
28917         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28918
28919         * interface.cs (CloseType): Create the type here.
28920
28921         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28922         the hierarchy.
28923
28924         Remove all the methods which are now in TypeContainer.
28925
28926 2001-10-10  Ravi Pratap  <ravi@ximian.com>
28927
28928         * delegate.cs (Define): Re-write bits to define the delegate
28929         correctly.
28930
28931 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
28932
28933         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28934
28935         * expression.cs (ImplicitReferenceConversion): handle null as well
28936         as a source to convert to any reference type.
28937
28938         * statement.cs (Return): Perform any implicit conversions to
28939         expected return type.  
28940
28941         Validate use of return statement.  
28942
28943         * codegen.cs (EmitContext): Pass the expected return type here.
28944
28945         * class.cs (Method, Constructor, Property): Pass expected return
28946         type to EmitContext.
28947
28948 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
28949
28950         * expression.cs: Make DoResolve take an EmitContext instead of a
28951         TypeContainer.
28952
28953         Replaced `l' and `location' for `loc', for consistency.
28954
28955         (Error, Warning): Remove unneeded Tc argument.
28956
28957         * assign.cs, literal.cs, constant.cs: Update to new calling
28958         convention. 
28959
28960         * codegen.cs: EmitContext now contains a flag indicating whether
28961         code is being generated in a static method or not.
28962
28963         * cs-parser.jay: DecomposeQI, new function that replaces the old
28964         QualifiedIdentifier.  Now we always decompose the assembled
28965         strings from qualified_identifier productions into a group of
28966         memberaccesses.
28967
28968 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
28969
28970         * rootcontext.cs: Deal with field-less struct types correctly now
28971         by passing the size option to Define Type.
28972
28973         * class.cs: Removed hack that created one static field. 
28974
28975 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28976
28977         * statement.cs: Moved most of the code generation here. 
28978
28979 2001-10-09  Ravi Pratap  <ravi@ximian.com>
28980
28981         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28982         seem very right.
28983
28984         (ElementAccess): Remove useless bits for now - keep checks as the spec
28985         says.
28986
28987 2001-10-08  Ravi Pratap  <ravi@ximian.com>
28988
28989         * expression.cs (ElementAccess::DoResolve): Remove my crap code
28990         and start performing checks according to the spec.
28991
28992 2001-10-07  Ravi Pratap  <ravi@ximian.com>
28993
28994         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28995         rank_specifiers instead.
28996
28997         (rank_specifiers): Change the order in which the rank specifiers are stored
28998
28999         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29000
29001         * expression.cs (ElementAccess): Implement the LValue interface too.
29002
29003 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29004
29005         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29006         except that user defined conversions are not included.
29007
29008         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29009         perform the conversion of the return type, if necessary.
29010
29011         (New::DoResolve): Check whether we are creating an array or an object
29012         and accordingly do the needful.
29013
29014         (New::Emit): Same here.
29015
29016         (New::DoResolve): Implement guts of array creation.
29017
29018         (New::FormLookupType): Helper function.
29019
29020 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29021
29022         * codegen.cs: Removed most of the code generation here, and move the
29023         corresponding code generation bits to the statement classes. 
29024
29025         Added support for try/catch/finalize and throw.
29026
29027         * cs-parser.jay: Added support for try/catch/finalize.
29028
29029         * class.cs: Catch static methods having the flags override,
29030         virtual or abstract.
29031
29032         * expression.cs (UserCast): This user cast was not really doing
29033         what it was supposed to do.  Which is to be born in fully resolved
29034         state.  Parts of the resolution were being performed at Emit time! 
29035
29036         Fixed this code.
29037
29038 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29039
29040         * expression.cs: Implicity convert the result from UserCast.
29041
29042 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29043
29044         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29045         prevented it from working correctly. 
29046
29047         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29048         merely ConvertImplicit.
29049
29050 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29051
29052         * typemanager.cs: Make the LookupTypeContainer function static,
29053         and not per-instance.  
29054
29055         * class.cs: Make static FindMembers (the one that takes a Type
29056         argument). 
29057
29058         * codegen.cs: Add EmitForeach here.
29059
29060         * cs-parser.jay: Make foreach a toplevel object instead of the
29061         inline expansion, as we need to perform semantic analysis on it. 
29062
29063 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29064
29065         * expression.cs (Expression::ImplicitUserConversion): Rename to
29066         UserDefinedConversion.
29067
29068         (Expression::UserDefinedConversion): Take an extra argument specifying 
29069         whether we look for explicit user conversions too.
29070
29071         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29072
29073         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29074
29075         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29076         with the appropriate arguments.
29077
29078         * cs-parser.jay (cast_expression): Record location too.
29079
29080         * expression.cs (Cast): Record location info.
29081
29082         (Expression::ConvertExplicit): Take location argument.
29083
29084         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29085         to determine if we are doing explicit conversions.
29086
29087         (UserCast::Emit): Update accordingly.
29088
29089         (Expression::ConvertExplicit): Report an error if everything fails.
29090
29091         * ../errors/cs0030.cs : Add.
29092
29093 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29094
29095         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29096         virtual and newslot bits. 
29097
29098         * class.cs (TypeContainer::RegisterRequiredImplementations):
29099         Record methods we need.
29100
29101         (TypeContainer::MakeKey): Helper function to make keys for
29102         MethodBases, since the Methodbase key is useless.
29103
29104         (TypeContainer::Populate): Call RegisterRequiredImplementations
29105         before defining the methods.   
29106
29107         Create a mapping for method_builders_to_methods ahead of time
29108         instead of inside a tight loop.
29109
29110         (::RequireMethods):  Accept an object as the data to set into the
29111         hashtable so we can report interface vs abstract method mismatch.
29112
29113 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29114
29115         * report.cs: Make all of it static.
29116
29117         * rootcontext.cs: Drop object_type and value_type computations, as
29118         we have those in the TypeManager anyways.
29119
29120         Drop report instance variable too, now it is a global.
29121
29122         * driver.cs: Use try/catch on command line handling.
29123
29124         Add --probe option to debug the error reporting system with a test
29125         suite. 
29126
29127         * report.cs: Add support for exiting program when a probe
29128         condition is reached.
29129
29130 2001-10-03  Ravi Pratap  <ravi@ximian.com>
29131
29132         * expression.cs (Binary::DoNumericPromotions): Fix the case when
29133         we do a forcible conversion regardless of type, to check if 
29134         ForceConversion returns a null.
29135
29136         (Binary::error19): Use location to report error.
29137
29138         (Unary::error23): Use location here too.
29139
29140         * ../errors/cs0019.cs : Check in.
29141
29142         * ../errors/cs0023.cs : Check in.
29143
29144         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29145         case of a non-null MethodInfo object with a length of 0 !
29146
29147         (Binary::ResolveOperator): Flag error if overload resolution fails to find
29148         an applicable member - according to the spec :-)
29149         Also fix logic to find members in base types.
29150
29151         (Unary::ResolveOperator): Same here.
29152
29153         (Unary::report23): Change name to error23 and make first argument a TypeContainer
29154         as I was getting thoroughly confused between this and error19 :-)
29155
29156         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29157         (::FindMostEncompassedType): Implement.
29158         (::FindMostEncompassingType): Implement.
29159         (::StandardConversionExists): Implement.
29160
29161         (UserImplicitCast): Re-vamp. We now need info about most specific
29162         source and target types so that we can do the necessary conversions.
29163
29164         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29165         mathematical union with no duplicates.
29166
29167 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29168
29169         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29170         in order from base classes to child classes, so that we can in
29171         child classes look up in our parent for method names and
29172         attributes (required for handling abstract, virtual, new, override
29173         constructs: we need to instrospect our base class, and if we dont
29174         populate the classes in order, the introspection might be
29175         incorrect.  For example, a method could query its parent before
29176         the parent has any methods and would determine that the parent has
29177         no abstract methods (while it could have had them)).
29178
29179         (RootContext::CreateType): Record the order in which we define the
29180         classes.
29181
29182 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
29183
29184         * class.cs (TypeContainer::Populate): Also method definitions can
29185         fail now, keep track of this.
29186
29187         (TypeContainer::FindMembers): Implement support for
29188         DeclaredOnly/noDeclaredOnly flag.
29189
29190         (Constructor::Emit) Return the ConstructorBuilder.
29191
29192         (Method::Emit) Return the MethodBuilder. 
29193         Check for abstract or virtual methods to be public.
29194
29195         * rootcontext.cs (RootContext::CreateType): Register all the
29196         abstract methods required for the class to be complete and the
29197         interface methods that must be implemented. 
29198
29199         * cs-parser.jay: Report error 501 (method requires body if it is
29200         not marked abstract or extern).
29201
29202         * expression.cs (TypeOf::Emit): Implement.
29203
29204         * typemanager.cs: runtime_handle_type, new global type.
29205
29206         * class.cs (Property::Emit): Generate code for properties.
29207
29208 2001-10-02  Ravi Pratap  <ravi@ximian.com>
29209
29210         * expression.cs (Unary::ResolveOperator): Find operators on base type
29211         too - we now conform exactly to the spec.
29212
29213         (Binary::ResolveOperator): Same here.
29214
29215         * class.cs (Operator::Define): Fix minor quirk in the tests.
29216
29217         * ../errors/cs0215.cs : Added.
29218
29219         * ../errors/cs0556.cs : Added.
29220
29221         * ../errors/cs0555.cs : Added.
29222
29223 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29224
29225         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29226         single integer which is really efficient
29227
29228 2001-10-01  Ravi Pratap  <ravi@ximian.com>
29229
29230         *  expression.cs (Expression::ImplicitUserConversion): Use location
29231         even in the case when we are examining True operators.
29232  
29233         * class.cs (Operator::Define): Perform extensive checks to conform
29234         with the rules for operator overloading in the spec.
29235
29236         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29237         some of the other conversions mentioned in the spec.
29238
29239         * typemanager.cs (array_type): New static member for the System.Array built-in
29240         type.
29241
29242         (cloneable_interface): For System.ICloneable interface.
29243
29244         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29245         we start resolving the tree and populating types.
29246
29247         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29248  
29249 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29250
29251         * expression.cs (Expression::ExprClassFromMemberInfo,
29252         Expression::Literalize): Create literal expressions from
29253         FieldInfos which are literals.
29254
29255         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29256         type casts, because they were wrong.  The test suite in tests
29257         caught these ones.
29258
29259         (ImplicitNumericConversion): ushort to ulong requires a widening
29260         cast. 
29261
29262         Int32 constant to long requires widening cast as well.
29263
29264         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29265         for integers because the type on the stack is not i4.
29266
29267 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29268
29269         * expression.cs (report118): require location argument. 
29270
29271         * parameter.cs: Do not dereference potential null value.
29272
29273         * class.cs: Catch methods that lack the `new' keyword when
29274         overriding a name.  Report warnings when `new' is used without
29275         anything being there to override.
29276
29277         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29278
29279         * class.cs: Only add constructor to hashtable if it is non-null
29280         (as now constructors can fail on define).
29281
29282         (TypeManager, Class, Struct): Take location arguments.
29283
29284         Catch field instance initialization in structs as errors.
29285
29286         accepting_filter: a new filter for FindMembers that is static so
29287         that we dont create an instance per invocation.
29288
29289         (Constructor::Define): Catch errors where a struct constructor is
29290         parameterless 
29291
29292         * cs-parser.jay: Pass location information for various new
29293         constructs. 
29294
29295         * delegate.cs (Delegate): take a location argument.
29296
29297         * driver.cs: Do not call EmitCode if there were problesm in the
29298         Definition of the types, as many Builders wont be there. 
29299
29300         * decl.cs (Decl::Decl): Require a location argument.
29301
29302         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29303         into integers, and find the most appropiate integer for it.
29304
29305         * literal.cs: Implement ULongLiteral.
29306
29307         * rootcontext.cs: Provide better information about the location of
29308         failure when CreateType fails.
29309
29310 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29311
29312         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29313         as well.
29314
29315         * expression.cs (Binary::CheckShiftArguments): Add missing type
29316         computation.
29317         (Binary::ResolveOperator): Add type to the logical and and logical
29318         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29319         before.
29320
29321         (Binary::DoNumericPromotions): In the case where either argument
29322         is ulong (and most signed types combined with ulong cause an
29323         error) perform implicit integer constant conversions as well.
29324
29325 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29326
29327         * expression.cs (UserImplicitCast): Method should always be
29328         non-null. 
29329         (Invocation::BetterConversion): Simplified test for IntLiteral.
29330
29331         (Expression::ImplicitNumericConversion): Split this routine out.
29332         Put the code that performs implicit constant integer conversions
29333         here. 
29334
29335         (Expression::Resolve): Become a wrapper around DoResolve so we can
29336         check eclass and type being set after resolve.
29337
29338         (Invocation::Badness): Remove this dead function
29339
29340         (Binary::ResolveOperator): Do not compute the expensive argumnets
29341         unless we have a union for it.
29342
29343         (Probe::Emit): Is needs to do an isinst and then
29344         compare against null.
29345
29346         (::CanConvert): Added Location argument.  If the Location argument
29347         is null (Location.Null), then we do not report errors.  This is
29348         used by the `probe' mechanism of the Explicit conversion.  We do
29349         not want to generate an error for something that the user
29350         explicitly requested to be casted.  But the pipeline for an
29351         explicit cast first tests for potential implicit casts.
29352
29353         So for now, if the Location is null, it means `Probe only' to
29354         avoid adding another argument.   Might have to revise this
29355         strategy later.
29356
29357         (ClassCast): New class used to type cast objects into arbitrary
29358         classes (used in Explicit Reference Conversions).
29359
29360         Implement `as' as well.
29361
29362         Reverted all the patches from Ravi below: they were broken:
29363
29364                 * The use of `level' as a mechanism to stop recursive
29365                   invocations is wrong.  That was there just to catch the
29366                   bug with a strack trace but not as a way of addressing
29367                   the problem.
29368
29369                   To fix the problem we have to *understand* what is going
29370                   on and the interactions and come up with a plan, not
29371                   just get things going.
29372
29373                 * The use of the type conversion cache that I proposed
29374                   last night had an open topic: How does this work across
29375                   protection domains.  A user defined conversion might not
29376                   be public in the location where we are applying the
29377                   conversion, a different conversion might be selected
29378                   (ie, private A->B (better) but public B->A (worse),
29379                   inside A, A->B applies, but outside it, B->A will
29380                   apply).
29381
29382                 * On top of that (ie, even if the above is solved),
29383                   conversions in a cache need to be abstract.  Ie, `To
29384                   convert from an Int to a Short use an OpcodeCast', not
29385                   `To convert from an Int to a Short use the OpcodeCast on
29386                   the variable 5' (which is what this patch was doing).
29387
29388 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29389
29390         * expression.cs (Invocation::ConversionExists): Re-write to use
29391         the conversion cache
29392
29393         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29394         cache all conversions done, not just user-defined ones.
29395
29396         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29397         to determine if a conversion exists instead of acutually trying to 
29398         perform the conversion. It's faster too.
29399
29400         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29401         and only then attempt the implicit conversion.
29402
29403 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29404
29405         * expression.cs (ConvertImplicit): Use a cache for conversions
29406         already found. Check level of recursion and bail out if necessary.
29407
29408 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29409
29410         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29411         Export standard methods that we expect for string operations.
29412
29413         * statement.cs (Block::UsageWarning): Track usage of variables and
29414         report the errors for not used variables.
29415
29416         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29417         operator. 
29418
29419 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29420
29421         * codegen.cs: remove unnneded code 
29422
29423         * expression.cs: Removed BuiltinTypeAccess class
29424
29425         Fix the order in which implicit conversions are
29426         done.  
29427
29428         The previous fixed dropped support for boxed conversions (adding a
29429         test to the test suite now)
29430
29431         (UserImplicitCast::CanConvert): Remove test for source being null,
29432         that code is broken.  We should not feed a null to begin with, if
29433         we do, then we should track the bug where the problem originates
29434         and not try to cover it up here.
29435
29436         Return a resolved expression of type UserImplicitCast on success
29437         rather than true/false.  Ravi: this is what I was talking about,
29438         the pattern is to use a static method as a "constructor" for
29439         objects. 
29440
29441         Also, do not create arguments until the very last minute,
29442         otherwise we always create the arguments even for lookups that
29443         will never be performed. 
29444
29445         (UserImplicitCast::Resolve): Eliminate, objects of type
29446         UserImplicitCast are born in a fully resolved state. 
29447
29448         * typemanager.cs (InitCoreTypes): Init also value_type
29449         (System.ValueType). 
29450
29451         * expression.cs (Cast::Resolve): First resolve the child expression.
29452
29453         (LValue): Add new method AddressOf to be used by
29454         the `&' operator.  
29455
29456         Change the argument of Store to take an EmitContext instead of an
29457         ILGenerator, because things like FieldExpr need to be able to call
29458         their children expression to generate the instance code. 
29459
29460         (Expression::Error, Expression::Warning): Sugar functions for
29461         reporting errors.
29462
29463         (Expression::MemberLookup): Accept a TypeContainer instead of a
29464         Report as the first argument.
29465
29466         (Expression::ResolvePrimary): Killed.  I still want to improve
29467         this as currently the code is just not right.
29468
29469         (Expression::ResolveMemberAccess): Simplify, but it is still
29470         wrong. 
29471
29472         (Unary::Resolve): Catch errors in AddressOf operators.
29473
29474         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29475         index to a byte for the short-version, or the compiler will choose
29476         the wrong Emit call, which generates the wrong data.
29477
29478         (ParameterReference::Emit, ::Store): same.
29479
29480         (FieldExpr::AddressOf): Implement.
29481
29482         * typemanager.cs: TypeManager: made public variable instead of
29483         property.
29484
29485         * driver.cs: document --fatal.
29486
29487         * report.cs (ErrorMessage, WarningMessage): new names for the old
29488         Error and Warning classes.
29489
29490         * cs-parser.jay (member_access): Turn built-in access to types
29491         into a normal simplename
29492
29493 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29494
29495         * expression.cs (Invocation::BetterConversion): Fix to cope
29496         with q being null, since this was introducing a bug.
29497
29498         * expression.cs (ConvertImplicit): Do built-in conversions first.
29499
29500 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29501
29502         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29503
29504 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29505
29506         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29507         I had introduced long ago (what's new ?).
29508
29509         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29510         the work of all the checking. 
29511         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29512         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29513
29514         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29515         that is the right way. 
29516
29517         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29518         overloading resolution. Use everywhere instead of cutting and pasting code.
29519
29520         (Binary::ResolveOperator): Use MakeUnionSet.
29521
29522         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29523         we have to convert to bool types. Not complete yet.
29524
29525 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29526
29527         * typemanager.cs (TypeManager::CSharpName): support ushort.
29528
29529         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29530         to provide an expression that performsn an implicit constant int
29531         conversion (section 6.1.6).
29532         (Expression::ConvertImplicitRequired): Reworked to include
29533         implicit constant expression conversions.
29534
29535         (Expression::ConvertNumericExplicit): Finished.
29536
29537         (Invocation::Emit): If InstanceExpression is null, then it means
29538         that we perform a call on this.
29539
29540 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29541
29542         * expression.cs (Unary::Emit): Remove some dead code.
29543         (Probe): Implement Resolve and Emit for `is'.
29544         (Expression::ConvertImplicitRequired): Attempt to do constant
29545         expression conversions here.  Maybe should be moved to
29546         ConvertImplicit, but I am not sure.
29547         (Expression::ImplicitLongConstantConversionPossible,
29548         Expression::ImplicitIntConstantConversionPossible): New functions
29549         that tell whether is it possible to apply an implicit constant
29550         expression conversion.
29551
29552         (ConvertNumericExplicit): Started work on explicit numeric
29553         conversions.
29554
29555         * cs-parser.jay: Update operator constants.
29556
29557         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29558         (Parameters::GetSignature): Hook up VerifyArgs here.
29559         (Parameters::VerifyArgs): Verifies that no two arguments have the
29560         same name. 
29561
29562         * class.cs (Operator): Update the operator names to reflect the
29563         ones that the spec expects (as we are just stringizing the
29564         operator names).
29565
29566         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29567         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29568         previous usage did only work for our methods.
29569         (Expression::ConvertImplicit): Handle decimal implicit numeric
29570         conversions as well.
29571         (Expression::InternalTypeConstructor): Used to invoke constructors
29572         on internal types for default promotions.
29573
29574         (Unary::Emit): Implement special handling for the pre/post
29575         increment/decrement for overloaded operators, as they need to have
29576         the same semantics as the other operators.
29577
29578         (Binary::ResolveOperator): ditto.
29579         (Invocation::ConversionExists): ditto.
29580         (UserImplicitCast::Resolve): ditto.
29581
29582 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29583
29584         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29585         operator, return after emitting body. Regression tests pass again !
29586
29587         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29588         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29589         (Invocation::OverloadResolve): Ditto.
29590         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29591
29592         * everywhere : update calls to the above methods accordingly.
29593
29594 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29595
29596         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29597
29598         * expression.cs (ExpressionStatement): New base class used for
29599         expressions that can appear in statements, so that we can provide
29600         an alternate path to generate expression that do not leave a value
29601         on the stack.
29602
29603         (Expression::Emit, and all the derivatives): We no longer return
29604         whether a value is left on the stack or not.  Every expression
29605         after being emitted leaves a single value on the stack.
29606
29607         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29608         facilties of ExpressionStatement if possible.
29609
29610         * cs-parser.jay: Update statement_expression.
29611
29612 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29613
29614         * driver.cs: Change the wording of message
29615
29616 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29617
29618         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29619         the type of the expression to the return type of the method if
29620         we have an overloaded operator match ! The regression tests pass again !
29621         (Unary::ResolveOperator): Ditto.
29622
29623         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29624         to find "op_Implicit", not "implicit" ;-)
29625         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29626         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29627
29628         * everywhere : Correct calls to the above accordingly.
29629
29630         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29631         (ConvertImplicit): Do user-defined conversion if it exists.
29632
29633 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29634
29635         * assign.cs: track location.
29636         (Resolve): Use implicit conversions on assignment.
29637
29638         * literal.cs: Oops.  Not good, Emit of short access values should
29639         pass (Bytes) or the wrong argument will be selected.
29640
29641         * expression.cs (Unary::Emit): Emit code for -expr.
29642
29643         (Unary::ResolveOperator): Handle `Substract' for non-constants
29644         (substract from zero from the non-constants).
29645         Deal with Doubles as well. 
29646
29647         (Expression::ConvertImplicitRequired): New routine that reports an
29648         error if no implicit conversion exists. 
29649
29650         (Invocation::OverloadResolve): Store the converted implicit
29651         expressions if we make them
29652
29653 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29654
29655         * class.cs (ConstructorInitializer): Take a Location argument.
29656         (ConstructorBaseInitializer): Same here.
29657         (ConstructorThisInitializer): Same here.
29658
29659         * cs-parser.jay : Update all calls accordingly.
29660
29661         * expression.cs (Unary, Binary, New): Take location argument.
29662         Update accordingly everywhere.
29663
29664         * cs-parser.jay : Update all calls to the above to take a location
29665         argument.
29666
29667         * class.cs : Ditto.
29668
29669 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29670
29671         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29672         (Invocation::BetterConversion): Same here
29673         (Invocation::ConversionExists): Ditto.
29674
29675         (Invocation::ConversionExists): Implement.
29676
29677 2001-09-22  Ravi Pratap  <ravi@ximian.com>
29678
29679         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29680         Also take an additional TypeContainer argument.
29681
29682         * All over : Pass in TypeContainer as argument to OverloadResolve.
29683
29684         * typemanager.cs (CSharpName): Update to check for the string type and return
29685         that too.
29686
29687         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29688         a given method.
29689
29690 2001-09-21  Ravi Pratap  <ravi@ximian.com>
29691
29692         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29693         (Invocation::BetterFunction): Implement.
29694         (Invocation::BetterConversion): Implement.
29695         (Invocation::ConversionExists): Skeleton, no implementation yet.
29696
29697         Okay, things work fine !
29698
29699 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
29700
29701         * typemanager.cs: declare and load enum_type, delegate_type and
29702         void_type. 
29703
29704         * expression.cs (Expression::Emit): Now emit returns a value that
29705         tells whether a value is left on the stack or not.  This strategy
29706         might be reveted tomorrow with a mechanism that would address
29707         multiple assignments.
29708         (Expression::report118): Utility routine to report mismatches on
29709         the ExprClass.
29710
29711         (Unary::Report23): Report impossible type/operator combination
29712         utility function.
29713
29714         (Unary::IsIncrementableNumber): Whether the type can be
29715         incremented or decremented with add.
29716         (Unary::ResolveOperator): Also allow enumerations to be bitwise
29717         complemented. 
29718         (Unary::ResolveOperator): Implement ++, !, ~,
29719
29720         (Invocation::Emit): Deal with new Emit convetion.
29721
29722         * All Expression derivatives: Updated their Emit method to return
29723         whether they leave values on the stack or not.
29724
29725         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29726         stack for expressions that are statements. 
29727
29728 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29729
29730         * expression.cs (LValue): New interface.  Must be implemented by
29731         LValue objects.
29732         (LocalVariableReference, ParameterReference, FieldExpr): Implement
29733         LValue interface.
29734
29735         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29736         interface for generating code, simplifies the code.
29737
29738 2001-09-20  Ravi Pratap  <ravi@ximian.com>
29739
29740         * expression.cs (everywhere): Comment out return statements in ::Resolve
29741         methods to avoid the warnings.
29742
29743 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29744
29745         * driver.cs (parse): Report error 2001 if we can not open the
29746         source file.
29747
29748         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29749         not resolve it.
29750
29751         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29752         object. 
29753
29754         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29755         otherwise nested blocks end up with the same index.
29756
29757         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29758
29759         * expression.cs:  Instead of having FIXMEs in the Resolve
29760         functions, throw exceptions so it is obvious that we are facing a
29761         bug. 
29762
29763         * cs-parser.jay (invocation_expression): Pass Location information.
29764
29765         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29766         Use a basename for those routines because .NET does not like paths
29767         on them. 
29768
29769         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29770         already defined.
29771
29772 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
29773
29774         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29775         are loading the correct data types (throws an exception if not).
29776         (TypeManager::InitCoreTypes): Use CoreLookupType
29777
29778         * expression.cs (Unary::ResolveOperator): return the child
29779         expression for expressions which are just +expr.
29780         (Unary::ResolveOperator): Return negative literals for -LITERAL
29781         expressions (otherwise they are Unary {Literal}).
29782         (Invocation::Badness): Take into account `Implicit constant
29783         expression conversions'.
29784
29785         * literal.cs (LongLiteral): Implement long literal class.
29786         (IntLiteral): export the `Value' of the intliteral. 
29787
29788 2001-09-19  Ravi Pratap  <ravi@ximian.com>
29789
29790         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29791
29792         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
29793         instead of 'Operator'
29794
29795         * expression.cs (Binary::ResolveOperator): Update accordingly.
29796         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29797         and 'Minus'
29798
29799         * cs-parser.jay (unary_expression): Update to use the new names.
29800
29801         * gen-treedump.cs (GetUnary): Same here.
29802
29803         * expression.cs (Unary::Resolve): Implement.
29804         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
29805         operators are found instead of making noise ;-)
29806         (Unary::ResolveOperator): New method to do precisely the same thing which
29807         Binary::ResolveOperator does for Binary expressions.
29808         (Unary.method, .Arguments): Add.
29809         (Unary::OperName): Implement.   
29810         (Unary::ForceConversion): Copy and Paste !
29811
29812         * class.cs (Operator::Define): Fix a small bug for the case when we have 
29813         a unary operator.
29814
29815         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29816         for the inbuilt operators. Only overloading works for now ;-)
29817
29818 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
29819
29820         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29821         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29822
29823         * expression.cs (This::Emit): Implement. 
29824         (This::Resolve): Implement.
29825         (TypeOf:Resolve): Implement.
29826         (Expression::ResolveSimpleName): Add an implicit this to instance
29827         field references. 
29828         (MemberAccess::Resolve): Deal with Parameters and Fields. 
29829         Bind instance variable to Field expressions.
29830         (FieldExpr::Instance): New field used to track the expression that
29831         represents the object instance.
29832         (FieldExpr::Resolve): Track potential errors from MemberLookup not
29833         binding 
29834         (FieldExpr::Emit): Implement.
29835
29836         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29837         the last instruction contains a return opcode to avoid generating
29838         the last `ret' instruction (this generates correct code, and it is
29839         nice to pass the peverify output).
29840
29841         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29842         initializer for static and instance variables.
29843         (Constructor::Emit): Allow initializer to be null in the case of
29844         static constructors.  Only emit initializer for instance
29845         constructors. 
29846
29847         (TypeContainer::FindMembers): Return a null array if there are no
29848         matches.
29849
29850         Also fix the code for the MemberTypes.Method branch, as it was not
29851         scanning that for operators (or tried to access null variables before).
29852
29853         * assign.cs (Assign::Emit): Handle instance and static fields. 
29854
29855         * TODO: Updated.
29856
29857         * driver.cs: Stop compilation if there are parse errors.
29858
29859         * cs-parser.jay (constructor_declaration): Provide default base
29860         initializer for non-static constructors.
29861         (constructor_declarator): Do not provide a default base
29862         initializers if none was specified.
29863         Catch the fact that constructors should not have parameters.
29864
29865         * class.cs: Do not emit parent class initializers for static
29866         constructors, that should be flagged as an error.
29867
29868 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29869
29870         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29871         Move back code into TypeContainer::Populate.
29872
29873 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29874
29875         * class.cs (TypeContainer::AddConstructor): Fix the check to
29876         compare against Name, not Basename. 
29877         (Operator::OpType): Change Plus and Minus to Add and Subtract.
29878
29879         * cs-parser.jay : Update accordingly.
29880
29881         * class.cs (TypeContainer::FindMembers): For the case where we are searching
29882         for methods, don't forget to look into the operators too.
29883         (RegisterMethodBuilder): Helper method to take care of this for
29884         methods, constructors and operators.
29885         (Operator::Define): Completely revamp.
29886         (Operator.OperatorMethod, MethodName): New fields.
29887         (TypeContainer::Populate): Move the registering of builders into
29888         RegisterMethodBuilder.
29889         (Operator::Emit): Re-write.
29890
29891         * expression.cs (Binary::Emit): Comment out code path to emit method
29892         invocation stuff for the case when we have a user defined operator. I am
29893         just not able to get it right !
29894
29895 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29896
29897         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29898         argument. 
29899
29900         (Expression::MemberLookup): Provide a version that allows to
29901         specify the MemberTypes and BindingFlags. 
29902
29903         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29904         so it was not fetching variable information from outer blocks.
29905
29906         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29907         Beforefieldinit as it was buggy.
29908
29909         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29910         that Ravi put here.  
29911
29912         * class.cs (Constructor::Emit): Only emit if block is not null.
29913         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29914         deal with this by semantically definining it as if the user had
29915         done it.
29916
29917         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29918         constructors as we now "emit" them at a higher level.
29919
29920         (TypeContainer::DefineDefaultConstructor): Used to define the
29921         default constructors if none was provided.
29922
29923         (ConstructorInitializer): Add methods Resolve and Emit. 
29924
29925         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29926
29927 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29928
29929         * class.cs (TypeContainer::EmitDefaultConstructor): Register
29930         the default constructor builder with our hashtable for methodbuilders
29931         to methodcores.
29932
29933         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29934         and argument_count is 0 in which case we have a match.
29935         (Binary::ResolveOperator): More null checking and miscellaneous coding
29936         style cleanup.
29937
29938 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29939
29940         * rootcontext.cs (IsNameSpace): Compare against null.
29941
29942         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29943
29944         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29945         and Unary::Operator.
29946
29947         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29948         accordingly.
29949
29950         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29951         we have overloaded operators.
29952         (Binary::ResolveOperator): Implement the part which does the operator overload
29953         resolution.
29954
29955         * class.cs (Operator::Emit): Implement.
29956         (TypeContainer::Emit): Emit the operators we have too.
29957
29958         * expression.cs (Binary::Emit): Update to emit the appropriate code for
29959         the case when we have a user-defined operator.
29960
29961 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29962
29963         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29964
29965 2001-09-16  Ravi Pratap  <ravi@ximian.com>
29966
29967         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29968         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29969         (Constructor::Emit): Implement.
29970         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29971         if we have no work to do. 
29972         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
29973         Emit method.
29974
29975         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29976         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29977
29978         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29979         of parent.parent.
29980
29981 2001-09-15  Ravi Pratap  <ravi@ximian.com>
29982
29983         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29984         in the source.
29985         (Tree::RecordNamespace): Method to do what the name says ;-)
29986         (Tree::Namespaces): Property to get at the namespaces hashtable.
29987
29988         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
29989         keep track.
29990
29991         * rootcontext.cs (IsNamespace): Fixed it :-)
29992
29993 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29994
29995         * class.cs (TypeContainer::FindMembers): Add support for
29996         constructors. 
29997         (MethodCore): New class that encapsulates both the shared aspects
29998         of a Constructor and a Method.  
29999         (Method, Constructor): Factored pieces into MethodCore.
30000
30001         * driver.cs: Added --fatal which makes errors throw exceptions.
30002         Load System assembly as well as part of the standard library.
30003
30004         * report.cs: Allow throwing exceptions on errors for debugging.
30005
30006         * modifiers.cs: Do not use `parent', instead use the real type
30007         container to evaluate permission settings.
30008
30009         * class.cs: Put Ravi's patch back in.  He is right, and we will
30010         have to cope with the
30011
30012 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30013
30014         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30015         FamORAssem, not FamANDAssem.
30016
30017 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30018
30019         * driver.cs: Added --parse option that only parses its input files
30020         and terminates.
30021
30022         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30023         incorrect.  IsTopLevel is not used to tell whether an object is
30024         root_types or not (that can be achieved by testing this ==
30025         root_types).  But to see if this is a top-level *class* (not
30026         necessarly our "toplevel" container). 
30027
30028 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30029
30030         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30031         parent instead of a direct call to GetType.
30032
30033 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30034
30035         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30036         Modifiers.TypeAttr. This should just be a call to that method.
30037
30038         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30039         object so that we can determine if we are top-level or not.
30040
30041         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30042         TypeContainer too.
30043
30044         * enum.cs (Enum::Define): Ditto.
30045
30046         * modifiers.cs (FieldAttr): Re-write.
30047
30048         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30049         (TypeContainer::HaveStaticConstructor): New property to provide access
30050         to precisely that info.
30051
30052         * modifiers.cs (MethodAttr): Re-write.
30053         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30054
30055         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30056         of top-level types as claimed.
30057
30058 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30059
30060         * expression.cs (MemberLookup): Fruitless attempt to lookup
30061         constructors.  Maybe I need to emit default constructors?  That
30062         might be it (currently .NET emits this for me automatically).
30063         (Invocation::OverloadResolve): Cope with Arguments == null.
30064         (Invocation::EmitArguments): new function, shared by the new
30065         constructor and us.
30066         (Invocation::Emit): Handle static and instance methods.  Emit
30067         proper call instruction for virtual or non-virtual invocations.
30068         (New::Emit): Implement.
30069         (New::Resolve): Implement.
30070         (MemberAccess:Resolve): Implement.
30071         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30072         to track instances.
30073         (FieldExpr::Resolve): Set type.
30074
30075         * support.cs: Handle empty arguments.
30076                 
30077         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30078         SimpleLookup): Auxiliary routines to help parse a qualifier
30079         identifier.  
30080
30081         Update qualifier_identifier rule.
30082
30083         * codegen.cs: Removed debugging messages.
30084
30085         * class.cs: Make this a global thing, this acts just as a "key" to
30086         objects that we might have around.
30087
30088         (Populate): Only initialize method_builders_to_methods once.
30089
30090         * expression.cs (PropertyExpr): Initialize type from the
30091         PropertyType. 
30092
30093         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30094         Resolve pattern.  Attempt to implicitly convert value to boolean.
30095         Emit code.
30096
30097         * expression.cs: Set the type for the int32/int32 argument case.
30098         (Binary::ResolveOperator): Set the return type to boolean for
30099         comparission operators
30100
30101         * typemanager.cs: Remove debugging print code.
30102
30103         (Invocation::Resolve): resolve type.
30104
30105         * class.cs: Allocate a MemberInfo of the correct size, as the code
30106         elsewhere depends on the test to reflect the correct contents.
30107
30108         (Method::) Keep track of parameters, due to System.Reflection holes
30109
30110         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30111         mapping here.
30112
30113         (TypeContainer::FindMembers): Use ArrayList and then copy an array
30114         of the exact size and return that.
30115
30116         (Class::LookupMethodByBuilder): New function that maps
30117         MethodBuilders to its methods.  Required to locate the information
30118         on methods because System.Reflection bit us again.
30119
30120         * support.cs: New file, contains an interface ParameterData and
30121         two implementations: ReflectionParameters and InternalParameters
30122         used to access Parameter information.  We will need to grow this
30123         as required.
30124
30125         * expression.cs (Invocation::GetParameterData): implement a cache
30126         and a wrapper around the ParameterData creation for methods. 
30127         (Invocation::OverloadResolve): Use new code.
30128
30129 2001-09-13  Ravi Pratap  <ravi@ximian.com>
30130
30131         * class.cs (TypeContainer::EmitField): Remove and move into 
30132         (Field::Define): here and modify accordingly.
30133         (Field.FieldBuilder): New member.
30134         (TypeContainer::Populate): Update accordingly.
30135         (TypeContainer::FindMembers): Implement.
30136
30137 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30138
30139         * statement.cs: (VariableInfo::VariableType): New field to be
30140         initialized with the full type once it is resolved. 
30141
30142 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
30143
30144         * parameter.cs (GetParameterInfo): Use a type cache to compute
30145         things only once, and to reuse this information
30146
30147         * expression.cs (LocalVariableReference::Emit): Implement.
30148         (OpcodeCast::Emit): fix.
30149
30150         (ParameterReference::Resolve): Implement.
30151         (ParameterReference::Emit): Implement.
30152
30153         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30154         that are expressions need to stay as Expressions.
30155
30156         * typemanager.cs (CSharpName): Returns the C# name of a type if
30157         possible. 
30158
30159         * expression.cs (Expression::ConvertImplicit): New function that
30160         implements implicit type conversions.
30161
30162         (Expression::ImplicitReferenceConversion): Implements implicit
30163         reference conversions.
30164
30165         (EmptyCast): New type for transparent casts.
30166
30167         (OpcodeCast): New type for casts of types that are performed with
30168         a sequence of bytecodes.
30169
30170         (BoxedCast): New type used for casting value types into reference
30171         types.  Emits a box opcode.
30172
30173         (Binary::DoNumericPromotions): Implements numeric promotions of
30174         and computation of the Binary::Type.
30175
30176         (Binary::EmitBranchable): Optimization.
30177
30178         (Binary::Emit): Implement code emission for expressions.
30179
30180         * typemanager.cs (TypeManager): Added two new core types: sbyte
30181         and byte.
30182
30183 2001-09-12  Ravi Pratap  <ravi@ximian.com>
30184
30185         * class.cs (TypeContainer::FindMembers): Method which does exactly
30186         what Type.FindMembers does, only we don't have to use reflection. No
30187         implementation yet.
30188
30189         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30190         typecontainer objects as we need to get at them.
30191         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30192
30193         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30194         typecontainer object.
30195
30196         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30197         of just a Report object.
30198
30199 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30200
30201         * class.cs (Event::Define): Go back to using the prefixes "add_" and
30202         "remove_"
30203         (TypeContainer::Populate): Now define the delegates of the type too.
30204         (TypeContainer.Delegates): Property to access the list of delegates defined
30205         in the type.
30206
30207         * delegates.cs (Delegate::Define): Implement partially.
30208
30209         * modifiers.cs (TypeAttr): Handle more flags.
30210
30211 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30212
30213         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30214         and not <=
30215         (Operator::Define): Re-write logic to get types by using the LookupType method
30216         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30217         (Indexer::Define): Ditto.
30218         (Event::Define): Ditto.
30219         (Property::Define): Ditto.
30220
30221 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30222
30223         * class.cs (TypeContainer::Populate): Now define operators too. 
30224         (TypeContainer.Operators): New property to access the list of operators
30225         in a type.
30226         (Operator.OperatorMethodBuilder): New member to hold the method builder
30227         for the operator we are defining.
30228         (Operator::Define): Implement.
30229
30230 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30231
30232         * class.cs (Event::Define): Make the prefixes of the accessor methods
30233         addOn_ and removeOn_ 
30234
30235         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30236         of the location being passed in too. Ideally, this should go later since all
30237         error reporting should be done through the Report object.
30238
30239         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30240         (Populate): Iterate thru the indexers we have and define them too.
30241         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30242         for the get and set accessors.
30243         (Indexer::Define): Implement.
30244
30245 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30246
30247         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30248         my previous implementation, did not work.
30249
30250         * typemanager.cs: Add a couple of missing types (the longs).
30251
30252         * literal.cs: Use TypeManager.bool_type instead of getting it.
30253
30254         * expression.cs (EventExpr): New kind of expressions.
30255         (Expressio::ExprClassFromMemberInfo): finish
30256
30257 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30258
30259         * assign.cs: Emit stores to static fields differently.
30260
30261 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30262
30263         * Merge in changes and adjust code to tackle conflicts. Backed out my
30264         code in Assign::Resolve ;-) 
30265
30266 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30267
30268         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30269         instead Report.Error and also pass in the location.
30270         (CSharpParser::Lexer): New readonly property to return the reference
30271         to the Tokenizer object.
30272         (declare_local_variables): Use Report.Error with location instead of plain 
30273         old error.
30274         (CheckDef): Ditto.
30275
30276         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30277         (Operator.CheckBinaryOperator): Ditto.
30278
30279         * cs-parser.jay (operator_declarator): Update accordingly.
30280
30281         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30282         (CheckBinaryOperator): Same here.
30283
30284         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30285         on the name without any prefixes of namespace names etc. This is because we
30286         already might have something already fully qualified like 
30287         'System.Console.WriteLine'
30288
30289         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30290
30291 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30292
30293         * cs-tokenizer.cs (location): Return a string which also contains
30294         the file name.
30295
30296         * expression.cs (ElementAccess): New class for expressions of the
30297         type 'element access.'
30298         (BaseAccess): New class for expressions of the type 'base access.'
30299         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30300         respectively.
30301
30302         * cs-parser.jay (element_access): Implement action.
30303         (base_access): Implement actions.
30304         (checked_expression, unchecked_expression): Implement.
30305
30306         * cs-parser.jay (local_variable_type): Correct and implement.
30307         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30308
30309         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30310
30311         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30312         name and the specifiers.
30313
30314         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30315
30316         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30317         making them all public ;-)
30318
30319         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30320         class anyways.
30321
30322 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30323
30324         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30325         PropertyExprs.
30326         (FieldExpr, PropertyExprs): New resolved expressions.
30327         (SimpleName::MemberStaticCheck): Perform static checks for access
30328         to non-static fields on static methods. Maybe this should be
30329         generalized for MemberAccesses. 
30330         (SimpleName::ResolveSimpleName): More work on simple name
30331         resolution. 
30332
30333         * cs-parser.jay (primary_expression/qualified_identifier): track
30334         the parameter index.
30335
30336         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30337         (EmitContext::EmitBoolExpression): Chain to expression generation
30338         instead of temporary hack.
30339         (::EmitStatementExpression): Put generic expression code generation.
30340
30341         * assign.cs (Assign::Emit): Implement variable assignments to
30342         local variables, parameters and fields.
30343
30344 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30345
30346         * statement.cs (Block::GetVariableInfo): New method, returns the
30347         VariableInfo for a variable name in a block.
30348         (Block::GetVariableType): Implement in terms of GetVariableInfo
30349
30350         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30351         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30352
30353 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30354
30355         * cs-parser.jay (operator_declaration): Continue on my quest : update
30356         to take attributes argument.
30357         (event_declaration): Ditto.
30358         (enum_declaration): Ditto.
30359         (indexer_declaration): Ditto.
30360
30361         * class.cs (Operator::Operator): Update constructor accordingly.
30362         (Event::Event): Ditto.
30363
30364         * delegate.cs (Delegate::Delegate): Same here.
30365
30366         * enum.cs (Enum::Enum): Same here.
30367
30368 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30369
30370         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30371
30372         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30373
30374         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30375         being passed around as an arraylist.
30376         (Attributes::AddAttribute): Method to add attribute sections.
30377
30378         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30379         (struct_declaration): Update accordingly.
30380         (constant_declaration): Update.
30381         (field_declaration): Update.
30382         (method_header): Update.
30383         (fixed_parameter): Update.
30384         (parameter_array): Ditto.
30385         (property_declaration): Ditto.
30386         (destructor_declaration): Ditto.
30387
30388         * class.cs (Struct::Struct): Update constructors accordingly.
30389         (Class::Class): Ditto.
30390         (Field::Field): Ditto.
30391         (Method::Method): Ditto.
30392         (Property::Property): Ditto.
30393         (TypeContainer::OptAttribute): update property's return type.
30394
30395         * interface.cs (Interface.opt_attributes): New member.
30396         (Interface::Interface): Update to take the extra Attributes argument.
30397
30398         * parameter.cs (Parameter::Parameter): Ditto.
30399
30400         * constant.cs (Constant::Constant): Ditto.
30401
30402         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30403         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30404         the attributes as a parameter.
30405         (InterfaceProperty): Update constructor call.
30406         (InterfaceEvent): Ditto.
30407         (InterfaceMethod): Ditto.
30408         (InterfaceIndexer): Ditto.
30409
30410         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30411         pass the attributes too.
30412         (interface_event_declaration): Ditto.
30413         (interface_property_declaration): Ditto.
30414         (interface_method_declaration): Ditto.
30415         (interface_declaration): Ditto.
30416
30417 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30418
30419         * class.cs (Method::Define): Track the "static Main" definition to
30420         create an entry point. 
30421
30422         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30423         EntryPoint if we find it. 
30424
30425         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30426         (EmitContext::ig): Make this variable public.
30427
30428         * driver.cs: Make the default output file be the first file name
30429         with the .exe extension.  
30430
30431         Detect empty compilations
30432
30433         Handle various kinds of output targets.  Handle --target and
30434         rename -t to --dumper.
30435
30436         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30437         methods inherited from Expression return now an Expression.  This
30438         will is used during the tree rewriting as we resolve them during
30439         semantic analysis.
30440
30441         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30442         the spec.  Missing entirely is the information about
30443         accessability of elements of it.
30444
30445         (Expression::ExprClassFromMemberInfo): New constructor for
30446         Expressions that creates a fully initialized Expression based on
30447         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30448         a Type.
30449
30450         (Invocation::Resolve): Begin implementing resolution of invocations.
30451
30452         * literal.cs (StringLiteral):  Implement Emit.
30453
30454 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30455
30456         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30457         member.
30458
30459 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30460
30461         * cs-parser.jay (attribute_arguments): Implement actions.
30462         (attribute): Fix bug in production. Implement action.
30463         (attribute_list): Implement.
30464         (attribute_target): Implement.
30465         (attribute_target_specifier, opt_target_specifier): Implement
30466         (CheckAttributeTarget): New method to check if the attribute target
30467         is valid.
30468         (attribute_section): Implement.
30469         (opt_attributes): Implement.
30470
30471         * attribute.cs : New file to handle attributes.
30472         (Attribute): Class to hold attribute info.
30473
30474         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30475         (attribute_section): Modify production to use 2 different rules to 
30476         achieve the same thing. 1 s/r conflict down !
30477         Clean out commented, useless, non-reducing dimension_separator rules.
30478
30479         * class.cs (TypeContainer.attributes): New member to hold list
30480         of attributes for a type.
30481         (Struct::Struct): Modify to take one more argument, the attribute list.
30482         (Class::Class): Ditto.
30483         (Field::Field): Ditto.
30484         (Method::Method): Ditto.
30485         (Property::Property): Ditto.
30486
30487         * cs-parser.jay (struct_declaration): Update constructor call to
30488         pass in the attributes too.
30489         (class_declaration): Ditto.
30490         (constant_declaration): Ditto.
30491         (field_declaration): Ditto.
30492         (method_header): Ditto.
30493         (fixed_parameter): Ditto.
30494         (parameter_array): Ditto.
30495         (property_declaration): Ditto.
30496
30497         * constant.cs (Constant::Constant): Update constructor similarly.
30498         Use System.Collections.
30499
30500         * parameter.cs (Parameter::Parameter): Update as above.
30501
30502 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30503
30504         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30505         (TypeContainer.delegates): New member to hold list of delegates.
30506
30507         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30508         this time as I seem to be on crack ;-)
30509
30510 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30511
30512         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30513         tell whether an identifier represents a namespace.
30514
30515         * expression.cs (NamespaceExpr): A namespace expression, used only
30516         temporarly during expression resolution.
30517         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30518         utility functions to resolve names on expressions.
30519
30520 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30521
30522         * codegen.cs: Add hook for StatementExpressions. 
30523
30524         * class.cs: Fix inverted test for static flag in methods.
30525
30526 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30527
30528         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30529         to make it coincide with MS' number.
30530         (Operator::CheckBinaryOperator): Ditto.
30531
30532         * ../errors/errors.txt : Remove error numbers added earlier.
30533
30534         * ../errors/cs1019.cs : Test case for error # 1019
30535
30536         * ../errros/cs1020.cs : Test case for error # 1020
30537
30538         * cs-parser.jay : Clean out commented cruft.
30539         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30540         used anywhere - non-reducing rule.
30541         (namespace_declarations): Non-reducing rule - comment out.
30542
30543         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30544         with TypeContainer::AddEnum.
30545
30546         * delegate.cs : New file for delegate handling classes.
30547         (Delegate): Class for declaring delegates.
30548
30549         * makefile : Update.
30550
30551         * cs-parser.jay (delegate_declaration): Implement.
30552
30553 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30554
30555         * class.cs (Event::Define): Implement.
30556         (Event.EventBuilder): New member.
30557
30558         * class.cs (TypeContainer::Populate): Update to define all enums and events
30559         we have.
30560         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30561         readonly fields for all these cases ?
30562
30563 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30564
30565         * class.cs (Property): Revamp to use the convention of making fields readonly.
30566         Accordingly modify code elsewhere.
30567
30568         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30569         the Define method of the Property class.
30570
30571         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30572         trivial bug.
30573         (TypeContainer::Populate): Update to define all the properties we have. Also
30574         define all enumerations.
30575
30576         * enum.cs (Define): Implement.
30577
30578 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30579
30580         * cs-parser.jay (overloadable_operator): The semantic value is an
30581         enum of the Operator class.
30582         (operator_declarator): Implement actions.
30583         (operator_declaration): Implement.
30584
30585         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30586         validity of definitions.
30587         (Operator::CheckBinaryOperator): Static method to check for binary operators
30588         (TypeContainer::AddOperator): New method to add an operator to a type.
30589
30590         * cs-parser.jay (indexer_declaration): Added line to actually call the
30591         AddIndexer method so it gets added ;-)
30592
30593         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30594         already taken care of by the MS compiler ?  
30595
30596 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30597
30598         * class.cs (Operator): New class for operator declarations.
30599         (Operator::OpType): Enum for the various operators.
30600
30601 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30602
30603         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30604         ostensibly handle this in semantic analysis.
30605
30606         * cs-parser.jay (general_catch_clause): Comment out
30607         (specific_catch_clauses, specific_catch_clause): Ditto.
30608         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30609         (catch_args, opt_catch_args): New productions.
30610         (catch_clause): Rewrite to use the new productions above
30611         (catch_clauses): Modify accordingly.
30612         (opt_catch_clauses): New production to use in try_statement
30613         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30614         and re-write the code in the actions to extract the specific and
30615         general catch clauses by being a little smart ;-)
30616
30617         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30618         Hooray, try and catch statements parse fine !
30619
30620 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30621
30622         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30623         string from the hashtable of variables.
30624
30625         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30626         I end up making that mistake ;-)
30627         (catch_clauses): Fixed gross error which made Key and Value of the 
30628         DictionaryEntry the same : $1 !!
30629
30630 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30631
30632         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30633
30634         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30635         when the add and remove accessors are specified. 
30636
30637 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30638
30639         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30640         information about indexer_declarator.
30641         (indexer_declarator): Implement actions.
30642         (parsing_indexer): New local boolean used to keep track of whether
30643         we are parsing indexers or properties. This is necessary because 
30644         implicit_parameters come into picture even for the get accessor in the 
30645         case of an indexer.
30646         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30647
30648         * class.cs (Indexer): New class for indexer declarations.
30649         (TypeContainer::AddIndexer): New method to add an indexer to a type.
30650         (TypeContainer::indexers): New member to hold list of indexers for the
30651         type.
30652
30653 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30654
30655         * cs-parser.jay (add_accessor_declaration): Implement action.
30656         (remove_accessor_declaration): Implement action.
30657         (event_accessors_declaration): Implement
30658         (variable_declarators): swap statements for first rule - trivial.
30659
30660         * class.cs (Event): New class to hold information about event
30661         declarations.
30662         (TypeContainer::AddEvent): New method to add an event to a type
30663         (TypeContainer::events): New member to hold list of events.
30664
30665         * cs-parser.jay (event_declaration): Implement actions.
30666
30667 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30668
30669         * cs-parser.jay (dim_separators): Implement. Make it a string
30670         concatenating all the commas together, just as they appear.
30671         (opt_dim_separators): Modify accordingly
30672         (rank_specifiers): Update accordingly. Basically do the same
30673         thing - instead, collect the brackets here.
30674         (opt_rank_sepcifiers): Modify accordingly.
30675         (array_type): Modify to actually return the complete type string
30676         instead of ignoring the rank_specifiers.
30677         (expression_list): Implement to collect the expressions
30678         (variable_initializer): Implement. We make it a list of expressions
30679         essentially so that we can handle the array_initializer case neatly too.
30680         (variable_initializer_list): Implement.
30681         (array_initializer): Make it a list of variable_initializers
30682         (opt_array_initializer): Modify accordingly.
30683
30684         * expression.cs (New::NType): Add enumeration to help us
30685         keep track of whether we have an object/delegate creation
30686         or an array creation.
30687         (New:NewType, New::Rank, New::Indices, New::Initializers): New
30688         members to hold data about array creation.
30689         (New:New): Modify to update NewType
30690         (New:New): New Overloaded contructor for the array creation
30691         case.
30692
30693         * cs-parser.jay (array_creation_expression): Implement to call
30694         the overloaded New constructor.
30695
30696 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
30697
30698         * class.cs (TypeContainer::Constructors): Return member
30699         constructors instead of returning null.
30700
30701 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
30702
30703         * typemanager.cs (InitCoreTypes): Initialize the various core
30704         types after we have populated the type manager with the user
30705         defined types (this distinction will be important later while
30706         compiling corlib.dll)
30707
30708         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30709         on Expression Classification.  Now all expressions have a method
30710         `Resolve' and a method `Emit'.
30711
30712         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30713         generation from working.     Also add some temporary debugging
30714         code. 
30715
30716 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
30717
30718         * codegen.cs: Lots of code generation pieces.  This is only the
30719         beginning, will continue tomorrow with more touches of polish.  We
30720         handle the fundamentals of if, while, do, for, return.  Others are
30721         trickier and I need to start working on invocations soon.
30722
30723         * gen-treedump.cs: Bug fix, use s.Increment here instead of
30724         s.InitStatement. 
30725
30726         * codegen.cs (EmitContext): New struct, used during code
30727         emission to keep a context.   Most of the code generation will be
30728         here. 
30729
30730         * cs-parser.jay: Add embedded blocks to the list of statements of
30731         this block.  So code generation proceeds in a top down fashion.
30732
30733 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
30734
30735         * statement.cs: Add support for multiple child blocks.
30736
30737 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
30738
30739         * codegen.cs (EmitCode): New function, will emit the code for a
30740         Block of code given a TypeContainer and its ILGenerator. 
30741
30742         * statement.cs (Block): Standard public readonly optimization.
30743         (Block::Block constructors): Link children. 
30744         (Block::Child): Child Linker.
30745         (Block::EmitVariables): Emits IL variable declarations.
30746
30747         * class.cs: Drop support for MethodGroups here, delay until
30748         Semantic Analysis.
30749         (Method::): Applied the same simplification that I did before, and
30750         move from Properties to public readonly fields.
30751         (Method::ParameterTypes): Returns the parameter types for the
30752         function, and implements a cache that will be useful later when I
30753         do error checking and the semantic analysis on the methods is
30754         performed.
30755         (Constructor::GetCallingConvention): Renamed from CallingConvetion
30756         and made a method, optional argument tells whether this is a class
30757         or a structure to apply the `has-this' bit.
30758         (Method::GetCallingConvention): Implement, returns the calling
30759         convention. 
30760         (Method::Define): Defines the type, a second pass is performed
30761         later to populate the methods.
30762
30763         (Constructor::ParameterTypes): implement a cache similar to the
30764         one on Method::ParameterTypes, useful later when we do semantic
30765         analysis. 
30766
30767         (TypeContainer::EmitMethod):  New method.  Emits methods.
30768
30769         * expression.cs: Removed MethodGroup class from here.
30770
30771         * parameter.cs (Parameters::GetCallingConvention): new method.
30772
30773 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
30774
30775         * class.cs (TypeContainer::Populate): Drop RootContext from the
30776         argument. 
30777
30778         (Constructor::CallingConvention): Returns the calling convention.
30779         (Constructor::ParameterTypes): Returns the constructor parameter
30780         types. 
30781
30782         (TypeContainer::AddConstructor): Keep track of default constructor
30783         and the default static constructor.
30784
30785         (Constructor::) Another class that starts using `public readonly'
30786         instead of properties. 
30787
30788         (Constructor::IsDefault): Whether this is a default constructor. 
30789
30790         (Field::) use readonly public fields instead of properties also.
30791
30792         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30793         track of static constructors;  If none is used, turn on
30794         BeforeFieldInit in the TypeAttributes. 
30795
30796         * cs-parser.jay (opt_argument_list): now the return can be null
30797         for the cases where there are no arguments. 
30798
30799         (constructor_declarator): If there is no implicit `base' or
30800         `this', then invoke the default parent constructor. 
30801
30802         * modifiers.cs (MethodAttr): New static function maps a set of
30803         modifiers flags into a MethodAttributes enum
30804         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
30805         MethodAttr, TypeAttr to represent the various mappings where the
30806         modifiers are used.
30807         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
30808
30809 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
30810
30811         * parameter.cs (GetParameterInfo): Fix bug where there would be no
30812         method arguments.
30813
30814         * interface.cs (PopulateIndexer): Implemented the code generator
30815         for interface indexers.
30816
30817 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
30818
30819         * interface.cs (InterfaceMemberBase): Now we track the new status
30820         here.  
30821
30822         (PopulateProperty): Implement property population.  Woohoo!  Got
30823         Methods and Properties going today. 
30824
30825         Removed all the properties for interfaces, and replaced them with
30826         `public readonly' fields. 
30827
30828 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
30829
30830         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30831         initialize their hashtables/arraylists only when they are needed
30832         instead of doing this always.
30833
30834         * parameter.cs: Handle refs and out parameters.
30835
30836         * cs-parser.jay: Use an ArrayList to construct the arguments
30837         instead of the ParameterCollection, and then cast that to a
30838         Parameter[] array.
30839
30840         * parameter.cs: Drop the use of ParameterCollection and use
30841         instead arrays of Parameters.
30842
30843         (GetParameterInfo): Use the Type, not the Name when resolving
30844         types. 
30845
30846 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
30847
30848         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30849         and instead use public readonly fields.
30850
30851         * class.cs: Put back walking code for type containers.
30852
30853 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
30854
30855         * class.cs (MakeConstant): Code to define constants.
30856
30857         * rootcontext.cs (LookupType): New function.  Used to locate types 
30858
30859
30860 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
30861
30862         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
30863         this System.Reflection code is.  Kudos to Microsoft
30864
30865         * typemanager.cs: Implement a type cache and avoid loading all
30866         types at boot time.  Wrap in LookupType the internals.  This made
30867         the compiler so much faster.  Wow.  I rule!
30868
30869         * driver.cs: Make sure we always load mscorlib first (for
30870         debugging purposes, nothing really important).
30871
30872         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
30873         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
30874
30875         * rootcontext.cs: Lookup types on their namespace;  Lookup types
30876         on namespaces that have been imported using the `using' keyword.
30877
30878         * class.cs (TypeContainer::TypeAttr): Virtualize.
30879         (Class::TypeAttr): Return attributes suitable for this bad boy.
30880         (Struct::TypeAttr): ditto.
30881         Handle nested classes.
30882         (TypeContainer::) Remove all the type visiting code, it is now
30883         replaced with the rootcontext.cs code
30884
30885         * rootcontext.cs (GetClassBases): Added support for structs. 
30886
30887 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
30888
30889         * interface.cs, statement.cs, class.cs, parameter.cs,
30890         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30891         Drop use of TypeRefs, and use strings instead.
30892
30893 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
30894
30895         * rootcontext.cs: 
30896
30897         * class.cs (Struct::Struct): set the SEALED flags after
30898         checking the modifiers.
30899         (TypeContainer::TypeAttr): new property, returns the
30900         TypeAttributes for a class.  
30901
30902         * cs-parser.jay (type_list): Oops, list production was creating a
30903         new list of base types.
30904
30905         * rootcontext.cs (StdLib): New property.
30906         (GetInterfaceTypeByName): returns an interface by type name, and
30907         encapsulates error handling here.
30908         (GetInterfaces): simplified.
30909         (ResolveTree): Encapsulated all the tree resolution here.
30910         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30911         types. 
30912
30913         * driver.cs: Add support for --nostdlib, to avoid loading the
30914         default assemblies.
30915         (Main): Do not put tree resolution here. 
30916
30917         * rootcontext.cs: Beginning of the class resolution.
30918
30919 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
30920
30921         * rootcontext.cs: Provide better error reporting. 
30922
30923         * cs-parser.jay (interface_base): set our $$ to be interfaces.
30924
30925         * rootcontext.cs (CreateInterface): Handle the case where there
30926         are no parent interfaces.
30927
30928         (CloseTypes): Routine to flush types at the end.
30929         (CreateInterface): Track types.
30930         (GetInterfaces): Returns an array of Types from the list of
30931         defined interfaces.
30932
30933         * typemanager.c (AddUserType): Mechanism to track user types (puts
30934         the type on the global type hash, and allows us to close it at the
30935         end). 
30936
30937 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
30938
30939         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30940         RecordInterface instead.
30941
30942         * cs-parser.jay: Updated to reflect changes above.
30943
30944         * decl.cs (Definition): Keep track of the TypeBuilder type that
30945         represents this type here.  Not sure we will use it in the long
30946         run, but wont hurt for now.
30947
30948         * driver.cs: Smaller changes to accomodate the new code.
30949
30950         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30951         when done. 
30952
30953         * rootcontext.cs (CreateInterface):  New method, used to create
30954         the System.TypeBuilder type for interfaces.
30955         (ResolveInterfaces): new entry point to resolve the interface
30956         hierarchy. 
30957         (CodeGen): Property, used to keep track of the code generator.
30958
30959 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
30960
30961         * cs-parser.jay: Add a second production for delegate_declaration
30962         with `VOID'.
30963
30964         (enum_body): Put an opt_comma here instead of putting it on
30965         enum_body or enum_member_declarations so we can handle trailing
30966         commas on enumeration members.  Gets rid of a shift/reduce.
30967
30968         (type_list): Need a COMMA in the middle.
30969
30970         (indexer_declaration): Tell tokenizer to recognize get/set
30971
30972         * Remove old targets.
30973
30974         * Re-add the parser target.
30975
30976 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30977
30978         * cs-parser.jay: Add precendence rules for a number of operators
30979         ot reduce the number of shift/reduce conflicts in the grammar.
30980
30981 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
30982
30983         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30984         and put it here.
30985
30986         Get rid of old crufty code.
30987
30988         * rootcontext.cs: Use this to keep track of the parsed
30989         representation and the defined types available to the program. 
30990
30991         * gen-treedump.cs: adjust for new convention.
30992
30993         * type.cs: Split out the type manager, and the assembly builder
30994         from here. 
30995
30996         * typemanager.cs: the type manager will live here now.
30997
30998         * cil-codegen.cs: And the code generator here. 
30999
31000 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31001
31002         * makefile: Fixed up for easy making.
31003
31004 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31005
31006         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31007         the 
31008
31009         (unary_expression): Expand pre_increment_expression and
31010         post_decrement_expression to reduce a shift/reduce.
31011
31012 2001-07-11  Simon Cozens
31013
31014         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31015
31016         Improve allow_keyword_as_indent name.
31017
31018 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31019
31020         * Adjustments for Beta2. 
31021
31022 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31023
31024         * decl.cs: Added `Define' abstract method.
31025         (InTransit): new property, used to catch recursive definitions. 
31026
31027         * interface.cs: Implement `Define'. 
31028
31029         * modifiers.cs: Map Modifiers.constants to
31030         System.Reflection.TypeAttribute flags.
31031
31032         * class.cs: Keep track of types and user-defined types.
31033         (BuilderInit): New method for creating an assembly
31034         (ResolveType): New function to launch the resolution process, only
31035         used by interfaces for now.
31036
31037         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31038         that are inserted into the name space. 
31039
31040 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31041
31042         * ARGH.  I have screwed up my tree so many times due to the use of
31043         rsync rather than using CVS.  Going to fix this at once. 
31044
31045         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31046         load types.
31047
31048 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31049
31050         * Experiment successful: Use System.Type rather that our own
31051         version of Type.  
31052
31053 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31054
31055         * cs-parser.jay: Removed nsAliases from here.
31056
31057         Use new namespaces, handle `using XXX;' 
31058
31059         * namespace.cs: Reimplemented namespace handling, use a recursive
31060         definition of the class.  Now we can keep track of using clauses
31061         and catch invalid using clauses.
31062
31063 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31064
31065         * gen-treedump.cs: Adapted for all the renaming.
31066
31067         * expression.cs (Expression): this class now has a Type property
31068         which returns an expression Type.
31069
31070         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31071         `Type', as this has a different meaning now in the base
31072
31073 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31074
31075         * interface.cs, class.cs: Removed from all the sources the
31076         references to signature computation, as we can not do method
31077         signature computation during the parsing time, as we are not
31078         trying to solve at that point distinguishing:
31079
31080         class X {
31081                 void a (Blah x) {}
31082                 void a (NS.Blah x) {}
31083         }
31084
31085         Which depending on the context might be valid or not, as we do not
31086         know if Blah is the same thing as NS.Blah at that point.
31087
31088         * Redid everything so the code uses TypeRefs now instead of
31089         Types.  TypeRefs are just temporary type placeholders, that need
31090         to be resolved.  They initially have a pointer to a string and the
31091         current scope in which they are used.  This is used later by the
31092         compiler to resolve the reference to an actual Type. 
31093
31094         * DeclSpace is no longer a CIR.Type, and neither are
31095         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31096         are all DeclSpaces, but no Types. 
31097
31098         * type.cs (TypeRefManager): This implements the TypeRef manager,
31099         which keeps track of all the types that need to be resolved after
31100         the parsing has finished. 
31101
31102 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31103
31104         * ARGH.  We are going to have to store `foreach' as a class rather
31105         than resolving it, as we need to verify error 1579 after name
31106         resolution.   *OR* we could keep a flag that says `This request to
31107         IEnumerator comes from a foreach statement' which we can then use
31108         to generate the error.
31109
31110 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31111
31112         * class.cs (TypeContainer.AddMethod): we now add methods to the
31113         MethodGroup instead of the method hashtable.  
31114
31115         * expression.cs: Add MethodGroup abstraction, which gets us one
31116         step closer to the specification in the way we handle method
31117         declarations.  
31118
31119         * cs-parser.jay (primary_expression): qualified_identifier now
31120         tried to match up an identifier to a local variable reference or
31121         to a parameter reference.
31122
31123         current_local_parameters is now a parser global variable that
31124         points to the current parameters for the block, used during name
31125         lookup.
31126
31127         (property_declaration): Now creates an implicit `value' argument to
31128         the set accessor.
31129
31130 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
31131
31132         * parameter.cs: Do not use `param' arguments as part of the
31133         signature, per the spec.
31134
31135 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
31136
31137         * decl.cs: Base class for classes, structs and interfaces.  This
31138         is the "Declaration Space" 
31139
31140         * cs-parser.jay: Use CheckDef for checking declaration errors
31141         instead of having one on each function.
31142
31143         * class.cs: Factor out some code for handling error handling in
31144         accordance to the "Declarations" section in the "Basic Concepts"
31145         chapter in the ECMA C# spec.
31146
31147         * interface.cs: Make all interface member classes derive from
31148         InterfaceMemberBase.
31149
31150 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
31151
31152         * Many things: all interfaces are parsed and generated in
31153         gen-treedump.  Support for member variables, constructors,
31154         destructors, properties, constants is there.
31155
31156         Beginning of the IL backend, but very little done, just there for
31157         testing purposes. 
31158
31159 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
31160
31161         * cs-parser.jay: Fix labeled statement.
31162
31163         * cs-tokenizer.cs (escape): Escape " and ' always.
31164         ref_line, ref_name: keep track of the line/filename as instructed
31165         by #line by the compiler.
31166         Parse #line.
31167
31168 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
31169
31170         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31171         to match the values in System.CodeDOM.
31172
31173         Divid renamed to Divide.
31174
31175         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31176         statements. 
31177         (Statements.set): remove.
31178
31179         * System.CodeDOM/CodeCatchClause.cs: always have a valid
31180         statements. 
31181
31182         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31183         falseStatements always have valid values. 
31184
31185         * cs-parser.jay: Use System.CodeDOM now.
31186