Nothing to see here
[mono.git] / mcs / mcs / ChangeLog
1 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
2
3         cs-tokenizer.cs: Fix typo.
4
5
6 2008-09-28  Miguel de Icaza  <miguel@novell.com>
7
8         * eval.cs (InteractiveBase): The quit command now just sets a
9         flag, instead of calling Environment.Exit(), it is milder on
10         embedded hosts. 
11
12         CompiledMethod is now in Mono.CSharp, not nested inside
13         the Evaluator, it was inconvenient to use.
14
15 2008-09-27  Miguel de Icaza  <miguel@novell.com>
16
17         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
18         code to be invoked without having to reparse.
19
20 2008-09-27  Miguel de Icaza  <miguel@novell.com>
21
22         * ecore.cs: The recent changes to FieldExpr broke this as well.
23         Fixes LINQ queries in the interactive shell.
24
25         * Multiple files: indentation fixing for the Mono coding
26         guidelines for the switch statement.
27
28         * eval.cs: Make the Evaluator API thread safe.
29
30 2008-09-26  Marek Safar  <marek.safar@gmail.com>
31
32         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
33         constructor parsing.
34
35 2008-09-26  Marek Safar  <marek.safar@gmail.com>
36
37         A fix for bug #325326
38         * statement.cs: Check possible mistaken empty statement using
39         explicit blocks only.
40
41 2008-09-25  Miguel de Icaza  <miguel@novell.com>
42
43         * eval.cs (LoadAssembly, ReferenceAssembly): Call
44         RootNamespace.ComputeNamespaces to update the internal list of
45         namespaces, this is no longer done for us.
46
47         (InteractiveBase): Use the Evaluator APIs instead of calling into
48         Driver directly
49
50 2008-09-25  Marek Safar  <marek.safar@gmail.com>
51
52         A fix for bug #429264
53         * expression.cs: Missing mutator for access to multidimensional
54         arrays.
55
56 2008-09-25  Marek Safar  <marek.safar@gmail.com>
57
58         * class.cs, statement: Emit DebuggerHidden attribute for iterator
59         entry wrapper.
60         
61         * driver.cs: Missing input argument check.
62
63 2008-09-25  Marek Safar  <marek.safar@gmail.com>
64
65         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
66         expression.cs, statement.cs, rootcontext.cs, class.cs, 
67         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
68         DefineMembers.
69
70 2008-09-24  Miguel de Icaza  <miguel@novell.com>
71
72         * ecore.cs (FieldExpr): Only initialize eclass when we return a
73         fully constructed FieldExpr, fixes the regression introduced in
74         the last commit.
75         
76         * ecore.cs, expression.cs: Plug back the eclass initialization as
77         otherwise it regresses `csharp'. 
78
79 2008-09-24  Marek Safar  <marek.safar@gmail.com>
80
81         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
82         ecore.cs, attribute.cs: Moved obsolete method checks from emit
83         phase to resolve phase. It resolves problems with expression trees
84         and fixes bugs #323796, #325156.
85
86 2008-09-23  Marek Safar  <marek.safar@gmail.com>
87
88         * codegen.cs: Report better error when symbol writer is missing.
89
90 2008-09-23  Marek Safar  <marek.safar@gmail.com>
91
92         * codegen.cs: Set .NET symbol writer.
93         
94         * decl.cs: Guard against null generic arguments.
95         
96         * report.cs: Don't report exactly same additional details.
97
98 2008-09-22  Marek Safar  <marek.safar@gmail.com>
99
100         A fix for bug #324917
101         * cs-parser.jay: Add missing multidimensional non-expression type
102         ranks.
103         
104 2008-09-22  Marek Safar  <marek.safar@gmail.com>
105
106         A fix for bug #428191
107         * anonymous.cs: Create an outer generic fields also for non-storey
108         anonymous methods.
109
110 2008-09-22  Marek Safar  <marek.safar@gmail.com>
111
112         A fix for bug #378294
113         * class.cs: Make fixed size buffers gmcs feature only.
114
115 2008-09-22  Marek Safar  <marek.safar@gmail.com>
116
117         A fix for bug #355622, #324993
118         * assign.cs, const.cs, class.cs: Create new EmitContext for each
119         field initializer.
120
121 2008-09-19  Marek Safar  <marek.safar@gmail.com>
122
123         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
124         error reporting.
125
126 2008-09-19  Marek Safar  <marek.safar@gmail.com>
127
128         A fix for bug #416110
129         * generic.cs: Struct constraint results in default ctor and
130         ValueType base type constraint to be set.
131
132 2008-09-19  Marek Safar  <marek.safar@gmail.com>
133
134         A fix for bug #423791
135         * generic.cs: Fixed params output type type-inference.
136
137 2008-09-19  Marek Safar  <marek.safar@gmail.com>
138
139         * cs-parser.jay, expression.cs: Fixed few expression crashes.
140         
141 2008-09-19  Marek Safar  <marek.safar@gmail.com>
142
143         * cs-tokenizer.cs: Don't break on extra partial modifier.
144
145 2008-09-19  Marek Safar  <marek.safar@gmail.com>
146
147         A fix for bug #427592
148         * generic.cs: Use common parameter resolve method.
149
150 2008-09-18  Marek Safar  <marek.safar@gmail.com>
151
152         A fix for bug #414758
153         * expression.cs, ecore.cs: Fixed crash when accessing non-static
154         property.
155
156 2008-09-18  Marek Safar  <marek.safar@gmail.com>
157
158         * driver.cs, namespace.cs: Read types and namespaces after all
159         requested assemblies are loaded, fixes issues with System.Core
160         auto-reference, and #419888.
161
162 2008-09-18  Marek Safar  <marek.safar@gmail.com>
163
164         A fix for bug #417705
165         * cs-parser.jay: Fixed as/is operator expression split.
166
167 2008-09-18  Marek Safar  <marek.safar@gmail.com>
168
169         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
170         Fixed expression tree representation of empty new expression and
171         new initializer expression.
172
173 2008-09-18  Miguel de Icaza  <miguel@novell.com>
174
175         * eval.cs: Remove warning, keep reference to driver around.
176
177         * Hide fields that do not need to be public.
178
179 2008-09-17  Marek Safar  <marek.safar@gmail.com>
180
181         A fix for bug #426385
182         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
183         conversion for array elements.
184
185 2008-09-17  Marek Safar  <marek.safar@gmail.com>
186
187         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
188         void parsing conflicts.
189
190 2008-09-15  Marek Safar  <marek.safar@gmail.com>
191
192         A fix for bug #425601
193         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
194         System.Core only when there is no custom ExtensionAttribute
195         implementation.
196
197 2008-09-15  Miguel de Icaza  <miguel@novell.com>
198
199         * namespace.cs: Do not report CS0246 (name
200
201 2008-09-12  Marek Safar  <marek.safar@gmail.com>
202
203         A fix for bug #425669
204         * generic.cs: Don't cache generic static anonymous method 
205         containers.
206
207 2008-09-12  Marek Safar  <marek.safar@gmail.com>
208
209         * generic.cs, class.cs, delegate.cs: Check recursive inherited
210         conflicting constraints.
211
212 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
213
214         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
215         mcs too.
216
217 2008-09-12  Marek Safar  <marek.safar@gmail.com>
218
219         * literal.cs, convert.cs, expression.cs, statement.cs: More null
220         to null pointer conversion fixes.
221
222 2008-09-11  Marek Safar  <marek.safar@gmail.com>
223
224         * cs-parser.jay, expression.cs: An implicitly typed local variable
225         declarator cannot use an array initializer.
226
227 2008-09-11  Marek Safar  <marek.safar@gmail.com>
228
229         * cs-parser.jay: Reduced number of printed tokens, add sorting.
230
231 2008-09-11  Marek Safar  <marek.safar@gmail.com>
232
233         * generic.cs (InflatedConstraints): Don't crash when constraints
234         are different.
235         
236         * cs-parser.jay: const_declarator is a block.
237
238         * constant.cs: Check for not allowed NaN conversions.
239
240 2008-09-10  Miguel de Icaza  <miguel@novell.com>
241
242         * driver.cs: Drop --shell argument, the compiler is no longer a
243         REPL. 
244
245         * eval.cs: Move most of the code that deals with evaluation into
246         this file and document the public API from repl.cs
247
248         * repl.cs: Remove from here.
249         
250 2008-09-10  Marek Safar  <marek.safar@gmail.com>
251
252         A fix for bug #424684
253         * generic.cs: Generic class constraints must come first.
254
255 2008-09-09  Miguel de Icaza  <miguel@novell.com>
256
257         * cs-parser.jay: Improve error reporting for syntax errors in
258         statements and expressions, we now report the expected tokens
259         instead of reporting the useless "; expected".
260
261         Drop the strings from the token declaration, it turns out that
262         they did not do what I thought they did.  Instead they were adding
263         two sets of tokens to the tables.
264
265 2008-09-09  Marek Safar  <marek.safar@gmail.com>
266
267         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
268         delegate.cs: Share special type check.
269
270 2008-09-09  Marek Safar  <marek.safar@gmail.com>
271
272         A fix for bug #423981
273         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
274
275 2008-09-09  Marek Safar  <marek.safar@gmail.com>
276
277         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
278         ConvertImplicitly.
279
280 2008-09-09  Marek Safar  <marek.safar@gmail.com>
281
282         A fix for bugs: #324750, #335946
283         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
284         lookup rule to determine ?-based tokens.
285
286 2008-09-08  Miguel de Icaza  <miguel@novell.com>
287
288         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
289         expressions (like event adding or removing) end up here, so we
290         need to treat those as statements.
291
292         Add LoadAssembly method.
293
294 2008-09-04  Miguel de Icaza  <miguel@novell.com>
295
296         * repl.cs: Add Time method.
297
298 2008-09-05  Marek Safar  <marek.safar@gmail.com>
299
300         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
301
302 2008-09-05  Miguel de Icaza  <miguel@novell.com>
303
304         * repl.cs: Add workaround for old compilers.
305
306 2008-09-04  Jb Evain  <jbevain@novell.com>
307
308         * repl.cs (PrettyPrint): pretty print everything that
309         implements IDictionary, as well as IEnumerables. Also,
310         add a quit helper property.
311
312 2008-09-04  Marek Safar  <marek.safar@gmail.com>
313
314         * constant.cs: Better error reporting for decimal literals.
315         
316         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
317         field attributes.
318         
319 2008-09-04  Marek Safar  <marek.safar@gmail.com>
320                         Miguel de Icaza  <miguel@novell.com>
321
322         A fix for bug #422951
323         * assign.cs (Assign.DoResolve): Perform the type conversions
324         checks before we attempt to initialize `New' initializers. 
325
326 2008-09-04  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #422853
329         * delegate.cs (DelegateCreation): Add special handling for
330         EmptyExpression.Null instance expression which is just another
331         hack for undecided member instance exression.
332
333 2008-09-04  Marek Safar  <marek.safar@gmail.com>
334
335         * expression.cs, ecore.cs: Emit full expression tree for reduced
336         binary expressions.
337
338 2008-09-04  Marek Safar  <marek.safar@gmail.com>
339
340         * expression.cs (This): Guard against multi-resolving.
341         
342         * ecore.cs, statement.cs (Throw): Simplified.
343         
344         * flowanalysis.cs: Also verify event fields.
345
346 2008-09-04  Miguel de Icaza  <miguel@novell.com>
347
348         * assign.cs (Assign.DoResolve): Perform the type conversions
349         checks before we attempt to initialize `New' initializers. 
350
351         * repl.cs (PrettyPrint): Add Hashtable prettyprint
352
353         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
354         public. 
355
356         * repl.cs: Update help.
357
358 2008-09-03  Miguel de Icaza  <miguel@novell.com>
359
360         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
361         handling of the default config handling, including the special
362         treatment of System.Core assembly. 
363
364         Fixes the REPL processing for LINQ.
365
366 2008-09-03  Marek Safar  <marek.safar@gmail.com>
367
368         A fix for bug #422507
369         * expression.cs (UnboxCast): Add missing child expression mutator.
370
371 2008-09-03  Marek Safar  <marek.safar@gmail.com>
372
373         * driver.cs: Don't self reference System.Core assembly.
374
375 2008-09-03  Marek Safar  <marek.safar@gmail.com>
376
377         A fix for bug #422507
378         * expression.cs (StringConcat): Add missing type mutator.
379
380 2008-09-03  Marek Safar  <marek.safar@gmail.com>
381
382         * generic.cs (TypeInferenceContext): Follow equality rule for
383         constructed type lower bound type inference.
384
385 2008-09-02  Miguel de Icaza  <miguel@novell.com>
386
387         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
388         <dblank@cs.brynmawr.edu> which updates the cursor position on
389         refresh.
390         
391 2008-09-02  Marek Safar  <marek.safar@gmail.com>
392
393         A fix for bug #367145
394         * driver.cs: Fixed import of extension methods when using -noconfig
395         option.
396
397 2008-09-02  Marek Safar  <marek.safar@gmail.com>
398
399         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
400         version from non-generic implementation instead.
401
402 2008-09-01  Marek Safar  <marek.safar@gmail.com>
403
404         A fix for bug #418908
405         * class.cs: Use AddScopeStatement for field initializers.
406
407 2008-09-01  Marek Safar  <marek.safar@gmail.com>
408
409         A fix for bug #415385
410         * ecore.cs, convert.cs: Do method group conversion for equal group types.
411
412 2008-09-01  Marek Safar  <marek.safar@gmail.com>
413
414         A fix for bug #421736
415         * iterators.cs: Don't crash on unreachable iterators.
416
417 2008-09-01  Marek Safar  <marek.safar@gmail.com>
418
419         A fix for bug #421628
420         * parameter.cs, attribute.cs: Clone also parameter attributes.
421
422 2008-08-30  Miguel de Icaza  <miguel@novell.com>
423
424         * namespace.cs (LookupType): In EvalMode, try to replace
425         the TypeBuilder from our cache with a Type as Reflection.Emit does
426         not  like to mix code from older assemblies emitted and new
427         assemblies emitted. 
428
429         This sounds like a serious Mono bug that prevents multiple
430         assemblies to be generated and consumed at the same time.
431
432         * cs-parser.jay (push_current_class): Do not make interactive
433         classes internal or private, make them public as we currently
434         generate each new class in a new assembly.   
435
436 2008-08-29  Miguel de Icaza  <miguel@novell.com>
437
438         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
439         remove types that are entered into the global namespace during
440         parsing so that we can remove them on failure.
441  
442         * cs-parser.jay: Parsing: we now keep track of types that are
443         entered into global variables and queue those in case the parsing
444         or resolution fail.
445  
446         This happens in a few situations: during partial-input, we invoke
447         the parser repeatedly for example with the string "class X", this
448         would cause X to be registed, and we need to remove this
449         registration so that another parse attempt later with say "class X {"
450         would actually work.
451  
452         Additionally, if there is an error in the resolution phase, for
453         example: "class X : NonExistant {}" th
454         
455         * cs-parser.jay: Be more precise with the errors being raised,
456         instead of flagging all exceptions during parsing to be attributed
457         to the parsing process, distinguish those from errors happening in
458         the actions and hint that using -v would produce the actual
459         exception. 
460
461         * repl.cs: Do not load all compiler references on each reset,
462         doing the partial reset takes care of this.
463         
464 2008-08-28  Miguel de Icaza  <miguel@novell.com>
465
466         * repl.cs: Add support for loading all the files from
467         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
468         as shell libraries.
469
470         Introduce a micro-parser that is able to deambiguate on its input
471         whether we are dealing with a compilation unit (namespace, class,
472         interface, struct, delegate) declaration or a statement.   This
473         allows both declarations and statements to be entered. 
474
475         Set history size by default to 300 lines.
476
477         Instead of distinguishing based on the parser.InteractiveResult,
478         have only two cases: statements were parsed, or a compilation unit
479         was.   Always pull the Using statement additions from the
480         compilation unit parse.
481         
482         * cs-tokenizer.cs: Rename tokens to better describe their intent
483         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
484         
485         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
486         EvalMode is used to trigger the lookup of global variables while
487         StatementMode is used turn variable declarations into static
488         fields.
489
490         * getline.cs: Allow history size to be set.
491         
492 2008-08-29  Marek Safar  <marek.safar@gmail.com>
493
494         A fix for bug #360755
495         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
496
497 2008-08-29  Marek Safar  <marek.safar@gmail.com>
498
499         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
500         
501         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
502         member name, it is too confusing
503         
504         * decl.cs, class.cs: Don't report unused fields with attached attribute.
505         
506         * rootcontext.cs: Finally default to warning level 4.
507
508 2008-08-28  Marek Safar  <marek.safar@gmail.com>
509
510         * class.cs (CheckBase): Ignore overloaded operators.
511
512 2008-08-28  Marek Safar  <marek.safar@gmail.com>
513
514         A fix for bug #420830
515         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
516
517 2008-08-28  Marek Safar  <marek.safar@gmail.com>
518
519         A fix for bug #420832
520         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
521
522 2008-08-28  Marek Safar  <marek.safar@gmail.com>
523
524         A fix for bug #420386
525         * nullables.cs: Fixed logic of nullable user comparison operators involving
526         null values.
527
528 2008-08-28  Marek Safar  <marek.safar@gmail.com>
529         
530         * attribute (IsClsCompliant): Use FALSE value for pointer types.
531
532 2008-08-27  Miguel de Icaza  <miguel@novell.com>
533
534         * repl.cs: Add support for aborting the running code with C-c. 
535
536 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
537
538         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
539
540 2008-08-27  Miguel de Icaza  <miguel@novell.com>
541
542         * cs-parser.jay (interactive_statement_list): A new set of rules
543         for hosting statements that uses the "interactive_" prefix.   
544
545         * repl.cs: Add support for parsing `using' as a statement or as a
546         directive.  Deambiguating before passing this to the parser.
547
548         We need to distinguish statement_expressions that occur at the
549         toplevel vs those that occur embedded into expressions.
550
551         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
552         that fixes the cursor key handling, and a history bug.
553         
554 2008-08-26  Miguel de Icaza  <miguel@novell.com>
555
556         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
557         limitations in Console, instead the 2.0 bootstrap libraries now
558         include the Console bits.
559
560         Also, remove the use of Nullables from getline.cs
561
562         ------------
563         
564         Interactive support for the C# compiler.   Use gmcs --shell to
565         enter a read-eval-print loop shell.
566
567         Docs: http://www.mono-project.com/CsharpRepl
568         
569         * sources: include repl.cs here and getline.cs for gmcs.exe,
570         everything else is getline.cs impaired.
571
572         * Makefile: when bootstrapping pass a special flag
573         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
574         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
575         This distinguishes those two cases.
576
577         * repl.cs: Support for a read-eval-print loop.   Will be soon
578         refactored into eval support and then REPL on top of it.
579
580         * ecore.cs: If a simplename lookup fails, before erroring out,
581         if we are in EvalMode to resolve the name to a declaration in the
582         Eval-land.    
583
584         This means that variable declarations that happened in previous
585         classes (as repl puts every statement in a separate class) are
586         made visible in this way.
587
588         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
589         triggered an error due to the end of file being reached.   This is
590         used to do multi-line input, and notify the caller that the user
591         needs to provide more text before a successful parse.
592
593         Add new grammar rules after the INTERACTIVE_PARSER token is seen
594         to drive the evaluation with a custom wrapper. 
595
596         * driver.cs: Add support for --shell, and refactor some code to be
597         reused from repl.cs
598         
599         * namespace.cs: Add support for serializing the contents of the
600         namespaces and reloading them.  
601
602         * getline.cs: A managed implementation of ReadLine under
603         X11/Apache2 license terms.  Easy to embed in other applications as
604         well.
605
606         * namespace.cs: Add some functions to save and restore the
607         namespace state.
608
609         * rootcontext.cs: New public field.
610
611         * cs-tokenizer.cs: Add support for one of the possible characters
612         we introduce into the token stream.  
613
614         This patch does not affect the regular tokenization process, the
615         only performance hit would happen if there is an invalid character
616         on the input string.
617
618         * support.cs: Move isatty helper routine here.
619
620         * codegen.cs: Small cleanup, and add a mechanism to initialize the
621         code generator for in-memory assemblies.
622
623 2008-08-26  Marek Safar  <marek.safar@gmail.com>
624
625         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
626         parameter cannot be always used as a type.
627
628 2008-08-21  Marek Safar  <marek.safar@gmail.com>
629
630         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
631
632 2008-08-21  Marek Safar  <marek.safar@gmail.com>
633
634         * convert.cs: Implement explicit array to IList<T> conversion.
635
636 2008-08-20  Marek Safar  <marek.safar@gmail.com>
637
638         A fix for bug #362740
639         * cs-tokenizer.cs: Handle UTF-16 surrogates.
640
641 2008-08-20  Marek Safar  <marek.safar@gmail.com>
642         
643         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
644         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
645         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
646         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
647         handling to use just one type of infrastructure and deal with generics
648         more effectivelly.
649
650 2008-07-23  Martin Baulig  <martin@ximian.com>
651
652         *** Merged this from trunk revision 108527 ***
653
654         * statement.cs
655         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
656         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
657         scope variable.
658
659 2008-08-15  Marek Safar  <marek.safar@gmail.com>
660         
661         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
662         error checks.
663
664 2008-08-15  Marek Safar  <marek.safar@gmail.com>
665         
666         * delegate.cs: Fixed compiler crash when creating delegate using partial
667         method.
668         
669         * typemanager.cs: MulticastDelegate is not a delegate.
670
671 2008-08-14  Marek Safar  <marek.safar@gmail.com>
672         
673         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
674         checks.
675
676 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
677
678         * cs-parser.jay (type): Allow 'var' in mcs too.
679         (local_variable_type): Likewise.
680
681 2008-08-14  Marek Safar  <marek.safar@gmail.com>
682         
683         * driver.cs: Removed broken -noconfig variants.
684
685 2008-08-14  Marek Safar  <marek.safar@gmail.com>
686         
687         A fix for bug #417078
688         * expression.cs: Emit correctly left side pointer operators.
689
690 2008-08-13  Marek Safar  <marek.safar@gmail.com>
691
692         * generic.cs, lambda.cs: Inflate method generic arguments only.
693
694 2008-08-12  Marek Safar  <marek.safar@gmail.com>
695
696         * class.cs: Fixed struct layout check regression.
697
698 2008-08-12  Marek Safar  <marek.safar@gmail.com>
699
700         * cs-parser.jay, enum.cs: Simplified enum parsing.
701         
702         * decl.cs: Check all type parameters conflicts.
703         
704         * expression.cs, statement.cs, attribute.cs: More expression checks.
705
706 2008-08-11  Marek Safar  <marek.safar@gmail.com>
707
708         * generic.cs: Add type inference types restriction.
709         
710         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
711         anonymous.cs, expression.cs: Allocate less accessor parameters.
712
713 2008-08-08  Marek Safar  <marek.safar@gmail.com>
714
715         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
716         classes.
717
718 2008-08-08  Marek Safar  <marek.safar@gmail.com>
719
720         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
721
722 2008-08-07  Marek Safar  <marek.safar@gmail.com>
723
724         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
725         Also fixes #362146 and #381592.
726
727 2008-08-07  Marek Safar  <marek.safar@gmail.com>
728
729         * ecore.cs: Reduced constant cannot be used as an attribute value.
730         
731         * cs-parser.jay: Base expression has to be a type.
732         
733         * expression.cs (Conditional): Uses ReducedExpression.
734
735 2008-08-06  Marek Safar  <marek.safar@gmail.com>
736
737         A fix for bug #376826
738         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
739         address of hoisted local variable or parameter cannot be taken.
740
741 2008-08-05  Marek Safar  <marek.safar@gmail.com>
742
743         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
744         anonymous method inside checked/unchecked expression.
745
746 2008-08-05  Marek Safar  <marek.safar@gmail.com>
747
748         * typemanager.cs (IsEqual): Guard against null.
749         
750         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
751         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
752         routine. Fixed few misleading conversion errors.
753
754 2008-08-04  Marek Safar  <marek.safar@gmail.com>
755
756         * class.cs: Consider generics when checking cycles in struct layout.
757
758 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
759
760         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
761
762 2008-08-04  Marek Safar  <marek.safar@gmail.com>
763
764         A fix for bug #414165
765         * anonymous.cs: Use same anonymous implementation method for all anonymous
766         method emits.
767
768 2008-08-04  Marek Safar  <marek.safar@gmail.com>
769
770         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
771         constraints.
772
773 2008-08-04  Marek Safar  <marek.safar@gmail.com>
774
775         * cs-parser.jay: Typeof argument has to be a type expression.
776         
777         * namespace.cs: Check alias and namespace definitions collisions.
778         
779         * class.cs, pending.cs: Moved explicit interface accessor implementation
780         check.
781         
782         * delegate.cs, expression.cs: Verify special name invocations.
783         
784 2008-08-01  Marek Safar  <marek.safar@gmail.com>
785
786         * cs-parser.jay: Don't choke on empty generic type arguments.
787         
788         * cs-tokenizer.cs: Handle escaped preprocessor directives.
789         
790         * expression.cs, ecore.cs: Minor expressions bugs.
791
792 2008-08-01  Marek Safar  <marek.safar@gmail.com>
793
794         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
795         and added more error handling.
796         
797         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
798         
799         *  modifiers.cs, enum.cs: Fixed.
800
801 2008-07-31  Jb Evain  <jbevain@novell.com>
802
803         * driver.cs: remove -pkg ability of smcs.
804
805 2008-07-30  Marek Safar  <marek.safar@gmail.com>
806
807         * statement.cs (Switch): Correctly set empty default target for single
808         blocks.
809
810 2008-07-30  Marek Safar  <marek.safar@gmail.com>
811
812         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
813         string switch statement implementation to use string dictionary which
814         significantly (2-8x) improves performance of generated code.
815
816 2008-07-29  Marek Safar  <marek.safar@gmail.com>
817
818         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
819         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
820         
821 2008-07-29  Marek Safar  <marek.safar@gmail.com>
822
823         A fix for bug #412595
824         * typemanager.cs, convert.cs, expression.cs: Some types are never
825         convertible to each other.
826
827 2008-07-29  Marek Safar  <marek.safar@gmail.com>
828
829         * nullable.cs (CreateNullConstant): An error messages update.
830
831 2008-07-29  Marek Safar  <marek.safar@gmail.com>
832
833         A fix for bug #412595
834         * cfold.cs: Don't cast undefined bool constant.
835
836 2008-07-29  Martin Baulig  <martin@ximian.com>
837
838         * symbolwriter.cs
839         (SymbolWriter.Reset): New public static method.
840
841         * driver.cs
842         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
843
844 2008-07-28  Marek Safar  <marek.safar@gmail.com>
845
846         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
847         
848         * expression.cs (ElementAccess): Exact size allocation.
849
850 2008-07-26  Marek Safar  <marek.safar@gmail.com>
851
852         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
853
854 2008-07-25  Marek Safar  <marek.safar@gmail.com>
855
856         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
857         
858         * class.cs: Removed $PRIVATE$ field hack which caused problems during
859         flow analysis.
860
861 2008-07-25  Marek Safar  <marek.safar@gmail.com>
862
863         A fix for bug #412217
864         * assign.cs: Mutate also assignment type.
865
866 2008-07-25  Marek Safar  <marek.safar@gmail.com>
867
868         A fix for bug #323644
869         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
870         indexers.
871
872 2008-07-25  Marek Safar  <marek.safar@gmail.com>
873
874         A fix for bug #412134
875         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
876         non-enumerable operands when overloading equality or bitwise operators.
877
878 2008-07-25  Marek Safar  <marek.safar@gmail.com>
879
880         * anonymous.cs: Cache closed generic anonymous method delegates.
881
882 2008-07-24  Marek Safar  <marek.safar@gmail.com>
883
884         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
885         anonymous.cs, statement.cs: Always emit anonymous method as static method
886         when is instance free. Use nesting for nested anynomous methods blocks.
887         
888 2008-07-23  Marek Safar  <marek.safar@gmail.com>
889
890         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
891         types.
892
893 2008-07-23  Marek Safar  <marek.safar@gmail.com>
894
895         * expression.cs: Removed MakeSimpleCall.
896
897 2008-07-23  Marek Safar  <marek.safar@gmail.com>
898
899         A fix for bug #323012
900         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
901         Base method implementing interface has to be public.
902
903 2008-07-23  Marek Safar  <marek.safar@gmail.com>
904
905         * cs-parser.jay: Don't break on missing argument.
906
907 2008-07-22  Marek Safar  <marek.safar@gmail.com>
908
909         A fix for bug #320993
910         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
911           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
912
913 2008-07-22  Marek Safar  <marek.safar@gmail.com>
914
915         A fix for bug #320748
916         * convert.cs: Implicit user operators cannot convert to interfaces
917
918 2008-07-22  Marek Safar  <marek.safar@gmail.com>
919
920         A fix for bug #312686
921         * driver.cs: Ignore empty assembly references.
922
923 2008-07-22  Marek Safar  <marek.safar@gmail.com>
924
925         A fix for bug #387040
926         * ecore.cs: Skip constrains check for an explicit implementation.
927
928 2008-07-21  Marek Safar  <marek.safar@gmail.com>
929
930         A fix for bug #409045
931         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
932           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
933           identifiers are file specific unless passed as input arguments.
934
935 2008-07-21  Marek Safar  <marek.safar@gmail.com>
936
937          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
938          to emit UnmanagedMarshal data under 2.0 profile.
939
940 2008-07-21  Marek Safar  <marek.safar@gmail.com>
941
942         A fix for bug #410369
943         * parameter.cs: Clone correctly ParamsParameter.
944
945 2008-07-21  Marek Safar  <marek.safar@gmail.com>
946
947         * expression.cs (Argument): Always report type for type based expressions
948         errors.
949
950 2008-07-18  Marek Safar  <marek.safar@gmail.com>
951
952         A fix for bug #410666
953         * anonymous.cs: Correctly initialize generic storey reference.
954
955 2008-07-18  Marek Safar  <marek.safar@gmail.com>
956
957         * convert.cs: Don't box same type arguments.
958
959 2008-07-18  Marek Safar  <marek.safar@gmail.com>
960
961         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
962         Finished missing generic type mutators.
963
964 2008-07-18  Marek Safar  <marek.safar@gmail.com>
965
966         * iterators.cs, statement.cs: Finished statements CloneTo.
967
968 2008-07-18  Marek Safar  <marek.safar@gmail.com>
969
970         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
971         
972         * expression.cs: Emit optimized default value expressions in expression tree
973         array initializer.
974
975 2008-07-18  Marek Safar  <marek.safar@gmail.com>
976
977         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
978
979 2008-07-17  Marek Safar  <marek.safar@gmail.com>
980
981         A fix for bug #367536
982         * cs-parser.jay: Check static constructor of generic types for an access
983         modifier.
984
985 2008-07-17  Marek Safar  <marek.safar@gmail.com>
986
987         A fix for bug #353800
988         * lambda.cs: Emit ret for contextual statements.
989         
990         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
991         up emitting redundant ret for all anonymous methods with return.
992
993 2008-07-17  Marek Safar  <marek.safar@gmail.com>
994
995         A fix for bug #365188
996         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
997         create anonymous method storey in unreachable block.
998
999 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1000
1001         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1002         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1003         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1004         statement.cs: Fixed relevant defects found by Gendarme.
1005
1006 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1007
1008         A fix for bug #325291
1009         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1010         statement.cs: Replaced IAnonymousHost with top level block flag.
1011
1012 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1013
1014         * cs-parser.jay: Clean up unused open_parens.
1015
1016 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1017
1018         * ecore.cs: Custom error message for a range variable assignment.
1019
1020 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1021
1022         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1023         load.
1024
1025 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1026
1027         * literal.cs: Null literal is of object type.
1028
1029 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1030
1031         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1032         expression of nullable equality comparison.
1033
1034 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1035
1036         * expression.cs(PointerArithmetic): Removed redundant assignment.
1037
1038 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1039
1040         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1041
1042 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1043
1044         A fix for bug #408361
1045         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1046         they are replaced by GetMethod.
1047
1048 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1049
1050         A fix for bug #408721 by jeremie.laval@gmail.com
1051         * expression.cs (Indirection): Implemented CloneTo.
1052
1053 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1054
1055         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1056         assert check.
1057
1058 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1059
1060         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1061
1062 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1063
1064         * linq.cs: Reset tranparent parameter counter in probing mode.
1065
1066 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1067
1068         * anonymous.cs: Mutate anonymous method type.
1069
1070 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1071
1072         * ecore.cs, anonymous.cs: Mutate field expressions.
1073
1074 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1075
1076         A fix for bug #369670
1077         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1078
1079 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1080
1081         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1082
1083 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1084
1085         Fix bug #314902
1086         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1087         only one '>', and finds a '>>', abort the generic lookahead.
1088
1089 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1090
1091         A fix for bug #319902
1092         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1093
1094 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1095
1096         A fix for bug #406371
1097         * statement.cs: Moved EmitSymbolInfo to Block.
1098
1099 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1100
1101         * ecore.cs: Report better error for extension method overload failures.
1102
1103 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1104
1105         * expression.cs (Is): No need to box reference values.
1106
1107 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1108
1109         * class.cs: Use event resolve context when initializing CreateEmitContext.
1110
1111 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1112
1113         A fix for bug #394436
1114         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1115         method used inside expression trees. Added more LINQ to expression tree
1116         conversions.
1117
1118 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1119
1120         A fix for bug #378189, #370577
1121         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1122         from expression.
1123
1124 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1125
1126         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1127         hierarchically.
1128
1129 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1130
1131         A fix for bug #406702
1132         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1133
1134 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1135
1136         A fix for bug #406648
1137         * cs-parser.jay: Report nullable use in mcs for some cases.
1138
1139 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1140
1141         * ecore.cs: Improved argument mismatch error messages.
1142
1143 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1144
1145         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1146
1147 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1148
1149         * expression.cs (TypeOf): Mutate type argument.
1150
1151 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1152
1153         * class.cs: Report missing partial modifier for correct type.
1154
1155 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1156
1157         * ecore.cs, expression.cs (VariableReference): Variable property is 
1158         protected.
1159
1160 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1161
1162         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1163         
1164 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1165
1166         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1167         method delegates.
1168
1169 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1170
1171         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1172         anonymous method storey to an instance method when only "this" is hoisted.
1173
1174 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1175
1176         A fix for bug #321615
1177         * expression.cs: Pointer comparisons use unsigned operator.
1178
1179 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1180
1181         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1182
1183 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1184
1185         A fix for bug #404905
1186         * class.cs: Always initialize local unsafe variables.
1187
1188 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1189
1190         A fix for bug #396987
1191         * expression.cs (NewInitialize): Clear local temporary variable for next run
1192
1193 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1194
1195         A fix for bug #401020
1196         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1197
1198 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1199
1200         A fix for bug #398319
1201         * cs-parser.jay: Implemented undocumented base access expression inside
1202         anonymous types.
1203
1204 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1205
1206         A fix for bug #404227
1207         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1208
1209 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1210
1211         A fix for bug #404227
1212         * convert.cs: Fixed explicit array to interface cast.
1213
1214 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1215
1216         A fix for bug #403894
1217         * delegate.cs: Mutate DelegateInvocation type.
1218
1219 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1220
1221         A fix for bug #379348
1222         * delegate.cs: Box a load of generic parameters.
1223
1224 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1225
1226         * expression.cs: Add an array creation arguments mutate.
1227
1228 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1229
1230         A fix for bug #386068
1231         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1232         parameter.
1233
1234 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1235
1236         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1237         CloneTo.
1238
1239 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1240
1241         A fix for bug #403518
1242         * delegate.cs: Type correctly anonymous method new invocation.
1243
1244 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1245
1246         A fix for bug #394826
1247         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1248         calls.
1249
1250 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1251
1252         A fix for bug #394826
1253         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1254         needed.
1255
1256 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1257
1258         * class.cs: Clone indexer parameters for localized capturing.
1259
1260 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1261
1262         A fix for bug #402379
1263         * expression.cs: Don't crash when an object initializer resolve fails.
1264
1265 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1266
1267         A fix for bug #402888
1268         * expression.cs: Mutate conditional expression.
1269
1270 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1271
1272         A fix for bug #401012
1273         * class.cs: Keep StructLayout in shared container.
1274
1275 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1276
1277         A fix for bug #400438
1278         * decl.cs, class.cs: Only properties can be automatically implemented.
1279
1280 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1281
1282         * statement.cs (ChangeToIterator): Copy also labels.
1283
1284 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1285
1286         * ecore.cs: Pass type argument details to parent extension method.
1287
1288 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1289
1290         A fix for bug #375966
1291         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1292
1293 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1294
1295         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1296
1297 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1298
1299         A fix for bug #394347
1300         * anonymous.cs: Cache compatible delegates as compatibility check produces
1301         a new method every time.
1302
1303 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1304
1305         * anonymous.cs: Propagate storey reference for single references.
1306
1307 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1308
1309         A fix for bug #387615
1310         * assign.cs, expression.cs: Correctly clone compound assignment.
1311
1312 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1313
1314         A fix for bug #359611, #359604
1315         * anonymous.cs: Mutate all types of hoisted parameters.
1316
1317 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1318
1319         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1320         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1321         expression.cs, codegen.cs, statement.cs
1322         
1323         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1324         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1325         
1326         ** Anonymous methods, lambda expressions rewrite **
1327         
1328         Anonymous expressions are now resolved when an explicit block is resolved 
1329         and they don't require any registration procedure anymore. Further,
1330         anonymous methods are defined when explicit block is emitted which allows
1331         better control of whole process and opens possibilities for more
1332         optimizations as well as alternative to reverse whole process.
1333         
1334         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1335         process consistent and to correctly emit hoisted generic methods when they
1336         have at least 1 hoisted variable.
1337         
1338 2008-06-17  Martin Baulig  <martin@ximian.com>
1339
1340         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1341         iterator method.
1342         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1343         virtual property; check it in Emit().
1344         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1345         an iterator.
1346         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1347         an iterator.
1348         (Indexer.Define): Likewise.
1349
1350 2008-06-17  Marek Safar  <marek.safar@gmail.com>
1351
1352         * convert.cs: Don't use IsInterface on type arguments.
1353         
1354         * delegate.cs: DelegateInvocation uses MethodInfo.
1355         
1356         * parameter.cs: Removed IsTypeParameter.
1357         
1358         * generic-mcs.cs: More missing stuff.
1359
1360 2008-06-16  Martin Baulig  <martin@ximian.com>
1361
1362         * modifiers.cs
1363         (Modifiers.DEBUGGER_HIDDEN): New public const.
1364
1365         * typemanager.cs
1366         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1367
1368         * class.cs
1369         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1370         (AbstractPropertyEventMethod): Likewise.
1371         (Constructor.Emit): Likewise.
1372         (SourceMethod.SetCompilerGenerated): Removed.
1373
1374         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1375         on MoveNext().
1376
1377         * anonymous.cs
1378         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1379         if we're an `IteratorHost'.
1380         (AnonymousMethodMethod..ctor): Don't set
1381         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1382         not on the method.
1383
1384 2008-06-16  Marek Safar  <marek.safar@gmail.com>
1385
1386         * statement.cs: Clean-up foreach statements.
1387
1388 2008-06-12  Marek Safar  <marek.safar@gmail.com>
1389
1390         * class.cs: Stop using public method which should not exist
1391         (MethodBuilder.SetGenericMethodSignature).
1392
1393 2008-06-11  Martin Baulig  <martin@ximian.com>
1394
1395         * location.cs
1396         (Location.LookupFile): Add `CompilationUnit' argument; when given
1397         a relative file name, make it relative to the directory the .cs
1398         file is located in instead of using the current directory.
1399
1400 2008-06-11  Martin Baulig  <martin@ximian.com>
1401
1402         * class.cs
1403         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1404         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1405         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1406         (SourceMethod.SetCompilerGenerated): Likewise.
1407
1408 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1409
1410         * codegen.cs, driver: Only write symbol file when it's asked for.
1411
1412 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1413
1414         * codegen.cs: Don't use assembly writer error handling for symbol writer.
1415
1416 2008-06-10  Martin Baulig  <martin@ximian.com>
1417
1418         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1419
1420 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1421
1422         A fix for bug #316290
1423         * expression.cs: Include decimal operators in predefined table.
1424         
1425         * parameters.cs: More readonlyness.
1426
1427 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1428
1429         A fix for bug #397213
1430         * cs-parser.jay: One more missing current_local_parameters reset.
1431
1432 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1433
1434         A fix for bug #396633
1435         * class.cs: Host backing field in partial container.
1436
1437 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1438
1439         A fix for bug #397068
1440         * expression.cs: Check both operand types when predefined operator is used.
1441
1442 2008-06-05  Martin Baulig  <martin@ximian.com>
1443
1444         Merged the `debugger-kahalo' branch.
1445
1446         * class.cs
1447         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1448         we're an iterator method.
1449         (SourceMethod): Reflect latest symbol writer changes;
1450         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1451         now `start_row' and `end_row'.
1452         (Constructor.Emit): Fix the logic whether to emit symbol information.
1453
1454         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1455         generated methods.
1456
1457         * location.cs
1458         (CompilationUnit): New public class; derives from `SourceFile'.
1459         (SourceFileEntry.DefineSymbolInfo): New public method.
1460         (SourceFileEntry.SetChecksum): New public method.
1461         (Location): Encode hidden line numbers by using `column == 255';
1462         the .ctor now accepts `column == -1' to mark a hidden line number.
1463         (Location.Hidden): New public property.
1464         (Location.CheckPoint): Add `CompilationUnit'.
1465         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1466         (Location.Push): Add `CompilationUnit compile_unit' argument.
1467         (Location.CompilationUnit): New public property.
1468
1469         * statement.cs
1470         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1471
1472         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1473
1474         * driver.cs: `SourceFile' -> `CompilationUnit'.
1475
1476         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1477
1478         * namespace.cs: `SourceFile' -> `CompilationUnit'.
1479
1480         * cs-tokenizer.cs: Add support for `#pragma checksum' and
1481         `#line hidden'.
1482
1483         * symbolwriter.cs
1484         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1485         new symbol writer API to also pass the file.
1486
1487 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1488
1489         * statement.cs: Emit catch variable assignment using variable expression.
1490         
1491 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1492
1493         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1494         with other variable types.
1495
1496 2008-06-04  Marek Safar  <marek.safar@gmail.com>
1497
1498         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1499         GetLength method emit, it breaks resolve rules.
1500         
1501 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
1502             Marek Safar  <marek.safar@gmail.com>
1503                         
1504         A fix for bug #395542
1505         * cs-parser.jay: The trailing comma is allowed in anonymous type member
1506         declaration.
1507         
1508 2008-06-02  Marek Safar  <marek.safar@gmail.com>
1509
1510         A fix for bug #395287
1511         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1512
1513 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1514
1515         A fix for bug #395845
1516         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1517         non-nullable parameter type.
1518         
1519 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1520
1521         * class.cs: Handle contructor initializer as a statement in top-level block.
1522
1523 2008-05-30  Marek Safar  <marek.safar@gmail.com>
1524
1525         * attribute.cs: Don't mix old and new corlib types when emitting corlib
1526         security attributes.
1527
1528 2008-05-24  Marek Safar  <marek.safar@gmail.com>
1529
1530         * ecore.cs, expression.cs: Small IVariable refactoring.
1531
1532 2008-05-22  Marek Safar  <marek.safar@gmail.com>
1533
1534         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1535
1536 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1537
1538         * cs-parser.jay: Removed redundant catch type check.
1539
1540 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1541
1542         A fix for bug #390372
1543         * nullable.cs: Set correct return type.
1544
1545 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1546
1547         A fix for bug #391062
1548         * typemanager.cs: Fixed crash when comparing null types.
1549
1550 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1551
1552         A fix for bug #391871
1553         * cs-parser.jay: Better error handling for invalid catch type.
1554
1555 2008-05-20  Marek Safar  <marek.safar@gmail.com>
1556
1557         A fix for bug #392155
1558         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1559
1560 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1561
1562         A fix for bug #390666
1563         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1564         expressions.
1565
1566 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1567
1568         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1569         in getter.
1570
1571 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1572
1573         A fix for bug #389625
1574         * delegate.cs, generic.cs: Some progress on method group return type
1575         inference.
1576
1577 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1578
1579         A fix for bug #378419
1580         * namespace.cs: Inspect also parent namespaces not only namespace entries.
1581
1582 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1583
1584         * class.cs (Constructor): Added IsCompilerGenerated.
1585
1586 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1587
1588         * expression.cs: Enum binary operators can accept non-enum operand only when
1589         is implicitly convertible to underlying type.
1590
1591 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1592
1593         A fix for bug #389272
1594         * support.cs: Workaround System.InvalidOperationException for enums.
1595
1596 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1597
1598         A fix for bug #389073
1599         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1600
1601 2008-05-10  Marek Safar  <marek.safar@gmail.com>
1602
1603         * driver.cs: Split Parse.
1604         
1605         * location.cs (LookupFile): Uses string.Empty.
1606
1607 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1608
1609         * expression.cs, parameter.cs: Small ParameterReference clean up.
1610
1611 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1612
1613         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1614         hack. Fixes #387502.
1615
1616 2008-05-06  Martin Baulig  <martin@ximian.com>
1617
1618         * class.cs (Constructor.Emit): Fix the logic whether to emit
1619         symbol information.
1620
1621 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
1622
1623         Fix #385503
1624         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1625         InvalidOperationException when the iterator is before the start or
1626         after the end.
1627
1628 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1629
1630         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1631         when left is nullable type.
1632
1633 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1634
1635         A fix for bug #386628
1636         * expression.cs (LocalVariableReference): Continue in resolving when
1637         variable is not assigned.
1638
1639 2008-05-05  Marek Safar  <marek.safar@gmail.com>
1640
1641         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1642         nullable operations.
1643
1644 2008-05-04  Marek Safar  <marek.safar@gmail.com>
1645
1646         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1647         it saves many redundant temporary variables for nullable operations.
1648
1649 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1650
1651         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1652         
1653         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1654         method.
1655         
1656         * nullable.cs: Constant coalescing operator optimizations.
1657
1658 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1659
1660         * constant.cs: Use unsigned conversion for values which are unsigned only.
1661
1662 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1663
1664         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
1665         coalescing operator as it should be.
1666
1667 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1668
1669         A fix for bug #371016
1670         * expression.cs: All predefined delegate operators require implicit method
1671         group conversion.
1672         
1673 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1674
1675         * constant.cs: Emit long constant as uint when fits the range.
1676         
1677         * convert.cs, expression.cs: Fixed few unsafe conversions.
1678
1679 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1680
1681         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1682
1683 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
1684
1685         Fix #385758
1686         * convert.cs (ImplicitNumericConversion): Don't modify the type of
1687         'expr'.
1688         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
1689
1690 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1691
1692         * constant.cs, literal.cs: IsLiteral property for error reporting.
1693         
1694         * ecore.cs, expression.cs: Implemented Property expression.
1695
1696 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1697
1698         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
1699         
1700         * nullable.cs: Implemented nullable coalescing null operator.
1701
1702         * ecore.cs, expression.cs: Expression trees work.
1703
1704 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1705
1706         * ecore.cs: CreateExpressionTree is finally abstract.
1707
1708         * expression.cs, linq.cs: Updated.
1709
1710 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1711
1712         * expression.cs, ecore.cs: Block base access expression inside expression
1713         tree.
1714
1715 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1716
1717         A fix for bug #385058
1718         * expression.cs: User-defined operator implementations always take
1719         precedence over predefined operator implementations.
1720
1721 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1722
1723         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
1724         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
1725         expression tree conversions.
1726         
1727 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1728
1729         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
1730         operators method details to Operator class.
1731
1732 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1733
1734         * anonymous.cs: Pass unsafe flags to anonymous container.
1735         
1736         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
1737         inside expression tree.
1738
1739 2008-04-29  Martin Baulig  <martin@ximian.com>
1740
1741         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
1742         (Tokenizer.PopPosition): Also restore the `line'.
1743
1744 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1745
1746         * delegate.cs: Implemented Invoke expression.
1747
1748 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1749
1750         * expression.cs: Fixed equality reference comparison regression.
1751
1752 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1753
1754         * ecore.cs: Clean up EmptyCast hack.
1755         
1756         * expression.cs, nullable.cs: Implemented enum binary and unary operations
1757         using correct conversion rules. Also fixes #383993.
1758
1759 2008-04-28  Martin Baulig  <martin@ximian.com>
1760
1761         * class.cs (Constructor.Emit): Don't emit debugging information
1762         for generated default .ctor's.
1763
1764 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1765
1766         * convert.cs: Empty-cast ushort to int conversion.
1767
1768 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1769
1770         A fix for bug #384191
1771         * ecore.cs, expression.cs: Fixed expression cloning.
1772
1773 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1774
1775         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
1776
1777 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
1778
1779         Fix #381559, test-638.cs, test-639.cs
1780         * assign.cs (CompoundAssign.Helper): New wrapper.
1781         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
1782         access.
1783         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
1784         Pass unconverted expressions to the params array creation expression.
1785         (FieldExpr.EmitAssign): Don't special-case StringConcat.
1786         (PropertyExpr.EmitAssign): Likewise.
1787         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
1788         element if it is of kind CompoundAssign.Helper.
1789         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
1790         first before anything else.
1791         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
1792         (ArrayAccess.LoadArrayAndArguments): Simplify.
1793
1794 2008-04-27  Marek Safar  <marek.safar@gmail.com>
1795
1796         * expression.cs: Fixed cloning of typeof(void).
1797
1798 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
1799
1800         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
1801         (Assign.Emit): Likewise.  Move it to ...
1802         (CompoundAssign.DoResolve): ... here and ...
1803         (CompoundAssign.Emit): ... here.
1804         (EventAddOrRemove): New helper to handle += and -= on events, and
1805         avoid the use of BinaryDelegates.
1806         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
1807         (EventExpr.EmitAddOrRemove): Improve.
1808         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
1809
1810         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
1811         create VarExprs for 'foo.bar.var'.
1812         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
1813         is a highly inappropriate name for its functionality.
1814
1815 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
1816
1817         Simplify handling of multiple assignments
1818         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
1819         inheritable-only.
1820         (SimpleAssign): New.  Class to be used for normal assignments.
1821         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
1822         * expression.cs, parameter.cs, statement.cs: Likewise.
1823
1824 2008-04-25  Marek Safar  <marek.safar@gmail.com>
1825
1826         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
1827         for incompatible underlying types, more to come, uff.
1828
1829 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
1830
1831         Fix gtest-388.cs
1832         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
1833         Handle 'leave_copy'.
1834
1835 2008-04-25  Marek Safar  <marek.safar@gmail.com>
1836
1837         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
1838
1839 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
1840
1841         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
1842         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
1843         * statement.cs (While, Do, For): Allow test to have side effects.
1844         (For.DoEmit): Always emit InitStatement.
1845
1846         Fix test-635.cs
1847         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
1848         Always create SideEffectConstant.
1849         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
1850         of type EnumConstant.
1851
1852         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1853         Handle 'right' being SideEffectConstant of type 'bool'.
1854
1855         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1856         Use left.EmitBranchable instead of open coding it, so as to
1857         improve optimization opportunities.
1858
1859         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
1860
1861         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
1862         assumptions.
1863         (Expression.EmitSideEffect): Document.
1864
1865 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1866
1867         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
1868
1869 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1870
1871         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
1872
1873 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1874
1875         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
1876         conversion to expression tree.
1877
1878 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1879
1880         * ecore.cs: Removed unused expression.
1881
1882 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1883
1884         * expression.cs: Implemented NegateChecked and New expressions.
1885
1886 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1887
1888         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
1889
1890 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
1891
1892         Fix #351102
1893         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
1894         needing final 'ret' instruction.
1895
1896 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1897
1898         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
1899
1900 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1901
1902         * expression.cs: Emit ldnull and not null expression as an instance argument
1903          of static method expression calls.
1904
1905 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1906
1907         A fix for bug #378200
1908         * expression.cs: Fixed crash when creating parameterless expression tree
1909         method call.
1910
1911 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1912
1913         A fix for bug #375297
1914         * anonymous.cs: Fixed crash when inferring from null argument anonymous
1915         method.
1916
1917 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1918
1919         A fix for bug #377596
1920         * decl.cs, class.cs: Emit delegate type argument attributes.
1921
1922 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1923
1924         A fix for bug #365314
1925         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
1926         
1927 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1928
1929         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
1930         only.
1931
1932 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1933
1934         * generic.cs (TypeParameter): Removed redundant location.
1935
1936 2008-04-19  Marek Safar  <marek.safar@gmail.com>
1937
1938         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
1939         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
1940         FullNamedExpression in all declaration type expression, statements will come
1941         later.
1942
1943 2008-04-18  Marek Safar  <marek.safar@gmail.com>
1944
1945         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
1946         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
1947
1948 2008-04-18  Marek Safar  <marek.safar@gmail.com>
1949
1950         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
1951         code.
1952
1953 2008-04-17  Marek Safar  <marek.safar@gmail.com>
1954
1955         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
1956         constraints.
1957
1958 2008-04-17  Marek Safar  <marek.safar@gmail.com>
1959
1960         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
1961         name expressions.
1962         Also fixes #340463.
1963
1964 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
1965
1966         Hook up 'EmitSideEffect'
1967         * constant.cs (Constant.EmitSideEffect): New.
1968         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
1969         (SideEffectConstant.EmitSideEffect): New.
1970         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
1971         unconditional branch in EmitBranchable.
1972         (FieldExpr.EmitBranchable): New.
1973         * expression.cs (Unary.EmitSideEffect): New.
1974         (Binary.EmitSideEffect): New.
1975         (VariableReference.EmitSideEffect): New.  Do nothing.
1976
1977 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
1978
1979         Introduce 'EmitSideEffect'
1980         * ecore.cs (Expression.EmitSideEffect): New.
1981         (TypeCast): Rename from EmptyCast.
1982         (EmptyCast): New.
1983         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
1984         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
1985         * convert.cs, nullable.cs: Update to changes.
1986
1987 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1988
1989         * class.cs, cs-parser.jay: Early check for base types expression.
1990
1991 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1992
1993         * decl.cs (MemberName): Declare PrettyName as obsolete.
1994
1995 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1996
1997         * namespace.cs: Use MemberName comparison.
1998
1999 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2000
2001         Fix build break
2002         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2003         FullName.
2004         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2005         (MemberName.FullyQualifiedName): New.  Provides the functionality
2006         that users assume FullName would have.
2007         * ecore.cs, namespace.cs: Update to changes.
2008
2009         * statement.cs (Using.assign): Make into ExpressionStatement.
2010         (Using.EmitPreTryBody): Simplify.
2011
2012 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2013
2014         * report.cs: ColorFormat is protected.
2015         
2016         * rootcontext.cs: Unused fields clean-up.
2017         
2018         * namespace.cs: Made UsingEntry name private.
2019
2020 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2021
2022         * cs-tokenizer.cs, location.cs: Removed unused field.
2023
2024 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2025             Raja R Harinath  <harinath@hurrynot.org>
2026
2027         Fix #379822
2028         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2029         (SideEffectConstant.side_effect): Rename from 'right'.
2030         (SideEffectConstant..ctor): Normalize 'side_effect'.
2031         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2032         value of this constant.
2033         * cfold.cs: Update to changes.
2034
2035 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2036
2037         * cs-paser.jay: Removed unused variable.
2038         
2039         * driver.cs: Made Compile instance method.
2040
2041 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2042
2043         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2044
2045 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2046
2047         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2048
2049 2008-04-13  Jb Evain  <jbevain@novell.com>
2050
2051         * namespace.cs: update the System.Core fullname for 2.1
2052         * driver.cs: update the list of required assemblies for 2.1.
2053         Merged from the Moonlight 2 branch.
2054
2055 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2056
2057         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2058         types and user defined operators. User operators arguments has to be checked
2059         for null value before invocation, which also means no operator is called
2060         when any argument is not convertible to unwrapped nullable type.
2061         
2062 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2063
2064         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2065         of Unary expressions to follow operator overloading rules precisely.
2066         Also fixes #321794, #323794
2067         
2068 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2069
2070         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2071         expression.
2072         
2073 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2074
2075         * expression.cs, ecore.cs: Implemented MemberInit expression.
2076         
2077 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2078
2079         Fix mono/tests/exception4.cs
2080         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2081         ec.NeedReturnLabel () rather emitting a 'nop'.
2082
2083         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2084         simple heuristic.
2085         (TryCatch.SomeCodeFollows): Likewise.
2086         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2087         for 'break', 'continue' and 'return' statements inside a try.
2088         We're fairly sure that the generated IL stream will have more
2089         instructions textually following the try.
2090         (FlowBranchingTryCatch): Likewise.
2091
2092         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2093         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2094         overrides.
2095
2096         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2097         wrapper -- forward everything to CollectionForeach.
2098         (CollectionForeach.NonDisposableWrapper): New.
2099         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2100         instead of a pop + branch to end.
2101
2102 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2103
2104         A fix for bug #377485
2105         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2106         Propagate location for extension method groups. Report conversion failure at
2107         right place.
2108
2109 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2110
2111         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2112         ListInit and Field expressions.
2113
2114 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2115
2116         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2117         Since $PC is always -1 inside the body of MoveNext, the fault
2118         handler is a no-op.
2119         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2120         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2121         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2122
2123         The denouement!  Fix #324708
2124         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2125         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2126         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2127         'finally' inside the finally clause.
2128
2129         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2130         inside an iterator.  Don't emit the body of the 'finally' inside
2131         the finally clause yet.
2132
2133         Use the ResumableStatement infrastructure for MoveNext ()
2134         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2135         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2136         'old_resume_points'.  Move dispatcher upfront.
2137         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2138         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2139         in an enumerator.  This encodes the main fix in this patch series
2140         -- we can only jump into the first instruction of a try from the
2141         outside, but we want to emit try/finally regions in iterators and
2142         resume in the middle of them.
2143
2144 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2145
2146         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2147         of NeedReturnLabel here.
2148
2149         Introduce a common point for emitting try/finally to IL
2150         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2151         features of the various subclasses, which are now driven by ...
2152         (ExceptionStatement.EmitPreTryBody): ... this and ...
2153         (ExceptionStatement.EmitTryBody): ... this and the original
2154         EmitFinallyBody.
2155         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2156         Remove DoEmit and update to follow above protocol.
2157
2158         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2159         of the dispatcher are the same, skip emitting the 'switch'.
2160         * iterator.cs (Iterator.EmitDispose): Update to changes.
2161
2162         Clean up handling of 'using' statement
2163         * statement.cs (UsingTemporary): New.  Carved out of ...
2164         (Using): ... this.  Simplify drastically.  Handle exactly
2165         one variable.
2166         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2167         or Using as appropriate.  If there are multiple variable declared,
2168         create nested Using statements.
2169         (resource_acquisition): Kill.
2170
2171         * statement.cs (ExceptionStatement.EmitForDispose): Use
2172         EmitFinallyBody, not EmitFinally.
2173
2174         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2175         * iterator.cs: Update to changes.
2176
2177         Start using the ResumableStatement infrastructure
2178         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2179         (ResumableStatement.EmitForDispose): New.
2180         (ExceptionStatement): Override them.
2181         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2182         EmitForDispose to create the body of the Dispose method.  Don't
2183         use OldResumePoint.
2184
2185         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2186         * statement.cs (Toplevel.AddResumePoint): ... here.
2187         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2188         * flowanalysis.cs (FlowBranchingIterator): New.
2189         * codegen.cs (EmitContext): Update to changes.
2190
2191         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2192         (Iterator.old_resume_points): Rename from 'resume_points'.
2193         (Iterator.MoveNextStatement): Remove unused class.
2194
2195         New infrastructure for try/finally in iterators (still unused)
2196         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2197         (FlowBranchingToplevel.AddResumePoint): Hook into
2198         ToplevelBlock.AddResumePoint.
2199         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2200         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2201         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2202         resume points and assign program-counter values.
2203         (ExceptionBlock.AddResumePoint): Collect resume points for
2204         de-muxer at the top of try block.
2205         * iterators.cs (Yield.CheckContext): Simplify.
2206         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2207
2208 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2209
2210         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2211         argument to an ExitStatement.
2212         (FlowBranchingException): Refactor saved origins code.
2213         * statement.cs (ExitStatement): Update to cahges.
2214         * iterator.cs (YieldBreak): Likewise.
2215
2216         * statement.cs (ResumableStatement): New.  Common base class for
2217         YieldReturn and ExceptionStatement.
2218         (ExitStatement): New.  Common base class for Return and YieldBreak.
2219         (Return): Update to changes.
2220         * iterator.cs (YieldBreak): Likewise.
2221         * lambda.cs (ContextualReturn): Likewise.
2222
2223         Fix #377028
2224         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2225         emit a meaningful error message.
2226
2227         Fix #324765, #319508
2228         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2229         (VariableInfo.SetAssigned): Set it.
2230         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2231         determine if CS0219 or CS0168 is appropriate.  Don't use
2232         flow-analysis information.
2233         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2234         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2235         (EmitContext.EndFlowBranching): ... this.
2236
2237 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2238
2239         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2240
2241 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2242
2243         A fix for bug #376508
2244         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2245         ImplicitConversionExists.
2246
2247 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2248
2249         * expression.cs (Binary): Added remaining binary operators to expression
2250         tree builder.
2251
2252         * nullable.cs: Optimize shift with null argument.
2253
2254 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2255
2256         Fix minor IL regression
2257         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2258         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2259         * cs-parser.jay (try_statement): Update to changes.
2260
2261         * statement.cs (TryFinally.need_exc_block): Delete.
2262         (TryFinally): Update to changes.
2263
2264         Now all ExceptionStatements are unconditional
2265         * statement.cs (CollectionForeach.DisposableWrapper): New.
2266         Extract out the try/finally code into a new wrapper.
2267         (CollectionForeach.Resolve): Use it to simplify the code.
2268
2269 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2270
2271         Start at simplifying ExceptionStatement semantics a bit
2272         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2273         * cs-parser.jay (try_statement): Update to changes.
2274         (opt_catch_clauses): Remove.
2275         * flowanalysis.cs: Update to changes.
2276         (FlowBranching.BranchingType.TryCatch): New.
2277         (FlowBranchingTryCatch): New.
2278
2279         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2280         (FlowBranching.CreateBranching): Update to changes.
2281         (FlowBranchingBlock.AddSibling): Add sanity check.
2282         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2283         Update to changes.
2284
2285         * iterators.cs (Iterator.MarkFinally): Remove.
2286         * statement.cs (ExceptionStatement): Update to changes.
2287
2288         Add support for skipping over finally blocks at runtime.  First
2289         in a series to fix #324708
2290         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2291         (Iterator.EmitMoveNext): Initialize it.
2292         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2293         branch over the body of the 'finally' clause.
2294
2295 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2296
2297         Avoid lopsided use of Foo/DoFoo names
2298         * statement.cs (ExpressionStatement.EmitFinallyBody):
2299         Rename from EmitFinally.
2300         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2301         * iterator.cs: Update to changes.
2302
2303 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2304
2305         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2306         based on UserOperatorCall. More binary nullable operators clean up.
2307
2308 2008-04-02  Martin Baulig  <martin@ximian.com>
2309
2310         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2311
2312 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2313
2314         * nullable.cs: Merge user and empty conversions when lifting expression
2315         trees.
2316         
2317         * expression.cs (StringConcat): Implemented expression tree representation.
2318
2319 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2320
2321         * nullable.cs: When lifting null literal and a user operator exists, no call 
2322         is made.
2323         
2324 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2325
2326         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2327         null.
2328
2329 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2330
2331         * nullable.cs, expression.cs: Use namespace instead heavily nested
2332         monster abstract class.
2333
2334 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2335
2336         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2337         lifting of null literal and user operators. Clean up of some temporary
2338         nullable hacks.
2339
2340 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
2341
2342         Fix #368224, test-629.cs
2343         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2344         if it crossed an unwind-protect boundary.
2345         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2346         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2347         inside an unwind-protected region.
2348         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2349         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
2350         'leave' instead of a 'br' if unwind-protected.
2351         (Iterator.EmitYieldBreak): Likewise.
2352
2353 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
2354
2355         * driver.cs: Only define versioninfo resources if no win32 resource
2356         file was specified.
2357
2358 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2359
2360         A fix for bug #372375
2361         * convert.cs: Fixed boxing of nullable types.
2362
2363 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2364
2365         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2366         type.
2367
2368 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2369
2370         A fix for bug #374619
2371         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2372         
2373 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2374
2375         * lambda.cs: Check return type only for invocation.
2376         
2377 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2378
2379         A fix for bug #374214
2380         * ecore.cs: Correctly report argument type mismatch.
2381
2382 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2383
2384         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2385         and not rely on broken IsEnum.
2386
2387 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2388
2389         * nullable.cs: New file, extracted from generic.cs.
2390         
2391         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2392
2393 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2394
2395         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2396         predefined comparison operators and null literals.
2397         
2398         * report.cs: New warning ID.
2399         
2400 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2401
2402         A fix for bug #370577
2403         * lambda.cs: Check return type too.
2404
2405 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2406
2407         A fix for bug #372846
2408         * class.cs: Automatic properties can be declared as unsafe.
2409
2410 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2411
2412         * location.cs: Use string based concatenation.
2413         
2414         * expression.cs: LiftedBinaryOperator is gmcs only.
2415         
2416 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2417
2418         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2419         conversions rules and expression trees.
2420
2421 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2422
2423         * delegate.cs: Use extension method source as delegate target.
2424
2425 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2426
2427         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2428         binary operations to be purely based on binary operations and optimized
2429         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2430         and other ET refactoring.
2431         
2432         * typemanager.cs: Fixed warning.
2433         
2434 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2435
2436         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2437         
2438         * symbolwriter.cs: Fixed.
2439
2440 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2441
2442         * anonymous.cs, driver.cs: Reset anonymous types counters.
2443
2444 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2445
2446         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2447         
2448         * class.cs: Use fullname for all type member definitions.
2449         
2450 2008-02-19  Martin Baulig  <martin@ximian.com>
2451
2452         * class.cs
2453         (IMethodData.EmitExtraSymbolInfo): New interface method.
2454         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2455         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2456         interface method here as an empty public virtual method.
2457
2458         * anonymous.cs
2459         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2460         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2461         CodeGen.SymbolWriter.SetRealMethodName().       
2462
2463 2008-02-18  Martin Baulig  <martin@ximian.com>
2464
2465         * anonymous.cs
2466         (ScopeInfo.EmitType): Override this and emit debugging
2467         information for captured variables.
2468         (RootScopeInfo.EmitType): Override this and emit symbol
2469         information for a captured `this'.
2470
2471 2008-02-15  Martin Baulig  <martin@ximian.com>
2472
2473         * iterators.cs: Emit debugging info.
2474
2475         * codegen.cs
2476         (EmitContext.Flags): Add `OmitDebuggingInfo'.
2477         (EmitContext.OmitDebuggingInfo): New public property.
2478
2479         * statement.cs
2480         (While): Override Emit() and don't emit symbol info there; do it
2481         inside DoEmit() instead.
2482         (Block.Emit): Omit symbol information while emitting the scope
2483         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
2484         block logic.
2485         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2486         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2487         .ctor to make `IsIterator' work.
2488
2489 2008-03-14  Martin Baulig  <martin@ximian.com>
2490
2491         * symbolwriter.cs: Added the new symbol writer function from the
2492         debugger's `terrania' branch; temporarily enclose them inside
2493         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2494         my vacations.
2495
2496 2008-03-14  Martin Baulig  <martin@ximian.com>
2497
2498         * symbolwriter.cs
2499         (SymbolWriter): Make this a public static class.
2500
2501         * codegen.cs
2502         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2503         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2504
2505 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2506
2507         A fix for bug #370577
2508         * statement.cs, lambda.cs: Added extra limitations when dealing with void
2509         return type.
2510         
2511 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2512
2513         * typemanager.cs (CSharpName): Made 250 times faster.
2514
2515 2008-03-13  Marek Safar  <marek.safar@gmail.com>
2516
2517         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2518         
2519 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2520
2521         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2522         crash when predefined field does not exist.
2523         
2524 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2525
2526         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2527         
2528 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2529
2530         * class.cs (FixedField): Don't crash when contructors are missing.
2531
2532 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2533
2534         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2535         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2536         check internal types accessibility for internal and external types.
2537         Replaced EnumToUnderlying by GetEnumUnderlyingType.
2538
2539 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2540
2541         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2542         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2543         attribute.cs, statement: Use corect instance of predefined types (work
2544         related to #364674).
2545
2546 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2547
2548         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2549         
2550 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2551
2552         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
2553         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2554         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2555         predefined types clean up, delayed predefined types members initialization
2556         (work related to #364674).
2557
2558 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2559
2560         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2561         
2562 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2563
2564         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2565         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2566         predefined types clean up (work related to #364674).
2567
2568 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2569
2570         * ecore.cs: Print an error message instead of throwing exception.
2571         
2572 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2573
2574         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2575         expression.cs, statement.cs: Unififed null literal representation.
2576
2577 2008-03-03  Marek Safar  <marek.safar@gmail.com>
2578
2579         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2580         expression.cs: Refactored binary operators resolve phase and improved speed.
2581         The nullable code is still missing and won't work correctly, more fixes
2582         required.
2583
2584         It also fixes #323726, #324312, #324248, and many other unreported issues.
2585
2586 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
2587
2588         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
2589         instead of 'gmcs'.
2590
2591 2008-02-27  Marek Safar  <marek.safar@gmail.com>
2592
2593         * ecore.cs: Clean-up and split BetterConversion.
2594         
2595 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
2596
2597         Fix #363791
2598         * enum.cs (EnumMember.Value): Only access 'value' if
2599         ResolveValue says it's ok.
2600         (EnumMember.DoResolveValue): Don't set prev_member.value.
2601         (Enum.GetDefinition): Reverse arguments of Equals --
2602         EnumMember.Value can return 'null'.
2603
2604         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2605
2606 2008-02-22  Marek Safar  <marek.safar@gmail.com>
2607
2608         * generic.cs, expression.cs: More ongoing work on expression trees.
2609         
2610 2008-02-21  Marek Safar  <marek.safar@gmail.com>
2611
2612         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2613         handle missing matches when mutiple operators exist.
2614         
2615 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2616
2617         A fix for bug #363218
2618         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2619         initializers.
2620         
2621 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2622
2623         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2624         update. This time to deal correctly with SideEffectConstant expression used
2625         as an argument for another constant folding.
2626
2627 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
2628
2629         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2630         MethodBuilder.
2631
2632 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2633
2634         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2635
2636 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2637
2638         A fix for bug #328136
2639         * expression.cs: Do not fold immediately LogicalAnd operators when the left
2640         side is a false constant, because we still need to evaluate the right-hand
2641         side.
2642
2643         * statement.cs (If): Emit two types of boolean constants (simple constant,
2644         side-effect constant).
2645
2646 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2647
2648         * constant.cs (SideEffectConstant): Don't emit boolean constant.
2649
2650         * expression.cs: Fold immediately LogicalAnd operators when both sides are
2651         constants.
2652
2653 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2654
2655         A fix for bug #361457
2656         * ecore.cs (IsApplicable): Params methods have lower priority.
2657
2658         * support.cs: Return correct parameter modifier for params types.
2659
2660 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2661
2662         * generic.cs (TypeParameter): Cache attribute target name.
2663
2664         * support.cs: Removed unused variable.
2665
2666         * typemanager.cs: Removed debugging leftover.
2667
2668         * ecore.cs: Use local type instead of a property;
2669
2670         * class.cs (VerifyMembers): Consider also parent to test whether type member
2671         is local or public.
2672
2673         * expression.cs (FullMethodDesc): Removed.
2674
2675         * attribute.cs (IsValidArgumentType): Made static.
2676
2677 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
2678
2679         Cleanup to be more readable.
2680         * Makefile (GMCS_PROFILE): Remove.
2681         (COMPILER_NAME): New helper.
2682
2683 2008-02-15  Miguel de Icaza  <miguel@novell.com>
2684
2685         * cs-tokenizer.cs: if a conditional expression happens inside a
2686         (...) this also means that we do not need to de-ambiguate between
2687         an parenthesized expression and a cast.
2688
2689         Fixes 346484.
2690
2691         * constant.cs (SideEffectConstant): a constant value that happens
2692         to have a side effect.
2693
2694         Fixes the build regressions introduced by the fix for #359789
2695
2696 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
2697
2698         * expression.cs (Conditional.Emit): when emitting the ternary
2699         operator, use local variables to generate code verifiable code.
2700
2701         The verifier cannot infer that the type on stack before the
2702         stloc.0 is executed is of type ParentB. This happens because the
2703         stack merge algorithm uses only parent types when deciding which
2704         is the common type.  This is described in Part III 1.8.1.3 of ECMA
2705         335.
2706
2707         This code compiled with mcs is not verifiable under MS. The MS
2708         verifier picks the first common interface of Foo and Bar, which is
2709         wrong, but doesn't use a full join type of the 2 interfaces.
2710
2711         CSC uses a clever hack to compile such code in a verifiable
2712         way. It stores the intermediate values in a local variable with
2713         the expected type.
2714
2715         Fixes: #358102
2716
2717 2008-02-14  Miguel de Icaza  <miguel@novell.com>
2718
2719         * expression.cs: Do not fold BitwiseAnd operators when the left
2720         side is a false constant, because we still need to evaluate the
2721         right-hand side.
2722
2723         Fixes #359789
2724
2725         * support.cs: Instead of throwing an InternalErrorException when
2726         the position of the stream is outside the boundary of our buffer,
2727         reset the state of the reader, and restart the reading from the
2728         beginning of the file.
2729
2730 2008-02-14  Marek Safar  <marek.safar@gmail.com>
2731
2732         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
2733
2734 2008-02-14  Marek Safar  <marek.safar@gmail.com>
2735
2736         A fix for bug #361686
2737         * decl.cs: A protected types used inside a private class which parents
2738         derives from the protected class are accessible.
2739
2740 2008-02-13  Marek Safar  <marek.safar@gmail.com>
2741
2742         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
2743         the parameterless constructor.
2744
2745 2008-02-13  Marek Safar  <marek.safar@gmail.com>
2746
2747         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
2748         lookup methods to use standard member cache when doing member lookup.
2749
2750 2008-02-12  Marek Safar  <marek.safar@gmail.com>
2751
2752         * driver.cs: Don't report full path for referenced module as assembly error.
2753
2754 2008-02-12  Marek Safar  <marek.safar@gmail.com>
2755
2756         * Makefile: Fixed `qh' target to work on all machines.
2757
2758         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
2759         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
2760         and HasElementType with TypeManager implementation.
2761
2762 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2763
2764         A fix for bugs #325134, #359749
2765         * expression.cs, ecore.cs: Try to resolve an extension method even if the
2766         first binds point to non-method member expression.
2767
2768 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2769
2770         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
2771
2772 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2773
2774         A fix for bugs #321394, #323028
2775         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
2776         Reworked naive IsAccessibleAs implementation to handle nested types.
2777
2778 2008-02-05  Jb Evain  <jbevain@novell.com>
2779
2780         * class.cs: use generic type comparison for parameters
2781         as well.
2782
2783 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2784
2785         A fix for bug #325372
2786         * class.cs: Use generic type comparison when testing method signatures.
2787
2788 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2789
2790         A fix for bug #357047
2791         * ecore.cs: Applied C# 3.0 changes to better conversion.
2792
2793 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2794
2795         A fix for bug #358374
2796         * cs-parser.jay: Correctly set modifiers for all constructor types.
2797
2798 2008-02-04  Marek Safar  <marek.safar@gmail.com>
2799
2800         A fix for bug #355251
2801         * generic.cs: Added base class constraint based type inference.
2802
2803 2008-02-01  Marek Safar  <marek.safar@gmail.com>
2804
2805         A fix for bug #357255
2806         * decl.cs: One more missing visibility check.
2807
2808 2008-02-01  Marek Safar  <marek.safar@gmail.com>
2809
2810         * support.cs: Fixed broken return.
2811
2812 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2813
2814         * report.cs: Correctly reset warnings count after probing.
2815
2816 2008-01-25  Martin Baulig  <martin@ximian.com>
2817
2818         * namespace.cs
2819         (NamespaceEntry.SymbolFileID): Make this work again after
2820         MemberName.ToString() is gone.
2821
2822 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2823
2824         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
2825         expressions.
2826
2827 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2828
2829         * generic.cs: Use full implicit conversion for type inference fixing.
2830
2831 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2832
2833         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
2834         Fixed user operator conversions.
2835
2836 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2837
2838         * generic.cs: Do nullable type to null comparison optimization during
2839         resolve phase.
2840
2841 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2842
2843         A fix for bug #355163
2844         * generic.cs: Enabled l-value resolve on nullable expressions.
2845
2846 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2847
2848         A fix for bug #353986
2849         * class.cs: Ingore static ctors with parameters for any further checks.
2850
2851 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2852
2853         A fix for bug #354310
2854         * namespace.cs: Removed redundant check.
2855
2856 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2857
2858         A fix for bug #354928
2859         * expression.cs: ElementInitializers can be resolved only once.
2860
2861 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2862
2863         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
2864         Condition expressions.
2865
2866 2008-01-23  Marek Safar  <marek.safar@gmail.com>
2867
2868         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
2869
2870 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2871
2872         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
2873         not allowed.
2874
2875         * generic.cs: Implemented coalesce expression.
2876
2877 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2878
2879         A fix for bug #355145
2880         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
2881         expression tree type inference.
2882
2883 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
2884
2885         Fix #354663
2886         * expression.cs (Binary.IsUnsignedType): Fix typo.
2887
2888 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2889
2890         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
2891
2892 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2893
2894         A fix for bug #355161
2895         * ecore.cs, expression.cs: Wider range of extension method supported
2896         expressions.
2897
2898 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
2899
2900         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
2901         AssemblyBuilder to operate in compiler context. Fixes mcs part of
2902         bug #354970.
2903
2904 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2905
2906         A fix for bug #355148
2907         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
2908
2909 2008-01-22  Miguel de Icaza  <miguel@novell.com>
2910
2911         * expression.cs (CreateExpressionTree): Add support for or and
2912         logical or, and indent following the coding conventions.
2913
2914         * typemanager.cs (LinqExpression): renamed from
2915         ExpressionTreeManager, for a shorter name.
2916
2917         Use TypeManager.CoreLookupType to lookup types from our core
2918         assemblies and turn those into "Type" variables.
2919
2920         Consumers that previously used "Namespace" and "Type" from this
2921         class should instead use the TypeExpression which is a type that
2922         is fully resolved (without involving the regular C# resolution
2923         rules). 
2924
2925         This typically looks like this:
2926
2927         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
2928         new MemberAccess (texpr, name, type_arguments, loc)
2929
2930         This avoids the problem in: #355178
2931
2932 2008-01-21  Marek Safar  <marek.safar@gmail.com>
2933
2934         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
2935         feature in parser only as we do in other cases.
2936         
2937 2008-01-21  Marek Safar  <marek.safar@gmail.com>
2938
2939         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
2940         typemanager.cs: A refactoring of params arguments to reuse existing
2941         expressions (params -> array initializer) to emit params argument instead
2942         of specialized handling.
2943         It was required by expression tree implementation and it has other benefits
2944         as well, we now apply same optimization for params arguments as we do for
2945         array initializers.
2946         
2947 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2948
2949         A fix for bug #353526
2950         * generic.cs: A type inference of params arguments may not required any
2951         temporary array creation.
2952         
2953 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2954
2955         A fix for bug #353534
2956         * generic.cs, ecore.cs, expression.cs: A method group type inference is
2957         supported for delegates only.
2958         
2959 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2960
2961         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
2962         type for more than 1 candidates.
2963         
2964 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2965
2966         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
2967         expressions.
2968         
2969 2008-01-16  Marek Safar  <marek.safar@gmail.com>
2970
2971         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
2972         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
2973         operator) expressions. 
2974                 
2975 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
2976
2977         * statement.cs: Avoid declaring an IL variable for this_variable since it is
2978         not accessed from the generated IL.
2979
2980 2008-01-14  Marek Safar  <marek.safar@gmail.com>
2981
2982         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
2983         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
2984         statement.cs: The first expression tree implementation drop, mostly
2985         infrastructure work.
2986
2987 2008-01-14  Marek Safar  <marek.safar@gmail.com>
2988
2989         * ecore.cs (IsNestedChild): Refactored.
2990
2991 2008-01-11  Marek Safar  <marek.safar@gmail.com>
2992
2993         * lambda.cs: Don't use a cast on unknown expression statement.
2994
2995 2008-01-10  Geoff Norton  <gnorton@novell.com>
2996
2997         * cs-tokenizer.cs: One more token to distinguish between method and lambda
2998         arguments
2999
3000 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3001
3002         * doc.cs: Report better /doc crash details.
3003         
3004 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3005
3006         A fix for bug #352536
3007         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3008
3009 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3010
3011         A fix for bug #352287
3012         * ecore.cs, expression.cs: Do `this' access checking in all member access
3013         expressions.
3014         
3015 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3016
3017         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3018         
3019         * report.cs: Reset message stacks.
3020         
3021 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3022
3023         * generic.cs (InferInPhases): Correctly calculate params position.
3024         
3025 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3026
3027         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3028         arguments.
3029
3030 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3031
3032         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3033         
3034         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3035         
3036         * driver.cs: Updated --help option.
3037         
3038 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3039
3040         * generic.cs (InferParamsTypeArguments): Removed.
3041         (InferInPhases): Add params type inference.
3042         (LowerBoundInference): Fixed scoring mechanism.
3043         
3044         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3045         
3046 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3047
3048         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3049         byte array for unsigned "baked" assemblies.
3050
3051 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3052
3053         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3054         array for assemblies that are not strongnamed.
3055
3056 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3057
3058         A fix for bug #351481
3059         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3060         declaring type for nested generic types.
3061         
3062 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3063
3064         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3065         instead of ToString.
3066         
3067 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3068
3069         A fix for bug #351047
3070         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3071         null and structs only when equality and inequality operators are defined
3072         either as an user-operators or predefined operators.
3073         
3074 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3075
3076         A fix for bug #351047
3077         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3078         
3079 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3080
3081         A fix for bug #351257
3082         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3083         
3084 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3085
3086         A fix for bug #351157
3087         * class.cs (Using): Fixed yet another broken cloning.
3088         
3089         (Block): Put back more sensible default value for statements.
3090         
3091 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3092
3093         * codegen.cs: Allow AssemblyVersion with only major version component.
3094         Fixes bug #351055.
3095
3096 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3097
3098         A fix for bug #324654
3099         * class.cs: Use FullName property as member name.
3100
3101 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3102
3103         A fix for bug #342117
3104         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3105         constructor constraint.
3106
3107 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3108
3109         A fix for bug #338273
3110         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3111         only.
3112
3113 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3114
3115         A fix for bug #350839
3116         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3117
3118 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3119
3120         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3121         GHOP:
3122         
3123         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3124
3125         * statement.cs: Changed some Hashtables to use HybridDictionaries
3126         instead. It was observed that some HashTables only contained a few
3127         items in the vast majority of cases. Since HybridDictionary is
3128         more efficient on small sets (<10 elements), "known_variables"
3129         from class ExplicitBlock as well as "labels" and "constants " from
3130         class Block were changed to HybridDictionaries. 
3131
3132         Atsai results: (56216kb->54987kb)
3133
3134         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3135
3136
3137 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3138
3139         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3140         GHOP:
3141         
3142         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3143         
3144         * expression.cs: foreach loop to for loop, saved on allocation of
3145         enumerator (59333kb->59141kb)
3146
3147         * statement.cs. Changed foreach loops to for loops, saved on
3148         allocation of enumerator (59141kb->59006kb)
3149
3150         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3151         when constructed with no specified capacity. This was causing a
3152         few ArrayLists to allocate more memory than they would potentially
3153         need in the Block class and MemberCache class. Setting the
3154         ArrayLists to construct with a capacity of 1 saves some
3155         memory. (56216kb->55585kb)
3156
3157 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3158
3159         A fix for bug #347189 (2nd issue)
3160         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3161         type.
3162
3163 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3164         
3165         * report.cs: Do not use colors if stdout and stderr are not a
3166         terminal.
3167
3168 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3169
3170         A fix for bug #346998
3171         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3172         overloads.
3173
3174 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3175
3176         A fix for bug #343465
3177         * class.cs: Explicit method name for nested types uses dots only.
3178
3179 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3180
3181         A fix for bug #343707
3182         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3183
3184 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3185
3186         * ecore.cs: Report type inference errors only when arguments count matches
3187         parameter count.
3188         
3189         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3190         
3191         * expression.cs, report.cs: New warning.
3192         
3193         * typemanager.cs: Catch anonymous method type too.
3194
3195 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3196
3197         A fix for bug #346379
3198         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3199
3200 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3201
3202         A fix for bug #347359
3203         * expression.cs (Invocation): Don't resolve already resolved expression.
3204
3205 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3206
3207         A fix for bug #347189
3208         * class.cs (FixedField): Use non-dependent code only in the define phase.
3209
3210 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3211
3212         A fix for bug #348076
3213         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3214
3215 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3216
3217         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3218         discovered extension methods.
3219
3220 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3221
3222         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3223         method.
3224
3225 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3226
3227         * report.cs (ErrorMessage): Add support for using colors on
3228         terminals that support it. 
3229
3230 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3231
3232         * ecore.cs: Use information about expanded params for error reporting.
3233
3234 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3235
3236         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3237         and logic for params overloads.
3238         
3239 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3240
3241         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3242         as this is also created from the parser.  Fixes #349034
3243
3244 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3245
3246         * statement.cs (Throw.CloneTo): it is valid to have empty
3247         expressions for throw. 
3248
3249 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3250
3251         * cs-parser.jay: Set delegate constraint parsing region correctly.
3252
3253 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3254
3255         A fix for bug #345467
3256         * typemanager.cs (IsEqual): Compare generic parameters position only.
3257         
3258 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3259
3260         * expression.cs (BaseAccess): Type arguments can be null.
3261
3262 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3263
3264         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3265         consistent even when an error has occured.
3266         (Switch.Resolve): Likewise.
3267
3268 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3269
3270         A fix for bug #334505
3271         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3272         overrides.
3273         
3274 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3275
3276         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3277         refactorings required to resolve extension methods correctly when mixing
3278         generics and non-generics members.
3279         
3280 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3281
3282         A fix for bug #342584
3283         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3284         conversion.
3285         
3286 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3287
3288         A fix for bug #342512
3289         * delegate.cs: Use delegate argument expression when is available. Don't
3290         emit virtual call when class is sealed.
3291         
3292 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3293
3294         A fix for bug #325423
3295         * assign.cs (FieldInitializer): Use resolved expression for emit.
3296         
3297         * class.cs: Print less confusing error message.
3298         
3299 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3300
3301         * cs-tokenizer.cs: Removed GMCS ifdefs.
3302         
3303         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3304         mcs.
3305         
3306         * cs-parser.jay: Disabled nullable check.
3307         
3308         * generic-mcs: Copied more generic stuff.
3309                 
3310 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3311
3312         * gcs-parser.jay: Merged to cs-parser.jay.
3313         
3314         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3315         * *.csproj, *.sources: Updated to use only jay parser file.
3316
3317 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3318
3319         * gcs-parser.jay: Added nullable and default expression feature checks.
3320         
3321 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3322
3323         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
3324         it fixes many TODOs and hidden bugs.
3325         
3326         * expression: Removed duplicate error check.
3327
3328 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3329
3330         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3331         implicitly type local variable only when it is used in a declaration.
3332
3333 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3334
3335         * attribute.cs: Use CS0612 for empty strings.
3336
3337 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3338
3339         * lambda.cs, statement.cs: Contextual return may act as a statement.
3340
3341 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3342
3343         A fix for a regression cause by #324222
3344         * class.cs: Don't report unused even when it implements an interface.
3345         
3346 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3347
3348         A fix for bug #341205
3349         * ecore.cs, expression.cs: Method group expression cannot do static
3350         method access with an instance reference check before overloading takes
3351         a place.
3352         
3353 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3354
3355         A fix for bug #325359
3356         * class.cs: Use predictable name for automatically generated property.
3357         
3358 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3359
3360         A fix for bug #324996
3361         * expression.cs (Is): Handle case where D is nullable and T is not
3362         correctly.
3363         
3364         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3365         
3366 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3367
3368         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3369         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3370         Flush small error reporting changes.
3371         
3372 2007-11-09  Marek Safar  <marek.safar@gmail.com>
3373
3374         A fix for bug #324996
3375         * expression.cs: Rewrote Is expression implementation to work with
3376         generics, nullable types, anonymous method. A const result expression 
3377         uses existing infrastructure instead of custom not fully-featured one.
3378         
3379 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3380
3381         A fix for bug #340202
3382         * class.cs: Consider generics for volatile field.
3383
3384 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3385
3386         A fix for bug #335594
3387         * expression.cs: Use conversion rules when handling string addition.
3388         
3389 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3390
3391         A fix for bug #336651
3392         * expression.cs: Fixed a crash when probing is on.
3393         
3394 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3395
3396         A fix for bug #324242
3397         * covert.cs: Added a conversion from any nullable-type with an 
3398         underlying enum-type to the type System.Enum.
3399         
3400 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3401
3402         A fix for bug #324222
3403         * class.cs: Report all non-used event fields.
3404         
3405 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3406
3407         A fix for bug #325161
3408         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3409         qualifier for generic types.
3410         
3411 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3412
3413         A fix for bug #322971
3414         * expression.cs, ecore.cs: Added intermediate result value check for
3415         indexers. 
3416         
3417 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3418
3419         A fix for bug #324754
3420         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3421         when it was requested.
3422
3423 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3424
3425         A fix for bug #325101
3426         * expression.cs: Do type not value comparison for `is' expression.
3427
3428 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3429
3430         A fix for bug #320236
3431         * convert.cs: Don't apply user conversion on underlying target type.
3432
3433 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3434
3435         * expression.cs: Don't use unresolved expression for error reporting.
3436  
3437 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3438
3439         A fix for bugs #337712, #324490
3440         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3441         overloading resolution too.
3442         
3443         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3444         the process consistent and more robust.
3445         
3446         * expression.cs, linq.cs, report.cs: Update.
3447
3448 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3449
3450         A fix for bug #332909
3451         * attribute.cs: Resolve attributes in correct context using error
3452         handling procedure.
3453         
3454         * rootcontext.cs: Define Obsolete attribute members as core members.
3455         
3456 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3457
3458         * statement.cs: Removed unused methods.
3459         
3460 2007-10-31  Wade Berrier  <wberrier@novell.com>
3461
3462         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
3463         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3464         during 'make dist')
3465
3466 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3467
3468         A fix for bug #338102
3469         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3470         methods registered as non-generics.
3471         
3472 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3473
3474         A fix for bugs #337712, #324490
3475         * delegate.cs: Delegate covariance and contravariance is not allowed for
3476         value types.
3477         
3478 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3479
3480         A fix for bug #337719 
3481         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3482         `from' keyword.
3483         
3484 2007-10-30  Marek Safar  <marek.safar@gmail.com>
3485  
3486         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3487
3488 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3489  
3490         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3491         query expressions.
3492
3493 2007-10-29  Raja R Harinath  <rharinath@novell.com>
3494
3495         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3496
3497 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3498  
3499         A fix for bug #334652
3500         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3501         extension methods when we have not found the best candidate in normal
3502         container.
3503
3504 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3505
3506         * AssemblyInfo.cs: Keep up-to-date.
3507
3508 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3509
3510         * Makefile: Fixed generics compiler name.
3511         
3512 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3513
3514         * lambda.test: removed, lambda parsing is done differently.
3515         
3516         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3517
3518 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
3519
3520         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3521
3522 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3523
3524         * Makefile, *.sources : All C# compilers are in mcs folder.
3525         
3526         * *.cs: Use existing 2_1 define for smcs.
3527
3528 2007-10-26  Marek Safar  <marek.safar@gmail.com>
3529
3530         A fix for bug #335847
3531         * assign.cs, expression.cs: Couple of changes to avoid creating a
3532         temporary variable for each object initializer assignment statement. It
3533         simplifies struct initialization too, otherwise two temporary variables
3534         would be required.
3535         Implemented optimization of redundant default element initializers.
3536         
3537 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3538
3539         A fix for bug #336766
3540         * expression.cs (Class.CheckBase): Use generic name when method is
3541         generic.
3542         
3543 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3544
3545         A fix for bug #334737
3546         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3547         variable and not variable argument for prepared copies.
3548
3549 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3550
3551         A fix for bug #325110
3552         * class.cs, expression.cs, attribute.cs: Use open generic method when
3553         checking conditional attribute.
3554         
3555 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3556
3557         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
3558         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3559         FeatureIsNotAvailable.
3560
3561 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3562
3563         ** C# 3.0 Partial methods
3564         
3565         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3566         methods support. Because of member cache issue with generics only
3567         non-generics partial methods are fully supported.
3568         
3569 2007-10-23  Marek Safar  <marek.safar@gmail.com>
3570         
3571         * class.cs, decl.cs: Rewrote member overloads check to cope with 
3572         generics and to use member cache for member checking. It also improves
3573         performance and fixes remaining overloads issues.
3574         
3575 2007-10-20  Marek Safar  <marek.safar@gmail.com>
3576         
3577         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3578         roottypes.cs, typemanager.cs:
3579                 
3580         A member cache creation logic changed to add members immediately and
3581         not rely on fallback. The member cache is now only prefered way
3582         how to access and find type declaration members. It saves 5 MB of memory
3583         during MWF compilation and makes code ready for more optimizations and
3584         clean-ups, it's also a pre-requirement for partial methods.
3585         
3586 2007-10-18  Raja R Harinath  <harinath@gmail.com>
3587
3588         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3589         handling for generic parameters.
3590
3591 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3592         
3593         * class.cs (FixedField): Removed redundant volatile check.
3594         
3595 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3596         
3597         * class.cs, decl.cs: Fixed overload members verification to do only one
3598         check per possible collision.
3599         
3600 2007-10-13  Marek Safar  <marek.safar@gmail.com>
3601         
3602         A fix for bug #325478
3603         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3604         and create only one disposable flags container.
3605         
3606 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3607         
3608         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3609         * statement.cs (Fixed): Fixed variables cloning.
3610         
3611 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3612         
3613         A fix for bug #333342
3614         * class.cs (EventField): Don't mark value type event as synchronized. 
3615         
3616 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3617         
3618         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3619         inference to identify best candidate method correctly.
3620         (ProperyExpr): A range variable is read only and cannot be modified.
3621         
3622 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3623         
3624         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3625         logic to identify best candidate method correctly.
3626         
3627 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3628         
3629         * location.cs (Equals, GetHashCode): Removed.
3630         
3631 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3632         
3633         * report.cs: Implemented message recorder. It is used mainly for lambda
3634         expressions to capture otherwise swallowed error messages.
3635         
3636         * anonymous.cs, lambda.cs.cs: Do full parameters check.
3637
3638         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3639         and not at the top.
3640         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3641                 
3642         * expression.cs (MemberAccess): Always report lookup failure.
3643         
3644         * location.cs: Implemented Equals, GetHashCode.
3645         
3646         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3647         
3648 2007-10-10  Jb Evain  <jbevain@novell.com>
3649
3650         * codegen.cs: re-enable assembly version check.
3651
3652 2007-10-09  Marek Safar  <marek.safar@gmail.com>
3653         
3654         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3655         checks.
3656         
3657         * namespace.cs (UsingAlias): Do correct version check.
3658         
3659 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3660         
3661         * expresison.cs, ecore.cs: Issue extension method error message when
3662         appropriate.
3663         
3664         * rootcontext.cs: Added ISO_2 compiler mode option.
3665
3666 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3667         
3668         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3669          message.
3670         
3671 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3672         
3673         * attribute.cs (GetString, GetBoolean): Work with both literal and
3674         constant.
3675         
3676         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3677         Moved method overload specific methods to MethodGroupExpr.
3678         
3679         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3680         it should be less memory consuming.
3681         
3682 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
3683
3684         * codegen.cs: remove the assembly version check until the buildbot is
3685         fixed.
3686
3687 2007-10-07  Jb Evain  <jbevain@novell.com>
3688
3689         * attribute.cs (Attribute.GetString): if the value
3690         expression is a StringConstant, return its string value.
3691
3692 2007-10-07  Jb Evain  <jbevain@novell.com>
3693
3694         * typemanager.cs: add `assembly_version_attribute_type`.
3695         * codegen.cs: on attribute emission, check that the
3696         AssemblyVersionAttribute doesn't overflow.
3697
3698 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3699         
3700         A fix for bug #324677
3701         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
3702         parent container of a scope container with currently resolved one. 
3703         
3704 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3705         
3706         A fix for bug #325534
3707         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
3708         only.
3709         
3710 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3711         
3712         A fix for bug #327504
3713         * class.cs (Operator.Define): Refactored implicit and explicit user
3714         operator conversion rules.
3715         
3716 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3717         
3718         A fix for bug #327520
3719         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
3720         
3721 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3722         
3723         A fix for bug #328022
3724         * class.cs (MethodData.Define): Use correct method to check whether
3725         a method implementents an accessor.
3726         
3727 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3728         
3729         A fix for bug #330069
3730         * statement.cs (Fixed.Resolve): Read the first array element only when
3731         an array is instantiated. 
3732         
3733 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3734         
3735         * expression.cs, assign.cs, generics.cs: Print correct operator when
3736         compound assignment is used.
3737         
3738 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3739         
3740         A fix for bug #325841
3741         * expression.cs (ArrayAccess): Use full argument cloning only for
3742         string compound concatenation.
3743         
3744 2007-10-03  Marek Safar  <marek.safar@gmail.com>
3745         
3746         A fix for bug #328774
3747         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
3748         assignment.
3749         (PropertyExpr.EmitAssign): Fixed string concatenation compound
3750         assignment.
3751
3752 2007-10-03  Raja R Harinath  <rharinath@novell.com>
3753
3754         Fix #328490
3755         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
3756         Event accessibility checks here.  Remove some bogus code that
3757         accidently made GenericMethods work.
3758         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
3759
3760 2007-09-25  Marek Safar  <marek.safar@gmail.com>
3761         
3762         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
3763         
3764         * statement.cs (Block): Refactored AddVariable to allow error handling
3765         customization.
3766         
3767         * generic.cs: New stub.
3768         
3769 2007-09-23  Marek Safar  <marek.safar@gmail.com>
3770         
3771         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
3772         flag.
3773         
3774 2007-09-17  Marek Safar  <marek.safar@gmail.com>
3775
3776         * class.cs: Use partial container to record whether any partial part
3777         contains static field initializer and therefore default contructor has
3778         to be defined.
3779         
3780 2007-09-14  Marek Safar  <marek.safar@gmail.com>
3781
3782         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
3783         mono-list when only one of two partial parts has defined accessibility
3784         modifier.
3785         
3786 2007-09-14  Marek Safar  <marek.safar@gmail.com>
3787
3788         A fix for bug #82845
3789         
3790         * class.cs (TypeContainer): Set correct resolve context for all field
3791         initializers.
3792         
3793 2007-09-13  Marek Safar  <marek.safar@gmail.com>
3794
3795         * assign.cs: Fixed a crash when field is resolved twice with an error.
3796         
3797         * codegen.cs: Changed InFieldInitializer to be flag.
3798         
3799         * anonymous.cs, ecore.cs, expression.cs: Update after
3800         IsInFieldInitializer rename.
3801         
3802         * const.cs: Removed unused parameter.
3803         
3804         * class.cs: Changed the way how we resolve and emit field initializers.
3805         The field initilizers have to have access to contructor block to emit
3806         compiler generated code.
3807
3808 2007-09-13  Marek Safar  <marek.safar@gmail.com>
3809
3810         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
3811         generics use TypeContainer instead.
3812         
3813 2007-09-12  Marek Safar  <marek.safar@gmail.com>
3814         
3815         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
3816
3817         * lambda.cs (ResolveParameters): Use more powerful
3818         InflateGenericArgument.
3819         
3820         * parameters.cs: Better exception message.
3821                 
3822 2007-09-10  Marek Safar  <marek.safar@gmail.com>
3823
3824         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
3825         correct expression block type. 
3826         
3827         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
3828         
3829         * expression.cs (Invocation): Extracted method group resolve to
3830         DoResolveOverload.
3831         
3832 2007-09-07  Marek Safar  <marek.safar@gmail.com>
3833
3834         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
3835         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
3836         
3837         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
3838         generic extension methods.
3839
3840 2007-09-06  Marek Safar  <marek.safar@gmail.com>
3841
3842         A fix for bug #82676 (Do I get it right now?)
3843         * convert.cs (Binary.ResolveOperator): An interface is converted to the
3844         object before a standard conversion is applied.
3845         
3846 2007-09-06  Marek Safar  <marek.safar@gmail.com>
3847
3848         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
3849         #82676.
3850         
3851 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3852
3853         A fix for bug #82676
3854         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
3855         non-generic interface types.
3856         
3857 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3858
3859         A fix for bug #82690
3860         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
3861         
3862 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3863
3864         A fix for bug #82571
3865         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
3866         modifier for container based methods.
3867         
3868 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3869
3870         A fix for bug #82676
3871         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
3872         any interface-type T means to any of interface type T.
3873
3874 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3875
3876         * namespace.cs: We have 2 versions of System.Core assembly.
3877
3878 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3879
3880         A fix for bug #82652
3881         * class.cs (Class.GetClassBases): Compare types and not expressions.
3882
3883 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3884
3885         A fix for bug #82620
3886         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
3887         actually never worked before.
3888         (IndexerAccess): Emit prepared arguments before they are modified.
3889         
3890 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3891
3892         A fix for bug #82563
3893         * assign.cs: Revert wrong fix.
3894         
3895         * expression.cs (VariableReference.EmitAssign): Handle ref reference
3896         correctly.
3897         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
3898         Instead of ldelema/stdind we have to use temporary variables to handle
3899         cases like String.Concat (params string[]).
3900         
3901 2007-08-31  Marek Safar  <marek.safar@gmail.com>
3902
3903         * class.cs: EmitAttributes to Emit rename.
3904         
3905         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
3906         null.
3907         (MemberCore.HasClsCompliantAttribute): Don't depend on 
3908         GetClsCompliantAttributeValue execution.
3909         
3910 2007-08-31  Marek Safar  <marek.safar@gmail.com>
3911
3912         * anonymous.cs: Use shorter type prefix.
3913         
3914         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
3915         when exist.
3916         
3917         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
3918         variables when probing is on.
3919         
3920         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
3921         unresolved variables.
3922         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
3923         handle transparent identifiers.
3924         
3925 2007-08-26  Marek Safar  <marek.safar@gmail.com>
3926
3927         * attribute.cs (IsClsCompliant): Add nullable types test.
3928         
3929 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3930
3931         * doc.cs : catch other types of exception than XmlException to
3932           report CS1570. Fixed bug #82565.
3933
3934 2007-08-23  Marek Safar  <marek.safar@gmail.com>
3935
3936         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
3937         The number of delegate parameters has to match.
3938         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
3939         arrays.
3940
3941 2007-08-21  Marek Safar  <marek.safar@gmail.com>
3942
3943         * anonymous.cs (AnonymousMethod): Generate private anonymous method
3944         to fix problem with private arguments.
3945
3946 2007-08-20  Marek Safar  <marek.safar@gmail.com>
3947
3948         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
3949         
3950         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
3951         
3952         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
3953         empty. Add cloning suport.
3954         
3955         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
3956
3957 2007-08-20  Marek Safar  <marek.safar@gmail.com>
3958
3959         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
3960         to create EmptyCast. It handles EmptyConstantCast specialization for
3961         constants.
3962         
3963 2007-08-18  Marek Safar  <marek.safar@gmail.com>
3964
3965         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
3966         (EmitArrayArgument): One routine for array arguments.
3967         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
3968         
3969 2007-08-17  Marek Safar  <marek.safar@gmail.com>
3970
3971         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
3972
3973 2007-08-17  Marek Safar  <marek.safar@gmail.com>
3974
3975         * anonymous.cs: MemberLookupFinal update.
3976
3977         * class.cs (ConstructorInitializer): Is expression based.
3978         
3979         * delegate.cs: MethodGroupExpr update.
3980         
3981         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
3982         messages.
3983         (Error_MemberLookupFailed): Customizable error override.
3984         (MethodGroupExpr): Keep queried type for later usage.
3985         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
3986         resolve.
3987         
3988         * expression.cs: Error_MemberLookupFailed refactoring.
3989         (New.DoResolve): Resolve as much as possible.
3990         (ElementInitializer.Error_MemberLookupFailed): Object initializer
3991         customization for invalid member types.
3992
3993         * statement.cs: MethodGroupExpr update.
3994         
3995 2007-08-16  Marek Safar  <marek.safar@gmail.com>
3996
3997         * modifier.cs (Check): Check all modifiers and not only accessibility
3998         ones.
3999
4000 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4001
4002         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4003         type and not an expression.
4004
4005 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4006
4007         * statement.cs (Catch.Clone): Type and variable can be null.
4008
4009 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4010
4011         A fix for bug #81979
4012         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4013         I am really not sure whether this is the best fix.
4014         
4015         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4016         only once.
4017         
4018 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4019
4020         ** C# 3.0 Object and collection initializers (major re-write)
4021         
4022         * assign.cs (DoResolve): Initializers are not assign related.
4023         
4024         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4025         used during collection or object initialization.
4026         
4027         * expression.cs (Error_InvalidArguments): Add initializers specific
4028         messages. More will come later because it requires some general
4029         refactoring.
4030         (New.DoResolve): Better error handling for unsafe types.
4031         (EmptyExpressionStatement): New class.
4032         (ElementInitializer): An object initializer expression.
4033         (CollectionElementInitializer): A collection initializer expression.
4034         (CollectionOrObjectInitializers): A block of object or collection
4035         initializers.
4036         (NewInitialize): New expression with element/object initializers.
4037         
4038         * statement.cs: Reverted object/collection initializer hacks.
4039         
4040         * typemanager.cs (CSharpName): Filter __arglist type.
4041         
4042 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4043
4044         ** C# 3.0 Anonymous Types (update to the latest standard)
4045         
4046         * expression.cs (Binary.ResolveOperator): Threat all null based types
4047         same.
4048         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4049         (AnonymousTypeParameter): Updated.
4050         
4051         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4052         (AnonymousTypeClass): New anonymous type container.
4053         
4054         * class.cs (AddField): Return operation result.
4055         
4056         * generic.cs: Another empty TypeArguments overload.
4057         
4058         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4059         are stored at top of normal hierarchy.
4060         
4061         * typemanager.cs (CSharpName): Filter anonymous types.
4062         
4063 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4064
4065         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4066         as single Concat call. How could we miss that :-(
4067         
4068 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4069
4070         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4071         
4072 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4073
4074         * expression.cs: Fix the previous commit, the creation of the
4075         arguments array list needs also to be conditional on the arguments
4076         not being null.
4077
4078         * class.cs: Add a little bit of help to help narrow down problems.
4079
4080         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4081         not try to copy in that case. 
4082
4083         * driver.cs: When building SMCS, include a new different set of
4084         default assemblies here.   Do this here so we can control whether
4085         to include the default assemblies with /noconfig.
4086
4087 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4088
4089         A fix for bug #81979
4090         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4091         only.
4092
4093 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4094
4095         A fix for bug #82300
4096
4097         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4098         we are in probing scope.
4099
4100 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4101
4102         A fix for bug #82301
4103
4104         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4105         (Statement.CloneTo): Clone and not map children blocks.
4106
4107 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4108
4109         A fix for bug #82299
4110
4111         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4112         variable too.
4113         
4114         * statement.cs (Statement.CloneTo): Clone variables before statements
4115         to allow remaping of local variables.
4116
4117 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4118
4119         A fix for bug #82296
4120
4121         * anonymous.cs,
4122         * report.cs: Log crash details for future clone problems.
4123         
4124         * statement.cs (Return.Clone): Don't clone non-existent expression.
4125
4126 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4127
4128         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4129         (Class.AddBasesForPart): Move CS0537 check here from ...
4130         * cs-parser.jay (class_declaration): ... here.  Move calling of
4131         'AddBasesForPart' to ...
4132         (class_bases): ... here.
4133         (struct_declaration, interface_declaration): Update to changes.
4134
4135 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4136
4137         A fix for bug #81923
4138
4139         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4140         conversion is allowed.
4141
4142 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4143
4144         A fix for bug #81564
4145
4146         * ecore.cs (EventExpr): Add IsBase handling.
4147
4148         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4149         too.    
4150         
4151 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4152
4153         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4154         * cs-parser.jay: Some whitespace cleanups.
4155         (current_delegate): New.
4156         (type_name): New.
4157         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4158         a dummy code block, and use 'type_name' instead of 'member_name'.
4159         (interface_declaration, class_declaration): Likewise.
4160         (delegate_declaration): Likewise.  Rearrange slightly and use
4161         'current_delegate'.
4162         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4163         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4164
4165 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4166
4167         A fix for bug #82039
4168
4169         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4170         available.
4171
4172         * typemanager.cs (CSharpName): Split to string overload.
4173
4174 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4175
4176         * expression.cs,
4177         * report.cs: Updated warning CS0472.
4178
4179 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4180
4181         A fix for bug #82181
4182         * cs-parser.jay,
4183         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4184
4185 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4186
4187         A fix for bug #82277
4188         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4189
4190 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4191
4192         ** C# 3.0 Type Inference (major bits are working)
4193         
4194         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4195         (.ImplicitStandardConversionExists): Uses compatible.
4196         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4197         (.InferReturnType): New method.
4198         (.Compatible): Refactored.
4199         (.ResolveParameters): Uses factory to create resolved parameters.
4200         (.CompatibleMethod): Add probing mode support.
4201         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4202         clearly distinguish between 2 different operations.
4203         (LambdaMethod): Moved to lambda.cs.
4204         (AnonymousMethod): Removed unused fields and methods.
4205         (AnonymousDelegate): Simplified.
4206         
4207         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4208         
4209         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4210         
4211         * delegate.cs (Delegate): New mehods to reduce code duplication.
4212         (.GetConstructor): New method.
4213         (.GetInvokeMethod): New method.
4214         (DelegateCreation): Updated.
4215         
4216         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4217         does not exist.
4218         (OverloadResolve): Made probing little bit faster.
4219         
4220         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4221         when probing is on.
4222         
4223         * generic.cs (TypeInferenceContext): Dummy implementation.
4224         
4225         * iterators.cs: Updated after Resolve/Define rename.
4226         
4227         * lambda.cs (LambdaExpression)
4228         (.ResolveParameters): Handles both type of arguments and type inference too.
4229         
4230         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4231         (InflateTypes): Updated.
4232         
4233         * support.cs (InflateTypes): Changed signature and updated.
4234         
4235         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4236         (MemberLookup_FindMembers): More MS tricks.
4237         (GetParameterData): Ditto.
4238         (GetDelegateParameters): Uses quick path for dynamic types.
4239         
4240 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4241
4242         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4243         only.
4244
4245 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4246
4247         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4248         syntax.
4249         
4250 2007-07-26  Jb Evain  <jbevain@novell.com>
4251
4252         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4253         which takes a boolean 'report_errors', similar to the GetMethod.
4254         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4255         in .net 2.1, do not report errors here.
4256
4257         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4258         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4259         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4260         in .net 2.1.
4261
4262         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4263         of the type InternalsVisibleToAttribute before the first call
4264         to CoreLookupType which is allowed to fail (third boolean parameter
4265         to true). Because, during the resolution for a type that is not
4266         immediately found, we try to check if the type is not defined in
4267         a friend assembly, and to do so, we need the
4268         InternalVisibleToAttribute.
4269
4270 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4271
4272         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4273         feature that allows structs to be compared against null and inline
4274         the result as true or false.
4275
4276         Notice that the same code is not permitted inside a generic block
4277         of code that would do:
4278
4279         class Foo<T> where T : struct {
4280             bool Eval (T x)
4281             {
4282                  return x == null;
4283             }
4284         }
4285
4286         It is only allowed if the type of T is not bound (no where
4287         clause).   In my opinion, this CSC 2 behavior is broken but people
4288         seem to be using it (IronRuby does, a few bug reports on bugzilla
4289         have it and some people have complained about it).
4290
4291         All of the users that depend on this behavior have code that is
4292         very likely broken. 
4293         
4294         * report.cs (Warning, Error): make these take object arguments,
4295         not strings, as that allows us to take advantage of Format.
4296
4297 2007-07-20  William Holmes  <billholmes54@gmail.com>
4298
4299         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4300           Left member variable for the Count.
4301         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4302           MemberName.CountTypeArguments to avoid a NRE. 
4303
4304         This code is contributed under the MIT X11 license
4305
4306 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4307
4308         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4309
4310 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4311
4312         * doc.cs : generic method arguments are written as ``x while generic
4313           type arguments are `x. Combined with the previous change, fixed bug
4314           #79706.
4315
4316 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4317
4318         Fix #82120
4319         * expression.cs (Binary.ResolveOperator): When converting
4320         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4321
4322 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4323
4324         * doc.cs : when T: or whatever x: is specified, it does not really
4325           check the doc comment's syntax correctness. Fixed bug #82006.
4326
4327 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4328
4329         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4330         LambdaExpression better.
4331         
4332         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4333         
4334         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4335         
4336         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4337         as it can be generated.
4338         
4339         * expression.cs (Invocation.Error_InvalidArguments): Show correct
4340         modifiers.
4341         
4342         * lambda.cs (LambdaExpression): Refactored to share same code with
4343         AnonymousMethodExpression.
4344         
4345 2007-07-17  Marek Safar  <marek.safar@gmail.com>
4346
4347         * anonymous.cs (MakeName): Include host name for easier debugging.
4348         (LambdaMethod): New class for lambda spcecific stuff.
4349         
4350         * attribute.cs: Set EmitContext return type.
4351
4352         * class.cs: Set EmitContext return type.
4353         
4354         * codegen.cs (EmitContext): Return type cannot be null to stop messing
4355         with null/void meaning.
4356         
4357         * iterators.cs (ContainerType): Implemented.
4358         
4359         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4360         
4361         * statement.cs (Return): Updated to lambda expressions.
4362         (Block.CloneTo): Parent can be null.
4363                 
4364 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4365
4366         A fix for bug #81917
4367         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4368         
4369         * class.cs (FixedField): Check whether field is in unsafe scope.
4370
4371         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4372         (FieldExpr.Emit): Fixed buffers cannot be volatile.
4373
4374         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4375         FieldExpr.
4376         
4377         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4378                 
4379 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4380
4381         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4382         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4383         from Report class.
4384
4385 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4386
4387         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4388         
4389 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4390
4391         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4392         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4393         
4394         * codegen.cs(EmitContext): Add ProbingMode flag.
4395         
4396         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4397         
4398         * driver.cs: For now set both warning values.
4399         
4400         * ecore.cs (SimpleName): Name is readonly.
4401         (MethodGroup.OverloadResolve): One quick path for probing.
4402         
4403         * expression.cs (Unary): Set Oper r/o.
4404         (Binary): Set Oper r/o.
4405         (ParameterReference): Set few instance variables as r/o.
4406         (ParameterReference.DoResolveBase): Don't capture aruments when 
4407         the probing is on.
4408         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4409         (Arglist): arguments are private.
4410         (SizeOf): type is private and r/o.
4411         (MemberAccess): arguments are private.
4412
4413         * report.cs: Enhanced reporting on/off capabilities.
4414         
4415         * lambda.cs: Uses ec.IsInProbingMode.
4416         (ContextualReturn): Derives from return.
4417         
4418         * rootcontext.cs: For now set both warning values.
4419         
4420         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4421         copy if one exists.
4422         (Return.Resolve): Don't die immediately.
4423         (Block.Resolve): Speed-up probing.
4424         (Block.CloneTo): Clone only child blocks.
4425
4426 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4427
4428         * iterators.cs: reverted Miguel's latest change (r81925) as it
4429         breaks the build in System.
4430
4431 2007-07-13  Miguel de Icaza  <miguel@novell.com>
4432
4433         * iterators.cs (Yield.CheckContext): Check for the iterator type
4434         also here as we can call into Yield even in codepaths that are not
4435         directly checked by
4436         (MethodOrOperator is the only path that was checked).
4437
4438         In addition to the standard check, use a more specific check for
4439         constructors to report a more verbose error. 
4440
4441 2007-07-12  Miguel de Icaza  <miguel@novell.com>
4442
4443         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4444         report the warning and continue 
4445
4446         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4447         values on the stack on the call to Emit.   Use EmitStatement if
4448         possible, or using Emit + Pop if not possible.   Fixes #82064
4449
4450 2007-07-12  Raja R Harinath  <rharinath@novell.com>
4451
4452         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4453         avoid try...finally in some cases.
4454
4455 2007-07-10  Marek Safar  <marek.safar@gmail.com>
4456
4457         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4458         
4459         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4460         instead of method. Re-use standard error handling.
4461         (ConstructorInitializer.Emit): Simplified.
4462         
4463         * delegate.cs: Updated after Invocation.EmitCall change.
4464         
4465         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4466         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4467         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4468         method and don't permanently changing input arguments.
4469         (MethodGroupExpr): Introduced resolved best_candidate, when method group
4470         is resolved it has one of the candidates is the best one which is later
4471         used to emit. Removed a few unused method.
4472         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4473
4474         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4475         (Binary.ResolveOperator): Ditto.
4476         (ConditionalLogicalOperator.DoResolve): Ditto.
4477         (Invocation): Uses method group.
4478         (Invocation.DoResolve): Simplified.
4479         (Invocation.EmitCall): Removed useless is_static.
4480         (Invocation.Emit): Delegate to method group.
4481         (Invocation.EmitStatement): Simplified.
4482         (New): Uses method group.
4483         (MemberAccess.DoResolve): Don't destroy original expression.
4484         
4485         * statement.cs (ForEach.Resolve): Use null for no method arguments.
4486         
4487 2007-07-04  Marek Safar  <marek.safar@gmail.com>
4488
4489         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4490         
4491         * anonymous.cs,
4492         * lambda.cs: Add custom error message type.
4493
4494 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4495
4496         * lambda.cs: Simplified little bit.
4497         
4498         * parameter.cs: Introduced ImplicitLambdaParameter.
4499         (Parameters.CreateFullyResolved): New factory instead of ctor.
4500         
4501         * anonymous.cs,
4502         * class.cs,
4503         * delegate.cs: Updated parameter creation.
4504         
4505 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4506
4507         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4508         arguments.
4509         
4510         * generic.cs: Synchronized with gmcs.
4511         
4512 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4513
4514         * class.cs (Indexer): Check return type as soon as possible.
4515         
4516         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4517         members too.
4518         
4519         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4520         
4521         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4522         
4523         * parameter.cs (Parameter): Use expression type when it is available.
4524         
4525         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4526         method modifier for the first parameter only.
4527
4528 2007-06-24  Marek Safar  <marek.safar@gmail.com>
4529
4530         A fix for bug #81938
4531         * typemanager.cs (ChangeType): Fixed couple of char conversions.
4532         
4533         * constant.cs: Tide up an exception message.
4534
4535 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4536
4537         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4538         an uninitialized variable is used.
4539         
4540         * expression.cs (LocalVariableReference.DoResolve): Ditto.
4541
4542 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4543
4544         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4545         not found error handling.
4546
4547         * expression.cs (ArrayCreation): Removed redundant fields and little bit
4548         simplified.
4549         (ArrayCreation.ResolveArrayElement): To be ready to customization.
4550         (ArrayCreation.DoResolve): Simplified.
4551         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4552         its own resolve process.
4553         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4554
4555 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4556
4557         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4558         more error details.
4559         
4560 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4561
4562         * cs-tokenizer.cs: Removed var related stuff.
4563         
4564         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4565         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4566         a type and a keyword at same time.
4567         
4568         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4569         matches to "var".
4570         
4571         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4572         implicitly typed arrays, more changes will follow.
4573         
4574         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4575         
4576 2007-06-19  Marek Safar  <marek.safar@gmail.com>
4577
4578         * ecore.cs (VarExpr): Removed Handled field.
4579         
4580         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4581         build-in assign functionality.
4582         (ForEach.Resolve): Removed all implicitly typed local variable code and
4583         simplified.
4584         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4585         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4586
4587 2007-06-18  Marek Safar  <marek.safar@gmail.com>
4588
4589         * assign.cs: Removed implicitly typed local variable check.
4590         
4591         * expression.cs (LocalVariableReference.DoResolve): Add check for self
4592         referencing implicitly typed local variable.
4593         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4594         variable here.
4595         
4596         * statement.cs (Fixed): Removed unsupported implicitly typed local
4597         variable code.
4598
4599 2007-06-15  Marek Safar  <marek.safar@gmail.com>
4600
4601         * decl.cs (MemberName): Moved all Unbound stuff to parser.
4602
4603 2007-06-14  Marek Safar  <marek.safar@gmail.com>
4604
4605         A fix for bugs #81855 and #76274
4606         * attribute.cs (AttachTo): Always set owner for global attributes to
4607         prefined owner.
4608         
4609         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4610         usefull too.
4611         
4612         * cs-parser.jay: Assembly and module attributes must precede all other
4613         elements except using clauses and extern alias declarations.
4614
4615 2007-06-13  Marek Safar  <marek.safar@gmail.com>
4616
4617         A fix for bug #81748
4618         * cs-tokenizer.cs,
4619         * expression.cs: More checks for non ISO-1 features.
4620
4621 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4622
4623         A fix for bug #81807
4624         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4625         present inside switch statement and it is required by nullable check.
4626
4627 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4628
4629         A fix for bug #81840
4630         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4631         when type matching fails.
4632         
4633         * namespace.cs: Tiny error message change.
4634
4635 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4636
4637         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4638         reporting. Added automatic property check.
4639         
4640         * class.cs: Updated after CheckAbstractAndExtern relocation.
4641         (AEventPropertyAccessor.GetSignatureForError): Customized.
4642         
4643 2007-06-11  Marek Safar  <marek.safar@gmail.com>
4644
4645         * class.cs (DefineBaseTypes): Base type can be undefined.
4646         
4647         * ecore.cs (TypeLookup): Minor refactoring.
4648         (DoResolveAsTypeStep): Removed redundant check.
4649
4650         * namespace.cs (Lookup): Removed redundant check.
4651                 
4652         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
4653         ResolveAsTypeTerminal step.
4654         (BootstrapCorlib_*): Simplified.
4655         (PopulateCoreType): Core types can be now external.
4656
4657 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4658
4659         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4660          verification only.
4661          (InferTypeArguments): Infers anonymous expression type arguments.
4662          (Compatible): Split to Compatible and InferTypeArguments. 
4663         
4664         * lambda.cs: Updated.
4665
4666 2007-06-08  Marek Safar  <marek.safar@gmail.com>
4667
4668         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4669
4670 2007-06-07  Raja R Harinath  <harinath@gmail.com>
4671
4672         Fix #80477, cs0135-2.cs, cs0135-3.cs
4673         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4674         names to the "known" variables list.
4675         (Block.CheckInvariantMeaningInBlock): Handle the fact the
4676         parameter names are also "known".
4677         (Block.CheckError136): Remove.
4678         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
4679         null.
4680
4681 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4682
4683         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
4684
4685 2007-06-06  Marek Safar  <marek.safar@gmail.com>
4686
4687         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4688         internal error not an user error.
4689          
4690         * expression.cs (IsApplicable): Refactored to make debugging easier.
4691
4692         * support.cs: More tricks for non-mono runtimes.
4693         
4694         * typemanager.cs (CoreLookupType): Made public.
4695         (InitSystemCore): All linq specific stuff moved to linq.cs
4696
4697 2007-06-05  Marek Safar  <marek.safar@gmail.com>
4698
4699         * typemanager.cs (CSharpSignature): One more missing build-in types
4700         replacement.
4701         More tricks for non-mono runtime.
4702
4703 2007-06-05  Raja R Harinath  <harinath@gmail.com>
4704
4705         * statement.cs (Block.CheckError136_InParents): Remove.
4706         (Block.AddVariable): Use GetParameterInfo instead.
4707         (ToplevelBlock.ProcessArguments): Likewise.
4708
4709 2007-06-04  Raja R Harinath  <rharinath@novell.com>
4710
4711         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
4712         information too.
4713         (ToplevelBlock.GetParameterInfo): Split out of ...
4714         (ToplevelBlock.GetParameterRefernce): ... this.
4715         (ToplevelBlock.ParameterMap): Remove.
4716         * expression.cs (ParameterReference): Update to use
4717         ToplevelParameterInfo.
4718
4719         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
4720         regression.
4721
4722         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
4723         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
4724
4725         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
4726         (ToplevelBlock.ProcessParameters) ... here.
4727         (ToplevelBlock..ctor): Invoke it.
4728
4729         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
4730         new parameters.
4731
4732         * statement.cs (IKnownVariable): New interface.
4733         (LocalInfo): Implement it.
4734         (ToplevelParameterInfo): New class.
4735         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
4736         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
4737         GetKnownVariableInfo.
4738
4739 2007-06-03  Raja R Harinath  <harinath@gmail.com>
4740
4741         Partly speed up CS0136 error checks.
4742         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
4743         'recurse' parameter.
4744         (Block.DoCheckError136): Only check errors in parameters.  Move
4745         local variable checks ...
4746         (Block.AddVariable): ... here, and ...
4747         (ToplevelBlock.ResolveMeta): ... here.
4748
4749 2007-06-02  Raja R Harinath  <harinath@gmail.com>
4750
4751         * statement.cs (Block.IsChildOf): Remove.
4752
4753         * statement.cs (Statement.Clone): Move special case code ...
4754         (Block.CloneTo): ... here.
4755
4756 2007-05-29  Raja R Harinath  <rharinath@novell.com>
4757
4758         * statement.cs (ToplevelBlock.container): Remove field.  It's
4759         redundant with 'Parent'.
4760         (ToplevelBlock.ContainerBlock): Remove accessor.
4761         (ToplevelBlock..ctor): Update to changes.  Register anonymous
4762         child with parent here, ...
4763         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
4764         current_block.
4765         (start_anonymous): Don't save current_block.
4766         (top_current_block): Remove.
4767
4768         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
4769         (Block.Resolve): Update to changes.
4770         (Block..ctor): Move setting of "correct" 'Toplevel'
4771         and 'Explicit' fields to ...
4772         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
4773
4774 2007-05-27  Raja R Harinath  <harinath@gmail.com>
4775
4776         Kill Block.Implicit
4777         * statement.cs (Block.Implicit): Remove.
4778         (Block): Update to changes.
4779         * flowanalysis.cs: Likewise.
4780
4781         Mildly speed up CheckInvariantMeaningInBlock
4782         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
4783         Recursively call AddKnownVariable to all enclosing blocks.
4784         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
4785         Remove recursive calls.
4786         (Block): Update to changes.
4787
4788         New ExplicitBlock invariants
4789         * statement.cs (Block.Explicit): New field.  It points to the
4790         immediately enclosing non-implicit block.
4791         (Block..ctor): Maintain the invariant.
4792         * cs-parser.jay: Take advantage of invariant.
4793
4794         Introduce ExplicitBlock
4795         * statement.cs (ExplicitBlock): New.
4796         (ToplevelBlock): Derive from it.
4797         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
4798         sense of flag.
4799         (Block.Implicit): Update to changes.
4800         * cs-parser.jay: Update to changes.
4801
4802         Remove unused field
4803         * codegen.cs (EmitContext.IsLastStatement): Remove.
4804         * statement.cs (Block.DoEmit): Update to changes.
4805
4806 2007-05-25  Raja R Harinath  <rharinath@novell.com>
4807
4808         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
4809         modifying current_block directly.
4810
4811 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
4812         
4813         * class.cs: Implemented automatic properties (C# 3.0)
4814           Thanks to Marek for the help.
4815
4816 2007-05-23  Raja R Harinath  <rharinath@novell.com>
4817
4818         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
4819         variable as assigned, note also that all its components are
4820         assigned too.
4821         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
4822
4823 2007-05-19  Marek Safar  <marek.safar@gmail.com>
4824
4825         * anonymous.cs, class.cs: Emit Compiler generated attribute when
4826         member is marked as compiler generated.
4827         
4828         * decl.cs (MemberCore): Refactored ModFlags into property.
4829
4830         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
4831         (Check): Check only accessibility modifiers.
4832
4833 2007-05-18  Raja R Harinath  <rharinath@novell.com>
4834
4835         Track all assignable slots in one bit array
4836         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
4837         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
4838         logic from VariableMap constructor here.  Use the same 'offset'
4839         variable that's later used for computing offsets of local
4840         variables.
4841         * flowanalysis.cs (UsageVector.parameters): Remove.
4842         (UsageVector): Update to changes.
4843         (VariableMap): Remove.
4844
4845         Avoid creating ParameterMap in every block
4846         * statement.cs (Block.ParameterMap): Move ...
4847         (ToplevelBlock.ParameterMap): ... here.
4848         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
4849         only once.
4850         * flowanalysis.cs (FlowBranching.param_map): Remove.
4851         (FlowBranching.UsageVector): Update to changes.
4852         (FlowBranchingToplevel.CheckOutParameters): Likewise.
4853
4854         * statement.cs (Block.CloneTo): Clone Toplevel field too.
4855
4856         * expression.cs (ParameterReference): Distinguish between block
4857         where parameter was referenced and declared.
4858
4859 2007-05-18  Marek Safar  <marek.safar@gmail.com>
4860
4861         * flowanalysis.cs, statement.cs: Put back improved error handling.
4862
4863 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
4864         
4865         * assign.cs:
4866         * expression.cs:
4867           Imporved object and collection initialization (C# 3.0).
4868
4869 2007-05-15  Marek Safar  <marek.safar@gmail.com>
4870
4871         A fix for bug #81380
4872         * expression.cs (Is.DoResolve): Only value types have constant `is'
4873         behaviour.
4874
4875 2007-05-15  Raja R Harinath  <rharinath@novell.com>
4876
4877         * statement.cs (ToplevelBlock.child): Remove.
4878
4879 2007-05-15  Raja R Harinath  <harinath@gmail.com>
4880
4881         Rationalize ResolveMeta: refactoring
4882         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
4883         out constant handling code into ...
4884         (Block.DoResolveConstants): ... this.
4885
4886         Rationalize ResolveMeta: kill local_map
4887         * statement.cs (Block.local_map, Block.LocalMap): Remove.
4888         (Block.AssignableSlots): New.
4889         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
4890         for locals -- move code from VariableMap here.  Avoid unnecessary
4891         allocations.
4892         * flowanalysis.cs (FlowBranching.local_map): Remove.
4893         (FlowBranching..ctor): Use Block.AssignableSlots.
4894         (VariableMap): Remove unused constructors.
4895
4896 2007-05-11  Raja R Harinath  <rharinath@novell.com>
4897
4898         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
4899
4900 2007-05-11  Marek Safar  <marek.safar@gmail.com>
4901
4902         * typemanager.cs (IsFriendAssembly): Should not be called for building
4903         assembly.
4904
4905 2007-05-09  Marek Safar  <marek.safar@gmail.com>
4906
4907         * literal.cs (NullConstant): Print null in all cases.
4908         
4909         * expression.cs (Binary.ResolveOperator): Implemented delegate
4910          comparison based on C# 2.0 changes.
4911
4912 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
4913
4914         This code is contributed under the MIT X11 license
4915         
4916         The following enables support for several C# 3.0 language features:
4917         
4918         * cs-tokenizer.cs: Added support for the "var" keyword.
4919         
4920         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
4921           Added VarExpr class to facilitate type inferencing.
4922         
4923         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
4924           to support anonymous types.
4925         
4926         * assign.cs: Added support for type inferencing and initialization.
4927         
4928         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
4929         
4930         * expression.cs: Added implicit array support to ArrayCreation.
4931           Added 5 types and 1 interface:
4932           
4933           IInitializable                Implementing classes can inject initializing
4934                                         statements after object instantiation.
4935           
4936           Initializer                   Stores data for object initialization.
4937           
4938           AnonymousType                 An expression for anonymous types.
4939           
4940           AnonymousTypeParameter        Stores data about an anonymous type's field.
4941           
4942           NewInitialize                 An expression for object initialization.
4943           
4944           CollectionInitialize          An expression for collection initialization.
4945         
4946         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
4947           statements.
4948
4949 2007-05-06  Marek Safar  <marek.safar@gmail.com>
4950
4951         A fix for bug #81500
4952         * cs-tokenizer.cs: Add special handling for coalescing operator.
4953
4954 2007-05-06  Marek Safar  <marek.safar@gmail.com>
4955
4956         A fix for bug #81529
4957         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
4958         its value from base class until it is redefined.
4959
4960 2007-05-02  Raja R Harinath  <rharinath@novell.com>
4961
4962         Fix regression in cs0631-3.cs
4963         * cs-parser.jay (operator_declarator): Add opt_attributes to error
4964         fallback.  Make error fallback catch more cases.
4965
4966 2007-05-01  Miguel de Icaza  <miguel@novell.com>
4967
4968         * cs-parser.jay: Allow parameters in operator declarations to have
4969         attributes. 
4970
4971 2007-04-27  Miguel de Icaza  <miguel@novell.com>
4972
4973         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
4974         exists. 
4975
4976         * lambda.cs (ContextualReturn.Resolve): An expression is valid
4977         inside the ContextualReturn, it does not have to be an
4978         ExpressionStatement. 
4979
4980 2007-04-24  Miguel de Icaza  <miguel@novell.com>
4981
4982         * lambda.cs (ContextualReturn.Resolve): if the return type is not
4983         set, set it.
4984
4985 2007-04-23  Miguel de Icaza  <miguel@novell.com>
4986
4987         * anonymous.cs (AnonymousContainer): split the virtual Resolve
4988         method in two methods: ResolveNoDefine and Resolve.
4989
4990         ResolveNoDefine will stop just after ResolveTopBlock has been
4991         called.   
4992
4993         Resolve will then continue by creating a method and issuing the
4994         call to method.Define ().
4995
4996         (AnonymousMethod): Split and implement the new Resolve and
4997         ResolveNoDefine as well.
4998
4999         * lambda.cs (LambdaExpression): Split the anonymous method
5000         resolution code into a separate routine (CoreCompatibilityTest)
5001         from DoCompatibleTest.
5002
5003         (LambdaExpression.TryBuild): New method, this method tries to
5004         build the LambdaExpression with the given set of types to be used
5005         as the types for the various parameters of the lambda expression. 
5006
5007         If the compilation succeed with the given types, the infered type
5008         of the Anonymous method is returned, otherwise null is returned.
5009
5010 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5011
5012         A fix for bug #81414
5013         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5014
5015 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5016
5017         * cs-tokenizer.cs: Change various identifiers here from the
5018         camelCasing to the recommended Linux-like style for instance
5019         variables from the Coding Guidelines. 
5020
5021 2007-04-19  Martin Baulig  <martin@ximian.com>
5022
5023         * convert.cs
5024         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5025         System.Enum to System.ValueType.
5026
5027 2007-04-13  Martin Baulig  <martin@ximian.com>
5028
5029         Rewrote implicit reference conversions.  We need to distinguish
5030         between implicit reference conversions (13.1.4) and implicit
5031         boxing conversions (13.1.5).
5032
5033         According to the spec, there's an an implicit conversion
5034         "From a one-dimensional array-type S[] to IList<T> and base
5035         interfaces of this interface, provided there is an implicit
5036         reference conversion from S to T."  Note that this does not
5037         include boxing conversions.
5038
5039         * convert.cs
5040         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5041         (Convert.ImplicitReferenceConversion): Split into
5042         ImplicitReferenceConversionCore() and
5043         ImplicitBoxingConversionExist().
5044         (Convert.ImplicitReferenceConversionExists): Use the new
5045         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5046
5047 2007-04-12  Martin Baulig  <martin@ximian.com>
5048
5049         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5050         `TypeManager.null_type' checks up to the top of the method.
5051
5052 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5053
5054         A fix for bug #81350
5055         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5056         extension methods.
5057
5058 2007-04-11  Martin Baulig  <martin@ximian.com>
5059
5060         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5061         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5062         to make this work for generic classes; fixes #79561.
5063
5064 2007-04-11  Martin Baulig  <martin@ximian.com>
5065
5066         * expression.cs (As): Add support for nullable types; fixes #79371.
5067
5068 2007-04-11  Martin Baulig  <martin@ximian.com>
5069
5070         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5071         `type.FullName' is null; fixes #80243.
5072
5073 2007-04-11  Martin Baulig  <martin@ximian.com>
5074
5075         * expression.cs (Invocation.IsApplicable): Don't modify the method
5076         if type inference succeeded, but the method was not applicable.
5077         Fixes #81250.
5078
5079 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5080
5081         A fix for bug #81324
5082         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5083         internal and external namespaces containers.
5084
5085 2007-04-10  Martin Baulig  <martin@ximian.com>
5086
5087         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5088         TypeManager.DropGenericMethodArguments() so we also call
5089         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5090
5091 2007-04-10  Martin Baulig  <martin@ximian.com>
5092
5093         * iterators.cs (Iterator.CreateIterator): Don't crash if
5094         `method.ReturnType' is null.  This happens if something went wrong
5095         while resolving that typ (we already reported an error in this case).
5096
5097 2007-04-10  Martin Baulig  <martin@ximian.com>
5098
5099         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5100         generic interfaces; report the CS0144 directly.
5101
5102 2007-04-10  Martin Baulig  <martin@ximian.com>
5103
5104         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5105         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5106
5107 2007-04-10  Martin Baulig  <martin@ximian.com>
5108
5109         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5110
5111 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5112
5113         A better fix
5114         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5115         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5116
5117         Fix #81338
5118         * statement.cs (For.Resolve): If resolution fails, use
5119         KillFlowBranching.
5120
5121 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5122
5123         * anonymous.cs (MakeName): Make faster and zero-based.
5124         (VerifyExplicitParameterCompatibility): Back to mode where generic
5125         parameter is ignored.
5126         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5127
5128         * class.cs (EmitType): Method can emit another new method.
5129
5130         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5131
5132         * driver.cs: Updated.
5133
5134         * lambda.cs: Reuse predefined empty parameters.
5135
5136         * parameter.cs: Updated
5137
5138         * support.cs: Implemented InflateTypes.
5139
5140         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5141         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5142
5143 2007-04-03  Martin Baulig  <martin@ximian.com>
5144
5145         Fix #80632.
5146
5147         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5148         version of TypeManager.IsOverride() which also works with generic
5149         types.  
5150
5151 2007-04-03  Martin Baulig  <martin@ximian.com>
5152
5153         Fix #81044.
5154
5155         * convert.cs
5156         (Convert.ExplicitReferenceConversion): We need to cast when
5157         converting from IList<T> to S[].
5158
5159 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5160
5161         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5162         at this level.
5163         
5164         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5165
5166 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5167
5168         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5169         argument and return type inferring.
5170
5171         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5172         (ReturnType): Turned to property.
5173
5174         * statement.cs (Return): Implemented return type inferring.
5175
5176         * support.cs (ReflectionParameters): Use local types if possible.
5177
5178 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5179
5180         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5181         (FlowBranching.UsageVector): Update to changes.
5182
5183         Prepare to kill 'Reachability'
5184         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5185         argument of constructor.
5186
5187 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5188
5189         Prepare to kill 'Reachability'
5190         * flowanalysis.cs (UsageVector.is_unreachable): New.
5191         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5192         'reachability', and verify they're consistent.
5193
5194         Fix #81121
5195         * expression.cs (New.EmitStatement): Handle type parameters here too.
5196
5197 2007-03-29  Martin Baulig  <martin@ximian.com>
5198
5199         Fix #79148.
5200
5201         * anonymous.cs
5202         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5203         CompilerGeneratedClass.
5204         (ScopeInfo.EmitScopeInstance): Make this protected.
5205         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5206         `ec.CurrentAnonymousMethod.Scope == Scope'.
5207
5208         * statement.cs (Block.ScopeInfo): Make this a property.
5209
5210 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5211
5212         Prepare to kill 'Reachability'
5213         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5214         (FlowBranching.UsageVector.Reachability): Remove property.
5215         (FlowBranching.UsageVector.IsUnreachable): New property.
5216         (FlowBranching.UsageVector.ResetBarrier): New.
5217         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5218         * codegen.cs, statement.cs: Update to changes.
5219
5220 2007-03-27  Martin Baulig  <martin@ximian.com>
5221
5222         Fix #81209.
5223
5224         * decl.cs
5225         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5226         generic types.
5227
5228 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5229
5230         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5231         instead of TriState.  Remove all mention of TriState.
5232
5233         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5234         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5235         and maintain invariants.
5236
5237 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5238
5239         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5240
5241 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5242
5243         * expression.cs: Stop using obsolete 2.0 opcodes.
5244
5245 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5246
5247         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5248         one of the latests Martin's fixes.
5249
5250 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5251
5252         * expression.cs: On BigEndian systems, swap the bytes, temporary
5253         solution until we get a new bitconverter class.
5254
5255 2007-03-23  Martin Baulig  <martin@ximian.com>
5256
5257         Fix #81158.
5258
5259         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5260         "Method" and "Method`1".  Normally, a cache lookup is done on the
5261         "Method" form (ie. without the generic arity), but this one makes
5262         lookups on the full form work as well.
5263
5264 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5265
5266         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5267         unused properties.
5268
5269 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5270         * class.cs: 
5271         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5272         ordered_member_list, to TypeBuilder to store members to be defined
5273         in the order they were parsed in.
5274         - ordered_explicit_member_list contains all properties indexers
5275           and methods that are defined as explicit implementation of an
5276           interface or base class.
5277         - ordered_member_list contains all properties indexers and methods
5278           that are not defined as explicit implementation of an interface
5279           or base class.
5280
5281         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5282         functionality in these removed classes has been replaced with 
5283         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5284         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5285
5286         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5287         to CheckForDuplications inside GetMethod and SetMethod Define Method
5288         to handle method property and indexer name conflicts.
5289
5290         Fixes #79434
5291
5292         All code is contributed under the MIT/X11 license.
5293
5294 2007-03-20  Martin Baulig  <martin@ximian.com>
5295
5296         * class.cs (TypeContainer.Interfaces): Removed; they're now
5297         included in `TypeContainer.Types'.
5298
5299 2007-03-20  Martin Baulig  <martin@ximian.com>
5300
5301         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5302
5303         * class.cs (TypeContainer.CreateType): New public method.  This is
5304         now called before DefineType() to create the TypeBuilders.
5305         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5306         has already been created by CreateType().
5307         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5308         don't resolve our base classes here; this has been moved into
5309         DefineBaseTypes().  We're now called from CreateType().
5310         (TypeContainer.DefineBaseTypes): New private method; resolve our
5311         base classes here.  We're now called from DefineType().
5312
5313         * rootcontext.cs
5314         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5315         our types first to create all the TypeBuilders.  After that, call
5316         TypeContainer.DefineType() on all the types which'll resolve their
5317         base classes and setup the resolve order.
5318
5319 2007-03-20  Martin Baulig  <martin@ximian.com>
5320
5321         * class.cs (TypeContainer.Enums): Removed; they're now included in
5322         `TypeContainer.Types'.  
5323
5324 2007-03-20  Martin Baulig  <martin@ximian.com>
5325
5326         * class.cs
5327         (TypeContainer.DefineType): Don't call ResolveMembers() here.
5328         (TypeContainer.DoResolveMembers): Call DefineType() on our
5329         `compiler_generated' classes; moved here from DefineNestedTypes().
5330
5331         * rootcontext.cs
5332         (RootContext.ResolveTree): Call ResolveMembers() on all
5333         TypeContainer's in the `type_container_resolve_order'.
5334
5335 2007-03-19  Marek Safar  <marek.safar@gmail.com>
5336
5337         * class.cs: Use corlib to handle InternalMethodImplAttribute.
5338
5339 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5340
5341         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5342         implementation flags.
5343
5344 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5345
5346         * class.cs: More optimizations for type parameters.
5347
5348 2007-03-15  Marek Safar  <marek.safar@gmail.com>
5349
5350         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5351
5352         * ecore.cs, parameter.cs: More common code for both corlibs.
5353
5354         * typemanager.cs (IsGenericMethod): Simplified.
5355
5356 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5357
5358         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5359         'returns'.
5360         * statement.cs, iterators.cs, lambda.cs: Update to changes.
5361
5362         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5363         unconditionally.  Simplify explanation.
5364         (Try.Resolve, Using.Resolve): Likewise.
5365
5366 2007-03-15  Martin Baulig  <martin@ximian.com>
5367
5368         Fix #80731.
5369
5370         * decl.cs (DeclSpace): If we're a partial class, use our
5371         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5372
5373 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5374
5375         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5376         'throws'.
5377         (FlowBranching.UsageVector): Update to changes.
5378         (FlowBranching.MergeSiblings): Likewise.
5379         * statement.cs: Likewise.
5380
5381 2007-03-15  Martin Baulig  <martin@ximian.com>
5382
5383         Fix #79302.
5384
5385         * decl.cs
5386         (MemberCache): Added a special .ctor for type parameters.
5387
5388         * typemanager.cs
5389         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5390         `MemberCache'.  
5391
5392 2007-03-09  Martin Baulig  <martin@ximian.com>
5393
5394         * enum.cs (Enum): Make this a TypeContainer.
5395         (EnumMember): Derive from `Const'.
5396
5397         * const.cs
5398         (Const.DoResolveValue): New protected virtual method; move most of
5399         the functionality of ResolveValue() here so we can override it in
5400         `EnumMember'.
5401         (Const.CreateConstantReference): Make this virtual.
5402
5403         * class.cs (Kind): Add `Kind.Enum'.
5404         (TypeContainer.Emit): Don't emit the enums here; they're already
5405         in the `RootContext.typecontainer_resolve_order'.
5406
5407         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5408         here; they're already in the `typecontainer_resolve_order'.
5409
5410         * ecore.cs (EnumConstant.ConvertImplicitly): Add
5411         TypeManager.DropGenericTypeArguments().
5412
5413         * typemanager.cs
5414         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5415         (TypeManager.IsEnumType): Likewise.
5416         (TypeManager.EnumToUnderlying): Likewise.
5417         (TypeManager.IsEqual): Add support for enums.
5418
5419 2007-03-12  Raja R Harinath  <rharinath@novell.com>
5420
5421         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5422         DefaultParameterValueAttribute to be undefined, say if System.dll
5423         is not referenced.
5424
5425 2007-03-11  Marek Safar  <marek.safar@gmail.com>
5426
5427         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5428         any mscorlib.
5429
5430 2007-03-10  Marek Safar  <marek.safar@gmail.com>
5431
5432         * class.cs, parameter.cs: Unified parameters verification.
5433
5434 2007-03-08  Martin Baulig  <martin@ximian.com>
5435
5436         * cs-parser.jay (constructor_header): Pass the location to the
5437         newly created TopLevelBlock.
5438
5439 2007-03-07  Martin Baulig  <martin@ximian.com>
5440
5441         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5442
5443 2007-03-06  Miguel de Icaza  <miguel@novell.com>
5444
5445         * convert.cs (ExplicitReferenceConversionExists): Sync this method
5446         with the changes from David, fixes the build.
5447
5448 2007-03-05  David Mitchell  <dmitchell@logos.com>
5449
5450         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5451         and its base interfaces to a one-dimensional array type S[],
5452         provided there is an implicit or explicit reference conversion
5453         from S to T.
5454
5455 2007-03-03  Marek Safar  <marek.safar@gmail.com>
5456
5457         * cs-tokenizer.cs: Implemented basic linq grammar.
5458
5459         * driver.cs: Set linq lang version on demand.
5460
5461 2007-02-26  Marek Safar  <marek.safar@gmail.com>
5462
5463         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5464
5465 2007-02-25  Marek Safar  <marek.safar@gmail.com>
5466
5467         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5468         (Fixes #80455)
5469
5470         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5471         here.
5472         Check property and event extern attributes.
5473
5474         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5475         charset.
5476
5477 2007-02-24  Marek Safar  <marek.safar@gmail.com>
5478
5479         A fix for bug #80407
5480         * ecore.cs: Don't report ambiguity error when methods have same parent.
5481
5482 2007-02-23  Marek Safar  <marek.safar@gmail.com>
5483
5484         A fix for bug #80878
5485         * class.cs, cs-parser.jay: Event property can host anonymous methods.
5486
5487 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5488
5489         * attribute.cs: Enable ExtensionAttribute presence test.
5490
5491 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5492
5493         * class.cs: Warn about missing GetHashCode only when Equals is override.
5494
5495         * decl.cs: Check accessibility of type arguments.
5496
5497         * typemanager.cs: Correctly report nullable array.
5498
5499 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5500
5501         * class.cs, report.cs: Capture more details when things go wrong.
5502
5503 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5504
5505         A fix for bug #80650
5506         * cs-parser.jay: Anonymous container starts at constructor declaration
5507         and not at block beginning because it has to be usable in constructor
5508         initializer.
5509
5510         * statement.cs: Use context location and not block one for error reporting.
5511
5512 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5513
5514         A fix for bug #78712
5515         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5516         too.
5517
5518 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5519
5520         A fix for bug #80493 by Atsushi Enomoto
5521         * cs-parser.jay: Ignore invalid attribute target.
5522
5523 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5524  
5525         * cs-tokenizer.cs: Ignore '\0' as white space character.
5526
5527 2007-02-17  Miguel de Icaza  <miguel@novell.com>
5528
5529         * cs-parser.jay: Add support for lambda expressions to the mcs
5530         compiler as well.
5531
5532         * lambda.cs: Only clone when we are probing, not on the final call
5533         (Compatible is the final call). 
5534
5535         * statement.cs (CloneContext): Introduce class to provide block
5536         remapping during clone.
5537
5538         All statements Clone themselves now.
5539
5540         (Clone): special handling for blocks, when we clone a block, we
5541         register the block inside this routine, as children of the block
5542         might trigger a lookup. 
5543         
5544         * expression.cs: Add support for CloneContext in all expressions. 
5545         
5546 2007-02-17  Marek Safar  <marek.safar@gmail.com>
5547  
5548         A fix for bug #80493
5549         * statement.cs: Report ambiguous warning when interfaces are not related.
5550
5551 2007-02-15  Marek Safar  <marek.safar@gmail.com>
5552
5553         C# 3.0 extension methods.
5554
5555         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5556         cannot be used directly.
5557
5558         * class.cs (Class.Emit): Emit extension attribute if any class method
5559         is extension method.
5560         (Method.Define): Add basic extension method validation conditions.
5561         (Method.Emit): Emit extension attribute for method.
5562
5563         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5564         extension method exists. Currently we follow same approach as Microsoft
5565         does, emit even if a method or a class are private but this can change
5566         later.
5567
5568         * cs-parser.jay: Add handling of `this' keyword in method parameters
5569         context.
5570
5571         * decl.cs (DeclSpace.IsStaticClass): New property.
5572         (MemberCache.FindExtensionMethods): Looks for extension methods with
5573         defined name and extension type.
5574
5575         * doc.cs: Updated after OverloadResolve changes.
5576
5577         * driver.cs: Add new soft reference to System.Core.dll.
5578
5579         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5580         (ExtensionMethodGroupExpr): Represents group of extension methods.
5581
5582         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5583         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5584         to MethodGroupExpr and made non-static for easier customization.
5585         (Invocation.DoResolve): Add extension method lookup when no standard
5586         method was found.
5587         (MemberAccess.DoResolve): Try extension methods if no member exists.
5588
5589         * modifiers.cs: Add METHOD_EXTENSION modifier.
5590
5591         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5592         as well as candidate extension type.
5593         (ComputeNamespaces): When assembly constains extension methods registers
5594         them.
5595         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5596         extension method lookup.
5597         (Namespace.LookupExtensionMethod): Looks for extension method in this
5598         namespace.
5599         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5600         find a method which matches name and extensionType.
5601
5602         * parameter.cs (Parameter): Add This modifer.
5603         (HasExtensionMethodModifier): New property.
5604         (Resolve): Add extension parameter check.
5605         (ModFlags): turned to property to exclude this modifier as it is not real
5606         parameter modifier.
5607         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5608
5609         * support.cs (ParameterData): Add ExtensionMethodType.
5610         (ReflectionParameters): Implemented ExtensionMethodType interface property.
5611
5612         * typemanager.cs: Add type and ctor extension attribute type.
5613
5614 2007-02-15  Miguel de Icaza  <miguel@novell.com>
5615
5616         * report.cs (DisableErrors, EnableErrors): used to prevent error
5617         output when we are "trying" to compile various methods with
5618         different types. 
5619
5620         * ecore.cs (Expression): Add Clone method that calls the virtual
5621         CloneTo method.  The current CloneTo method in Expression throws
5622         an exception so we can track down all the places where this must
5623         be implemented (not using abstract, because that would be a lot of
5624         up-front-work before we can start testing the implementation
5625         idea). 
5626
5627         Important: we only need Clone capabilities for expressions created
5628         by the parser, as the expressions we will be cloning are
5629         expressions in the pre-resolved state.   This vastly simplifies
5630         the work required. 
5631         
5632         (SimpleName): Add CloneTo that does nothing.
5633         (EmptyCast): Add CloneTo.
5634         
5635         * expression.cs (Binary): Implement CloneTo.
5636         (Invocation.IsApplicable): Store the current ec in
5637         EmitContext.TempEc and restore it on return.  This is used so we
5638         do not have to sprinkle hundres of methods with an extra
5639         EmitContext, we know that the only user is the lambda expression
5640         ImplicitConversionExists code. 
5641         
5642         (Argument): Add Cloning capabilities.
5643         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5644         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5645         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5646         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5647         IndexerAccess): Add Clone capability.
5648
5649         (LocalVariableReference, This): TODO: needs cloned Block mapping.
5650
5651         (Argument): Add cloning capability.
5652
5653         * assign.cs (Assign): Implement CloneTo.
5654
5655         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5656         
5657         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5658         version by calling Convert with the EmitContext (that we are
5659         currently storing in ec, this is not great, but will do for now,
5660         to avoid passing EmitContext parameters to hundreds of functions
5661         that do not need them now).
5662
5663         (SetExpression): Remove, it is not needed.
5664         
5665         (ContextualReturn): Implement CloneTo.
5666
5667         * statement.cs (Statement): Implement cloning infrastructure,
5668         similar to expressions.
5669
5670         (Block): Partial implementation of Clone for statements.
5671
5672         (Return): Implement clone.
5673         
5674         * constant.cs (Constant.CloneTo): New method, does nothing.
5675
5676         * codegen.cs (TempEc): Add a static EmitContext as a temporary
5677         solution, until we decide how to exactly do this.  
5678         
5679 2007-02-14  Marek Safar  <marek.safar@gmail.com>
5680  
5681         A fix for bug #80493
5682         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
5683         a property is override we need to use second accessor.
5684
5685 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5686  
5687         A fix for bug #80418
5688         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
5689         methods.
5690
5691 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5692
5693         Another fix for bug #80749
5694         * pending.cs: Abstract class has priority over interfaces.
5695
5696 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5697
5698         Another fix for bug #80749
5699         * pending.cs: Abstract class has priority over interfaces.
5700
5701 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5702
5703         Another fix for bug #80749
5704         * pending.cs: Abstract class has priority over interfaces.
5705
5706 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5707
5708         Another fix for bug #80749
5709         * pending.cs: Abstract class has priority over interfaces.
5710
5711 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5712
5713         * class.cs Better error message.
5714
5715         * driver.cs: Add shorter versions of -optimize option.
5716
5717 2007-02-13  Martin Baulig  <martin@ximian.com>
5718
5719         * class.cs (Constructor.Emit): Check the return value of
5720         ec.ResolveTopBlock() and return on error.
5721
5722 2007-02-13  Raja R Harinath  <rharinath@novell.com>
5723
5724         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
5725         message to fix error message regression.
5726
5727 2007-02-12  Marek Safar  <marek.safar@gmail.com>
5728
5729         * delegate.cs: Delegate creation expression cannot be of Nullable type.
5730
5731 2007-02-12  Marek Safar  <marek.safar@gmail.com>
5732
5733         A fix for bug #80749
5734         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5735         its parent container.
5736
5737         * class.cs (DefineFieldInitializers): Each initializer can has different
5738         resolve context.
5739
5740         * const.cs: Updated.
5741
5742 2007-02-11  Miguel de Icaza  <miguel@novell.com>
5743
5744         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
5745         now all the heavy lifting to check that embedded statements or
5746         expressions have the right form is done in the ContextualReturn.
5747
5748         (ContextualReturn): New class.  
5749
5750         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
5751         method that can be invoked to report 201, so we do not replicate
5752         this everywhere.
5753
5754         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
5755         
5756         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
5757         treating tabs as spaces. 
5758
5759 2007-02-09  Marek Safar  <marek.safar@gmail.com>
5760
5761         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
5762         * assign.cs: Use full implicit conversion for right side check.
5763
5764 2007-02-09  Marek Safar  <marek.safar@gmail.com>
5765
5766         * statement.cs (Switch): Switch over boolean type is not standardized.
5767
5768 2007-02-08  Marek Safar  <marek.safar@gmail.com>
5769
5770         A fix for bug #80755
5771         * decl.cs (FindBaseEvent): Don't use method cache for events.
5772
5773 2007-02-07  Marek Safar  <marek.safar@gmail.com>
5774
5775         * cs-parser.jay: Better syntax error handling.
5776
5777         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
5778         instead of underlying type value.
5779
5780 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5781
5782         * driver.cs: Check define identifier before is registered.
5783
5784         * namespace.cs: Use existing error message.
5785
5786         * report.cs: New warning.
5787
5788 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5789
5790         A fix for bug #80742
5791         * expression.cs: Delegate Invoke method can be called directly.
5792
5793 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5794
5795         A fix for bug #80676
5796         * class.cs (IsEntryPoint): The Main method can have params modifier.
5797
5798 2007-02-04  Miguel de Icaza  <miguel@novell.com>
5799
5800         * parameter.cs (Parameter, Parameters): Add Clone method.
5801
5802         * anonymous.cs (Compatible): Turn method into virtual method, so
5803         LambdaExpression can implement a different behavior.
5804
5805         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
5806         out the basic checking here, so it can be used by
5807         LambdaExpressions.
5808         
5809         * lambda.cs: Introduce "Compatible" function that will do the
5810         heavy lifting.
5811
5812 2007-02-02  Marek Safar  <marek.safar@gmail.com>
5813
5814         * attribute.cs: Unified one error message.
5815
5816         * class.cs (Class): Use type attributes and not properties to test static
5817         class.
5818         (IsEntryPoint): Don's pass local variable.
5819
5820         * convert.cs: Removed duplicate check.
5821
5822         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
5823
5824         * driver.cs: Don't crash when soft reference does not exist.
5825
5826         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
5827         (UsingEntry): Removed redundant allocation.
5828
5829         * parameter.cs: Add fast path for type parameters.
5830
5831         * support.cs: Don't allocate attribute when it's not used.
5832
5833 2007-01-30  Miguel de Icaza  <miguel@novell.com>
5834
5835         * anonymous.cs
5836         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
5837         this into a virtual method, so we can override it in LambdaExpression.
5838
5839         * driver.cs: Improve diagnostics in case of failure. 
5840
5841         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
5842         write a function that is slightly more complex and that parses:
5843
5844         type identifier [, type identifier]* )
5845
5846         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
5847         this expression:
5848
5849                 (canEmpty ? i >= 0 : i > 0)
5850
5851 2007-01-30  Raja R Harinath  <rharinath@novell.com>
5852
5853         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
5854         exception on possibly valid code.
5855
5856 2007-01-29  Raja R Harinath  <rharinath@novell.com>
5857
5858         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
5859         Push/PopPosition.
5860         (parse_opt_type_arguments): Remove.  It's almost the same as
5861         parse_less_than.
5862         (parse_namespace_or_typename): Use parse_less_than.
5863
5864 2007-01-28  Miguel de Icaza  <miguel@novell.com>
5865
5866         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
5867         this bug took a few hours to find, because the state saved and
5868         restored by PushPosition and PopPosition was ignoring the state of
5869         parse_generic_less_than.
5870
5871         I can also now remove the handling of OP_LT and OP_GT, this solves
5872         the big mistery.
5873         
5874         * cs-tokenizer.cs: store the location for the ARROW token, we use
5875         that in the parser.
5876
5877         (PushPosition, PopPosition): save/restore also `current_token',
5878         restore `parse_generic_less_than' (was missing).
5879
5880         (parse_opt_type_arguments): use parse_type, not
5881         parse_namespace_or_typename to parse types.
5882
5883         * lambda.cs: Empty new file, will eventually have the lambda
5884         expression implementation.
5885
5886         * lambda.test: used to test the internal tokenizer. 
5887
5888         * report.cs (FeatureIsNotISO1): Rename from
5889         FeatureIsNotStandardized, because it was about the language level
5890         (1 vs 2) it was not about standarization.
5891
5892         (FeatureRequiresLINQ): New.
5893
5894         * support.cs (SeekableStreamReader): Only require that the reader
5895         is a TextReader, not a StreamReader, so we can plug StringReader. 
5896
5897         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
5898         given position in the input stream the following tokens can be
5899         parsed as a type followed by an identifier.
5900
5901         (is_punct): after a '(' if parse_type_and_parameter returns true,
5902         then return a special token OPEN_PARENS_LAMBDA which is used to
5903         avoid reduce/reduce errors in the grammar for the
5904         lambda_expression rules.
5905
5906         (parse_type): implement a type parser inside the
5907         tokenizer, the parser only returns true or false depending on
5908         whether the input at a given position can be parsed as a type.
5909
5910         (peek_token): new method used during type parsing.
5911
5912 2007-01-28  Raja R Harinath  <rharinath@novell.com>
5913
5914         Fix #80531
5915         * anonymous.cs (ScopeInfo.InflateParameters): New.
5916         (AnonymousContainer.Resolve): Use it to redirect types of
5917         delegate parameters.
5918
5919 2007-01-27  Raja R Harinath  <rharinath@novell.com>
5920
5921         Fix #80530
5922         * expression.cs (Error_InvalidArguments): Don't use two different
5923         messages for CS1503.  Use ExtraInformation and
5924         SymbolRelatedToPreviousError instead.
5925
5926         Fix #80358
5927         * decl.cs (DeclSpace.initialize_type_params): Don't access
5928         'type_params' of a partial class directly.
5929
5930 2007-01-26  Miguel de Icaza  <miguel@novell.com>
5931
5932         * constant.cs: Removed a handful of out-of-range checks that were
5933         not necessary. 
5934
5935 2007-01-25  Marek Safar  <marek.safar@gmail.com>
5936
5937         * expression.cs (CheckUselessComparison): Add additional check for char
5938         constants.
5939
5940         * namespace.cs: Fixed typo.
5941
5942 2007-01-23  Miguel de Icaza  <miguel@novell.com>
5943
5944         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
5945         gone, instead we inline the test, preventing the needless casts to
5946         longs, ulongs and doubles for the parameters, avoiding calls to
5947         methods that overchecked stuff, and instead inlined things
5948         nicely. 
5949
5950 2007-01-20  Marek Safar  <marek.safar@gmail.com>
5951
5952         * cs-parser.jay: Better parameter error handling.
5953
5954 2007-01-17  Marek Safar  <marek.safar@gmail.com>
5955
5956         A fix for bug #80368, #80522
5957         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
5958         whether array initializer contains constants only.
5959         (ArrayCreation.Emit): Use better formula to decide when
5960         are array initializers for static initialization.
5961         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
5962         have to emit even constants otherwise they are pre-initialized.
5963
5964 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
5965             Raja R Harinath  <rharinath@novell.com>
5966
5967         Fix emit order of 'get' vs. 'set'.
5968         * support.cs (Accessors): New.
5969         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
5970         Note the order in which accessors are declared in the source.
5971         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
5972         Refactored from Property.Define and Indexer.Define.
5973         (PropertyBase.DefineAccessors): New helper that calls the above in
5974         appropriate order as noted by the parser.
5975         (Property.Define, Indexer.Define): Update to changes.
5976         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
5977
5978 2007-01-17  Raja R Harinath  <rharinath@novell.com>
5979
5980         Fix cs0029-6.cs and gcs0029-2.cs (regression)
5981         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
5982         there's an implicit conversion from the current type to the target
5983         type before converting the underlying constant.
5984
5985 2007-01-16  Marek Safar  <marek.safar@gmail.com>
5986
5987         * const.cs (ResolveValue): Updated after constant conversion was made more
5988         generic.
5989
5990         * constant.cs (GetAttributableValue): constant to object conversion is
5991         used for attributes only.
5992         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
5993         constant conversions.
5994         (LongConstant.ConvertImplicitly): Ditto.
5995
5996         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
5997         (ImplicitConversionStandard): Handle constant conversion as extra step.
5998         It solves the issue when constant conversion was called indirectly like
5999         inside array initializer and constant folding was skipped.
6000
6001         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6002         this change.
6003
6004         * statement.cs(ImplicitConversionStandard): Updated after constant
6005         conversion was made more generic.
6006
6007 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6008
6009         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6010         Constraints, solves the problem where the compiler incorrectly
6011         reported that a type parameter was not constrained to a class (Bug
6012         80518)
6013
6014 2007-01-14  Marek Habersack  <grendello@gmail.com>
6015
6016         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6017
6018 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6019
6020         A fix for bug #80368
6021         * assign.cs (FieldInitializer): New class implements field
6022         initializer statement.
6023
6024         * attribute.cs: Update after FieldMember rename.
6025
6026         * class.cs (PropertyBasedMember): New common class for property based
6027         types.
6028         (InterfaceMemberBase): New base class for all members which can be used as
6029         an interface members.
6030         (MethodCore): Moved really common code to InterfaceMemberBase.
6031         (Method.Define): Equal and GetHasCode detection is relevant for methods
6032         only.
6033         (MethodData.Define): Don't assume that public event implements an
6034         interface automatically.
6035         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6036         modifier is used.
6037         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6038         (FieldMember): Merged with FieldBase.
6039         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6040         event extern modifier can be used.
6041         (EventField.EventFieldAccessor): Moved event field specific code here.
6042         (Event.AllowedModifiers): Even event can be extern.
6043         (Event.FindOutBaseMethod): New override specific to events.
6044         (Indexer.parameters): Reintroduce parameters because base class holds
6045         only properties common data.
6046         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6047         need do extra parameters check.
6048
6049         * const.cs: Update after FieldMember rename.
6050
6051         * decl.cs (MemberCache.FindBaseEvent): New method.
6052
6053         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6054         to reflect that indexer is now derived from PropertyBased.
6055
6056         * ecore.cs (GetMemberType): Made public.
6057         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6058         obsolete event.
6059
6060         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6061         
6062         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6063         (RegisterEvent): Removed.
6064         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6065         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6066
6067 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6068
6069         Fix #80249
6070         * statement.cs (CollectionForeach.TryType): Prefer generic
6071         GetEnumerator over non-generic variant.  Fix code to follow comments.
6072
6073 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6074
6075         Fix #80446
6076         * support.cs (ReflectionParameter): Don't use an invalid index on
6077         the generic parameter data.
6078
6079 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6080
6081         * driver.cs: Just add a tiny bit of infrastructure.
6082
6083 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6084
6085         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6086         where field type is struct from current assembly.
6087         
6088         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6089         it is possible.
6090
6091 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6092
6093         A fix for bug #80381
6094         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6095         the core types.
6096
6097         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6098         messages.
6099         (Namespace.LookupType): Always use core types from corlib when speficied.
6100
6101         * report.cs: A new warning.
6102
6103         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6104         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6105         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6106
6107         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6108         (InitCoreTypes): Set expression type of object_type and value_type
6109         immediately after lookup.
6110
6111 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6112
6113         * cs-tokenizer.cs: Accept Pc class characters (Connector
6114         Punctuation) as valid identifiers.  Fixes #78259
6115
6116         * expression.cs (Invocation.DoResolve): Moved the check for the
6117         use of `this' for doing method calls to the Invocation resolution
6118         step, after overload resolution has taken place instead of doing
6119         the check at the low-level `This.DoResolve' level.
6120
6121         The `This.DoResolve'(appens before overload resolution, so it has
6122         no way of knowing if the method that will be called will be
6123         instace or static, triggering an erroneous report for cs0188 (Bug
6124         78113).
6125
6126         We now do the check for instance method invocations after we know
6127         what method will be called.
6128
6129         (This.CheckThisUsage): Move the actual use of this structure
6130         checking into its own method and expose it. 
6131
6132         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6133         EmitContext.
6134
6135         Exceptions: Null.ConvertImplicitly,
6136         Constant.ImplicitConversionRequired as there are too many call
6137         sites for passing the ec. 
6138
6139         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6140         EmitContext, if the value is null, then we do not try to provide
6141         the extra information from the error (If a userdefined conversion
6142         exists, as UserDefinedConversion requires a non null-EmitContext).
6143
6144         Fixes: #80347
6145
6146 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6147
6148         * flowanalysis.cs (MyBitVector): Document some invariants.
6149         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6150         introduced below, and add a couple of others, 
6151
6152 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6153
6154         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6155         GetPropertyFromAccessor and GetEventFromAccessor.
6156         
6157         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6158         overrides non-obsolete one.
6159         (Indexer.Define): Error message has been moved to the parser.
6160
6161         * cs-parser.jay: Better syntax errors handling.
6162
6163         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6164         when an invocation has no arguments.
6165
6166         * ecore.cs: Removed not used caching.
6167
6168         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6169         implementation.
6170
6171         * report.cs: Add a new warning.
6172
6173         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6174
6175         * typemanager.cs (enumeration_type): Removed.
6176         (CSharpSignature): Reuses IsSpecialMethod.
6177         (IsEqual): Hack for MS BCL.
6178         (GetPropertyFromAccessor): New method.
6179         (GetEventFromAccessor): New method.
6180         (IsSpecialMethod): Fixed to handle more cases.
6181
6182 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6183
6184         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6185         Made white spaces array static.
6186
6187         * ecore.cs (RemoveGenericArity): Optimized.
6188
6189         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6190         10 times faster).
6191         (MyBitVector.initialize_vector): Simplified.
6192
6193 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6194
6195         * ecore.cs: Am not entirely happy with this hack, but it seems to
6196         address the issue in 80257 (a small test case for
6197         CreativeDocs.NET). 
6198
6199         I set the MethodGroupExpr.Type to an internal compiler type
6200         (itself in this case) to force the resolution to take place.   Why
6201         it does not take place with a null is beyond me.
6202
6203 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6204
6205         A fix for bug #80288
6206         * expression.cs (ResolveOperator): Consider user defined conversion for
6207         logical and operator too.
6208         (EmitBranchable): Optimization for logical and when full constant folding
6209         could not be applied but one operand is constant.
6210
6211 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6212
6213         * class.cs (GetClassBases): Write 5 times every day, will never use
6214         FullName for error reporting.
6215
6216         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6217
6218 2006-12-19  Martin Baulig  <martin@ximian.com>
6219
6220         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6221         the symbol file info here.
6222
6223 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6224
6225         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6226         of `elseif' is taking then following sections are not taking.
6227         Fixes an issue reported on mono mailing list.
6228
6229 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6230
6231         A fix for bug #80300
6232         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6233         a caller is not taking.
6234
6235 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6236
6237         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6238         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6239         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6240         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6241         * class.cs: Update to changes.
6242
6243 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6244
6245         A fix for bug #79934
6246         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6247         partial container.
6248
6249         * class.cs (ResolveMembers): Register an iterator in current container and
6250         not in shared one.
6251
6252 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6253
6254         Fix test-543.cs
6255         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6256         satisfy a params annotated parameter.
6257
6258 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6259
6260         A fix for bug #77014
6261         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6262         paramters correctly and not rely on hacks in Parameters class.
6263         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6264         at any possition.
6265         (Invocation.VerifyArgumentsCompat): Ditto.
6266         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6267         any possition.
6268
6269         * parameter.cs (HasParams): Don't assume that params is the last one.
6270
6271         * support.cs (ReflectionParameters.ctor): Look for params attribute
6272         correctly.
6273         (ReflectionParameters.ParameterType): Removed hack when we returned last
6274         parameter for out of range parameters.
6275         (ParameterName, ParameterModifier): Ditto.
6276
6277 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6278
6279         A fix for bug #79987
6280         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6281         when assembly is not CLS compliant but type is. I have no idea why is this
6282         allowed.
6283
6284         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6285
6286 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6287
6288         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6289         in struct constructors, they are basically no-ops.
6290
6291 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6292
6293         * cs-tokenizer.cs (Position): Save preprocessor status too.
6294
6295 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6296
6297         A fix for bug #77794
6298         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6299
6300 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6301
6302         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6303         Fixes #69299.
6304         (pp_expr): Report error for an invalid expression.
6305         (handle_preprocessing_directive): Simplified; add more error checking.
6306
6307 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6308
6309         A fix for bug #74939
6310         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6311         directives handling.
6312
6313 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6314
6315         A fix for bugs #80093, and #75984
6316         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6317         logic, it seems to me as it worked before "by coincidence".
6318         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6319         (cleanup): Enabled endif check.
6320
6321 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6322
6323         A fix for bug #80162
6324         * statement.cs (CollectionForeach.TryType): Generics and non-generics
6325         enumerators are never ambiguous.
6326
6327 2006-12-08  Raja R Harinath  <rharinath@novell.com>
6328
6329         Fix #80060
6330         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6331
6332 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6333
6334         A fix for bug #80144
6335         * class.cs (EventProperty.Define): Explicit implementation means
6336         that an even is used.
6337
6338 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6339
6340         Fixes the operators implementation (part II)
6341
6342         * cfold.cs (DoConstantNumericPromotions): Renamed to
6343         DoBinaryNumericPromotions and simplified.
6344         (BinaryFold): Couple of conversion fixes; simplified.
6345
6346         * constant.cs, ecore.cs, literal.cs
6347         (ToType): Renamed to ConvertImplicitly.
6348         (Reduce): Renamed to ConvertExplicitly.
6349
6350         * class.cs, convert.cs: Updated.
6351
6352         * expression.cs: TryReduce doesn't throw an exception.
6353
6354 2006-12-01  Marek Safar  <marek.safar@gmail.com>
6355
6356         A fix for bug #80108
6357         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6358         compatible.
6359
6360 2006-11-30  Marek Safar  <marek.safar@gmail.com>
6361
6362         Fixes unary operators implementation (part I)
6363         Also fixes #80026
6364
6365         * cfold.cs (Error_CompileTimeOverflow): Made internal
6366
6367         * const.cs (IConstant): Changed to use reference to constant and
6368         not constant itself.
6369         Updated IConstant implementations.
6370
6371         * constant.cs (CreateConstant): New factory method.
6372         Updated IConstant implementation.
6373
6374         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6375
6376         * ecore.cs: Updated to use CreateConstantReference.
6377
6378         * enum.cs: Reflects IConstant changes.
6379
6380         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6381
6382         * literal.cs (NullConstant): Change to be independently usable.
6383
6384 2006-11-29  Martin Baulig  <martin@ximian.com>
6385
6386         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6387         we need to emit the scope initializer before calling the base .ctor.
6388
6389         * anonymous.cs: Merged back from the new anonymous methods branch.
6390         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6391
6392         * expression.cs (ParameterReference.DoResolveBase): Create a
6393         "normal" ScopeInfo when capturing parameters rather than using the
6394         root scope; this makes things work with anonymous methods having
6395         parameters.
6396
6397         * statement.cs
6398         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6399
6400 2006-11-22  Marek Safar  <marek.safar@gmail.com>
6401
6402         A fix for bug #79987
6403         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6404         check to a base class.
6405         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6406         only when assembly has missing attribute.
6407         * report.cs: Update.
6408
6409 2006-11-21  Marek Safar  <marek.safar@gmail.com>
6410
6411         * cs-tokenizer.cs: Merged with gmcs version.
6412
6413 2006-11-20  Marek Safar  <marek.safar@gmail.com>
6414
6415         * cs-tokenizer.cs,
6416         * cs-parser.jay: Better error message when partial keyword is misplaced.
6417
6418 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
6419
6420         A fix for bug #79810
6421         report.cs: CS1058 only applies to 2.0 profile (gmcs).
6422         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6423         a RuntimeWrappedException by default.
6424
6425 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6426
6427         A fix for bug #79843
6428         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6429         implementation.
6430         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6431
6432 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6433
6434         * driver.cs, namespace.cs: Uses faster IndexOf version.
6435
6436 2006-11-17  Marek Safar  <marek.safar@gmail.com>
6437
6438         A fix for bug #79941
6439         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6440         operators.
6441         (Operator.Define): Implicit/Explicit operator of same type is duplicate
6442         even if internal name is different.
6443         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6444         (UserDefinedConversion): Simplified as the operators cannot be internal.
6445         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6446         conversions.
6447         (MethodLookup): Replaced EmitContext with parentType.
6448         * expression.cs: Updated.
6449
6450 2006-11-09  Raja R Harinath  <rharinath@novell.com>
6451
6452         * driver.cs (BadAssembly): Handle all the ugliness of
6453         DefineDynamicAssembly.
6454
6455 2006-11-08  Raja R Harinath  <rharinath@novell.com>
6456
6457         Address parts of #58244 -- most of what's left is in the runtime
6458         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
6459         CS1509 error checks, and handle them for all assembly loads, not
6460         just the first invocation.
6461         (LoadModule): Likewise.  Move handling of 'adder_method' ...
6462         * codegen.cs (AssemblyClass.AddModule): ... here.
6463
6464 2006-11-02  Marek Safar  <marek.safar@gmail.com>
6465
6466         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6467         IEnumerable<T> is ambiguous.
6468
6469 2006-10-31  Marek Safar  <marek.safar@gmail.com>
6470
6471         A fix for bug #67689
6472         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6473         GetEnumerator is ambiguous.
6474
6475         * report.cs: Add new warning.
6476
6477 2006-10-29  Marek Safar  <marek.safar@gmail.com>
6478
6479         A fix for bug #78602
6480         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6481         to protected member can be nested type.
6482
6483 2006-10-28  Marek Safar  <marek.safar@gmail.com>
6484
6485         A fix for bug #78965
6486         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6487         to protected member must derive from current type.
6488
6489 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6490
6491         assign.cs: Reuses error method.
6492
6493         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6494         instead of type for constants.
6495         (Expression.Error_ValueAssignment): Common error method.
6496
6497         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6498         for any assignment.
6499
6500 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6501
6502         A fix for bug #79081
6503         * expression.cs (MemberAccess.DoResolve): Check nested type
6504         accessibility.
6505
6506 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
6507
6508         * doc.cs : nested delegates were not handled. Fixed bug #79754.
6509
6510 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6511
6512         A fix for bug #76591
6513         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6514
6515 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6516
6517         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6518         type forwarder of the same type multiple times.
6519
6520 2006-10-26  Raja R Harinath  <rharinath@novell.com>
6521
6522         Fix #78820
6523         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6524         instance as an rvalue, even when we later resolve as an lvalue.
6525
6526 2006-10-25  Martin Baulig  <martin@ximian.com>
6527
6528         * anonymous.cs: Fix #79673.
6529
6530 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
6531
6532         A fix for bug #79666
6533         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6534         ignored when is optimized (= default value) as its value is already set.
6535
6536 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6537
6538         A fix for bug #79724
6539         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6540         TypeContainer for type lookup.
6541
6542 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6543
6544         A fix for bug #79231
6545         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6546         * expression.cs (OverloadResolve): Always convert type name for
6547         an error message.
6548         (ResolveNamespaceOrType): Don't confuse a nested type with any 
6549         other member.
6550
6551 2006-10-18  Martin Baulig <martin@ximian.com>
6552
6553         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6554
6555 2006-10-17  Miguel de Icaza  <miguel@novell.com>
6556
6557         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6558         an int32, but requesting an int64 from the conversion
6559
6560 2006-10-12  Martin Baulig  <martin@ximian.com>
6561
6562         * anonymous.cs
6563         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
6564         
6565 2006-10-12  Martin Baulig  <martin@ximian.com>
6566
6567         * statement.cs
6568         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6569
6570 2006-10-11  Miguel de Icaza  <miguel@novell.com>
6571
6572         * convert.cs: Remove broken code: I was doing the "Existance"
6573         tests for Implicit conversions.
6574
6575 2006-10-10  Miguel de Icaza  <miguel@novell.com>
6576
6577         * convert.cs: Added one missing case in
6578         ImplicitStandardConversionExists uint64 to intptr.
6579
6580         Fixes #59800
6581         
6582         * typemanager.cs (uintptr_type): another core known type.   
6583
6584         * ecore.cs (OperatorCast): routine used to do cast operations that
6585         depend on op_Explicit.  We could change some of the Decimal
6586         conversions to use this.
6587
6588         This one has a probe mechanism that checks both types for an op_
6589         which it coudl be used to eliminate two classes: CastToDecimal
6590         and CastFromDecimal.
6591
6592         * convert.cs: Implement the conversions documented in #59800
6593         
6594 2006-10-10  Martin Baulig  <martin@ximian.com>
6595
6596         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6597         before RootScope.ResolveMembers().
6598
6599         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6600         `CurrentType' if appropriate.
6601
6602 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
6603
6604         A fix for bug #78568
6605         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6606         when contains binary operators.
6607         * cs-parser.jay: Updated.
6608
6609 2006-10-09  Martin Baulig  <martin@ximian.com>
6610
6611         * delegate.cs
6612         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6613         moved that into Define() and also do the other type parameter
6614         checks there.  Fixes #79094.  Added gtest-292.cs.
6615
6616         * expression.cs
6617         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6618         since that doesn't include type parameters; don't use `Ldelema'
6619         for type parameters.  Fixes #78980.  Added gtest-293.cs.
6620
6621 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
6622
6623         A fix for #77796
6624         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6625         conversion is allowed.
6626
6627 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6628
6629         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6630         error reporting when no error occurs.
6631
6632 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6633
6634         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6635         does not exist.
6636
6637 2006-10-06  Raja R Harinath  <rharinath@novell.com>
6638
6639         Fix #79584
6640         * class.cs (DefineTypeBuilder): Check circular dependencies before
6641         setting the parent of the TypeBuilder.
6642         (CheckRecursiveDefinition): Don't use 'BaseType', since
6643         it may not be valid until after DefineTypeBuilder.  Use
6644         'base_type' instead.
6645
6646 2006-10-04  Martin Baulig  <martin@ximian.com>
6647
6648         Merged the Anonymous Methods patch.
6649
6650         * anonymous.cs, iterators.cs: The new anonymous methods code.
6651
6652         * statement.cs (Variable): New public abstract class.
6653         (LocalInfo.Variable): New public property.
6654         (LocalInfo.ResolveVariable): New public method.
6655         (Block.Flags): Add `IsIterator'.
6656         (Block.AddVariable): Improved the CS0136 check.
6657         (Block.AnonymousChildren): New public property.
6658         (Block.AddAnonymousChild): New public method.
6659         (ToplevelBlock): Update to use the new anonymous method framework.
6660         (ToplevelBlock.ctor): `container' is now a `Block' and not a
6661         `ToplevelBlock'; this is required to correctly implement the
6662         CS0136 check.
6663         (Fixed, Using): Use `TemporaryVariable' instead of directly
6664         creating the `LocalBuilder'.
6665
6666         * parameter.cs (Parameter.ResolveVariable): New public method.
6667         (Parameters.ResolveVariable): Likewise.
6668
6669         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6670
6671         * class.cs (TypeContainer): Replaced the `iterators' list and
6672         corresponding methods with a list of `CompilerGeneratedClass'es.
6673         (TypeContainer.ResolveMembers): New public method.
6674         (Method): `IIteratorContainer' has been replaced by
6675         `IAnonymousHost'.
6676
6677         * expression.cs (VariableReference): New public abstract base
6678         class for `LocalVariableReference', `ParameterReference' and
6679         `This'.
6680
6681         * codegen.cs (EmitContext): Removed `capture_context',
6682         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
6683         (EmitContext.EmitThis): Removed.
6684
6685         * cs-parser.jay: Replace `iterator_container' with
6686         `anonymous_host'.       
6687
6688 2006-10-04  Martin Baulig  <martin@ximian.com>
6689
6690         * generic.cs (GenericMethod): Don't make this abstract.
6691         (Constraints.Clone): Added dummy implementation.
6692
6693 2006-10-04  Raja R Harinath  <harinath@gmail.com>
6694
6695         Fix #79577
6696         * namespace.cs (LookForAnyGenericType): Avoid nullref on
6697         'declspaces'.  Avoid allocating arrays willy-nilly.
6698
6699         Fix #79553
6700         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
6701         cases out of the switch.
6702
6703 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
6704
6705         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
6706         message when non-generic type is used with the type arguments.
6707         * expression.cs: Updated.
6708
6709 2006-09-28  Raja R Harinath  <rharinath@novell.com>
6710
6711         Fix #79013
6712         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
6713         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6714         Change semantics slightly.  Don't insist on having only one
6715         temporary EmptyExpression -- just throttle the creation of new ones.
6716
6717         Fix #79451
6718         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
6719         non-interfaces too.  If no methods are found, don't try to create
6720         a MethodGroupExpr.
6721
6722 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
6723
6724         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
6725         generic type.
6726
6727         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
6728         us produce better error message.
6729
6730 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
6731
6732         * expression.cs (Binary.ResolveOperator): Warn about a side effect
6733         of the `|' operator.
6734
6735         * report.cs: A new warning added.
6736
6737 2006-09-27  Martin Baulig  <martin@ximian.com>
6738
6739         * generic.cs (GenericMethod): Don't make this abstract.
6740
6741 2006-09-27  Martin Baulig  <martin@ximian.com>
6742
6743         * report.cs
6744         (InternalErrorException): Added overloaded ctor taking a params array.
6745
6746 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
6747
6748         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
6749         Fixed the cases when same error was reported twice.
6750
6751         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
6752         now report symbol information.
6753
6754 2006-09-25  Martin Baulig  <martin@ximian.com>
6755
6756         * class.cs: Completely unified with the gmcs version.
6757
6758 2006-09-25  Martin Baulig  <martin@ximian.com>
6759
6760         * typemanager.cs (TypeManager.IsNullableType): New public function.
6761         (TypeManager.IsNullableTypeOf): Likewise.
6762         (TypeManager.IsNullableValueType): Likewise.
6763
6764         * class.cs (MethodCore): Added the `GenericMethod' argument from
6765         gmcs and also unified all classes derived from `MethodCore' with gmcs.
6766
6767 2006-09-24  Raja R Harinath  <harinath@gmail.com>
6768
6769         * convert.cs: Unify with gmcs version.
6770
6771 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6772
6773         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
6774         verify them as well.
6775
6776         * report.cs: New warning.
6777
6778 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6779
6780         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
6781         for anonymous block with out argument.
6782
6783 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6784
6785         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
6786         not used private events only.
6787
6788 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
6789
6790         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
6791
6792         * const.cs (Const.Define): Check for constant type.
6793         (Const.IsConstantTypeValid): Looks for valid constant types.
6794
6795         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
6796
6797         * ecore.cs (EmptyConstantCast): New common class for all constant based
6798         EmptyCast(s).
6799
6800         * expression.cs (Is.DoResolve): Handle null constant especially.
6801         (New.DoResolve): Check for new void().
6802         (MemberAccess.DoResolve): Cope with all kind of nulls.
6803
6804         * literal.cs (NullConstant): Uses EmptyConstantCast.
6805         (NullDefault): Based on EmptyConstantCast.
6806         (NullLiteral): Uses EmptyConstantCast.
6807
6808         * statement.cs (Block.ResolveMeta): Check for constant type.
6809
6810 2006-09-22  Martin Baulig  <martin@ximian.com>
6811
6812         * delegate.cs, attribute.cs: Merged with the gmcs versions.
6813
6814 2006-09-22  Raja R Harinath  <rharinath@novell.com>
6815
6816         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
6817         not the null type.
6818
6819         Fix part of #79451
6820         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
6821         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
6822         code slightly.
6823
6824 2006-09-22  Martin Baulig  <martin@ximian.com>
6825
6826         * ecore.cs: Merged with the gmcs version.
6827
6828         * generic.cs (ConstructedType): New dummy class.
6829         (TypeArguments): Don't make this abstract.
6830
6831         * typemanager.cs
6832         (TypeManager.IsGenericTypeDefinition): New method.
6833         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
6834
6835 2006-09-22  Raja R Harinath  <rharinath@novell.com>
6836
6837         * expression.cs (ComposedCast): Check for arrays of TypedReference
6838         before creating the type, not after.
6839
6840 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
6841
6842         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
6843         after ToType change.
6844
6845         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
6846         when constant must be implicitly convertible.
6847
6848         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
6849
6850         * ecore.cs (NullCast): Derives from NullConstant.
6851
6852         * expression.cs (Is.DoResolve): Removed useless variables.
6853         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
6854         (New.Constantify): Add enum support.
6855         (MemberAccess.DoResolve): Add warning when accessing null constant or
6856         variable.
6857
6858         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
6859         property.
6860
6861         * literal.cs (NullConstant): New abstract class with common
6862         functionality for all null specializations.
6863         (NullDefault): Represents default(X) when result can be
6864         reduced to null.
6865         (NullLiteral): Updated.
6866
6867         * report.cs: Add new warning.
6868
6869 2006-09-21  Martin Baulig  <martin@ximian.com>
6870
6871         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
6872
6873 2006-09-21  Martin Baulig  <martin@ximian.com>
6874
6875         * generic.cs (GenericConstraints): New dummy class.
6876         (Constraints): Likewise.
6877         (TypeParameter): Likewise.
6878         (TypeParameterName): Likewise.
6879         (GenericMethod): Likewise.
6880
6881         * typemanager.cs (TypeManager.GetGenericArguments): New method.
6882
6883         * decl.cs: Merged with the gmcs version.
6884
6885 2006-09-21  Raja R Harinath  <rharinath@novell.com>
6886
6887         * generic.cs (TypeParameter): Implement IMemberContainer.
6888         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
6889
6890         * rootcontext.cs: Unify with gmcs version.
6891
6892         * report.cs: Unify with gmcs version.
6893         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
6894         from gmcs/generics.cs.
6895         * generics.cs (TypeParameter): New dummy class.
6896
6897         * support.cs: Unify with gmcs version.
6898
6899 2006-09-20  Raja R Harinath  <rharinath@novell.com>
6900
6901         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
6902         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
6903
6904         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
6905         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
6906         * mcs.exe.sources: Add generic.cs.
6907
6908         * codegen.cs: Unify with gmcs version.
6909
6910         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
6911         (EmitContext): Add GenericDeclContainer implementation.
6912         * decl.cs (MemberCore, DeclSpace): Likewise.
6913         * namespace.cs: Remove #ifdef GMCS_SOURCE.
6914
6915         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
6916         MCS TypeManager has a corresponding dummy method.
6917
6918 2006-09-19  Martin Baulig  <martin@ximian.com>
6919
6920         * expression.cs: Completely merged with the gmcs version.
6921
6922 2006-09-19  Martin Baulig  <martin@ximian.com>
6923
6924         * expression.cs (Invocation): Merged with the gmcs version.
6925         (ArrayAccess.GetStoreOpcode): Likewise.
6926
6927 2006-09-19  Martin Baulig  <martin@ximian.com>
6928
6929         * typemanager.cs
6930         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
6931         (TypeManager.IsGenericMethodDefinition): Likewise.
6932
6933 2006-09-19  Martin Baulig  <martin@ximian.com>
6934
6935         * typemanager.cs
6936         (TypeManager.IsEqual): Moved the gmcs implementation here.
6937         (TypeManager.DropGenericTypeArguments): Likewise.
6938         (TypeManager.DropGenericMethodArguments): Likewise.
6939         (TypeManager.GetTypeArguments): Moved here from gmcs.
6940         (TypeManager.HasGenericArguments): Likewise.
6941
6942 2006-09-19  Martin Baulig  <martin@ximian.com>
6943
6944         * expression.cs (Binary): Merged with the gmcs version.
6945
6946 2006-09-19  Martin Baulig  <martin@ximian.com>
6947
6948         * expression.cs (Probe, As, Is): Merged with the gmcs version.
6949
6950 2006-09-19  Martin Baulig  <martin@ximian.com>
6951
6952         * typemanager.cs: Merged with the gmcs version.
6953
6954 2006-09-16  Raja R Harinath  <rharinath@novell.com>
6955
6956         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
6957         * driver.cs: Likewise.
6958
6959 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
6960
6961         A fix for #79401
6962         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
6963         only if parent type is class.
6964         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
6965         update.
6966
6967 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
6968
6969         * cs-parser.jay,
6970         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
6971         keywords are used.
6972         * typemanager.cs(CSharpName): Converts NullType to null.
6973
6974 2006-09-15  Martin Baulig  <martin@ximian.com>
6975
6976         * typemanager.cs
6977         (TypeManager.GetMethodName): Added mcs implementation.
6978         (TypeManager.IsEqual): Likewise.
6979
6980         * ecore.cs
6981         (SimpleName.RemoveGenericArity): Added dummy implementation.
6982
6983         * pending.cs: Merged with the gmcs version.     
6984
6985 2006-09-15  Martin Baulig  <martin@ximian.com>
6986
6987         * statement.cs: Merge with the gmcs version.
6988
6989 2006-09-15  Martin Baulig  <martin@ximian.com>
6990
6991         * statement.cs (Switch): Merge with the gmcs implementation
6992         (without nullables), which is newer.
6993
6994 2006-09-15  Martin Baulig  <martin@ximian.com>
6995
6996         * statement.cs (Block.Variables): Make this public.
6997         (ToplevelBlock.Parameters): Make this a property.
6998         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
6999
7000 2006-09-15  Martin Baulig  <martin@ximian.com>
7001
7002         * namespace.cs: Merge with the gmcs version.
7003
7004 2006-09-15  Martin Baulig  <martin@ximian.com>
7005
7006         * decl.cs (MemberName): Minor code cleanups.
7007
7008 2006-09-15  Martin Baulig  <martin@ximian.com>
7009
7010         * parameter.cs: Merge with the gmcs version.
7011
7012 2006-09-15  Martin Baulig  <martin@ximian.com>
7013
7014         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7015         and an error in mcs.
7016
7017 2006-09-15  Martin Baulig  <martin@ximian.com>
7018
7019         * flowanalysis.cs: Merged from GMCS; added the generics code into
7020         a `GMCS_SOURCE' conditional so we can share this file.
7021
7022 2006-09-08  Martin Baulig  <martin@ximian.com>
7023
7024         * typemanager.cs (TypeManager.interlocked_type): New public field.
7025         (TypeManager.int_interlocked_compare-exchange): New public field.
7026         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7027         enumerator types here and call InitGenericCoreTypes().
7028         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7029         after calling InitEnumUnderlyingTypes().
7030
7031         * rootcontext.cs
7032         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7033         `classes_second_stage'. 
7034
7035 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7036
7037         * assign.cs, ecore.cs, expression.cs: Share error message text.
7038         * class.cs (FieldMember.Define): Check for varible of static type.
7039         * driver.cs (LoadAssembly): Uses error output for errors.
7040         * statement.cs: Updated.
7041
7042 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7043
7044         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7045         type instance.
7046
7047 2006-09-07  Martin Baulig  <martin@ximian.com>
7048
7049         * driver.cs
7050         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7051
7052 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7053
7054         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7055         
7056 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7057
7058         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7059         #52019 and #79064, the use of the \uXXXX sequence in source code
7060         to represent unicode characters.
7061
7062 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7063
7064         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7065         support.
7066         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7067
7068 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7069
7070         * assign.cs: Catch attempts to assign to a method groups in += and
7071         report as 1656
7072
7073 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7074
7075         A fix for #79056
7076         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7077
7078 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7079
7080         * class.cs (Method.Define): Issue a warning when generic method looks like
7081         an entry point.
7082         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7083         as well.
7084
7085 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7086  
7087         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7088         looking for ctor.
7089         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7090         search all base interfaces as a member can be ambiguous.
7091         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7092         Constructor member type filter. 
7093         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7094         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7095         reporting for returned memberinfos.
7096         * report.cs: Updated.
7097         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7098         version to work on all runtimes.
7099         (TypeManager.RealMemberLookup): Removed members filtering.
7100
7101 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7102
7103         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7104         (PropertyExpr.EmitAssign): Likewise.
7105         * expression.cs (Indirection.EmitAssign): Likewise.
7106         (LocalVariableReference.EmitAssign): Likewise.
7107         (ParameterReference.EmitAssign): Likewise.
7108         (Invocation.EmitArguments): Likewise.
7109         (ArrayAccess.EmitAssign): Likewise.
7110         (IndexerAccess.EmitAssign): Likewise.
7111         (This.EmitAssign): Likewise.
7112         (ConditionalLogicalOperator.Emit): Likewise.
7113
7114         Fix #79026
7115         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7116         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7117         leave it in after returning it.
7118         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7119
7120 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7121
7122         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7123         message.
7124
7125 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7126
7127         Fix cs0146-3.cs and cs0146-4.cs.
7128         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7129         enclosing types don't depend on the current type.
7130
7131 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7132
7133         Fix #77963
7134         * class.cs (TypeContainer.DoDefineMembers): Use
7135         FindBaseMemberWithSameName on Parent, since we're interested in
7136         whether we hide inherited members or not.
7137         (FindBaseMemberWithSameName): Make slightly more robust.
7138
7139         Fix the non-generic testcase from #77396
7140         * decl.cs (DeclSpace.DeclContainer): Remove override.
7141
7142         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7143         declspaces for doppelgangers too.
7144         (UsingEntry): Implement IResolveContext.
7145         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7146         'this' as the resolve context.
7147         (LocalAliasEntry): Likewise.
7148
7149         Implement parts of #77403
7150         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7151         toplevel declaration space.  Each namespace declaration introduces
7152         a "partial" root declaretion space.
7153         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7154         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7155         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7156         from 'current_namespace.SlaveDeclSpace'.
7157         (namespace_declaration): Likewise.
7158         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7159         check.  It can't happen now.
7160         * decl.cs (DeclSpace.LookupType): Likewise.
7161         * driver.cs (MainDriver): Sanity check.
7162
7163 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7164
7165         * decl.cs (DeclSpace.FindNestedType): Remove.
7166         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7167         LookupTypeContainer to get the container of the nested type.
7168         * class.cs (TypeContainer.FindNestedType): Make non-override.
7169
7170 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7171
7172         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7173         * class.cs (TypeContainer.PartialContainer): ... here.
7174         (TypeContainer.AddBasesForPart): New helper.
7175         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7176         instead.
7177         * cs-parser.jay (current_class): Convert to DeclSpace.
7178         (struct_declaration, interface_declaration, class_declaration):
7179         Use AddBasesForPart instead of .Bases directly.
7180         * const.cs, iterators.cs: Update to changes.
7181
7182 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7183
7184         * class.cs (TypeContainer.AddMemberType): Rename from
7185         AddToTypeContainer.
7186         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7187         (AddTypeContainer): New.  Combine AddClassOrStruct and
7188         AddInterface.
7189         (AddPartial): Update.  Add 'is_partial' argument.
7190         * roottypes.cs: Update to changes.
7191         * cs-parser.jay (push_current_class): New helper for handling
7192         current_container and current_class.
7193         (struct_declaration, interface_declaration, class_declaration):
7194         Use it.
7195
7196 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7197
7198         * roottypes.cs: Rename from tree.cs.
7199
7200         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7201         * tree.cs (Tree, ITreeDump): Remove types.
7202         * rootcontext.cs (tree, Tree): Remove fields.
7203         (root, ToplevelTypes): New.
7204         * *.cs: Update to rename.
7205
7206         * tree.cs (Tree.RecordDecl): Remove.
7207         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7208         namespace here.
7209         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7210
7211 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7212
7213         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7214         DoFlowAnalysis and OmitStructFlowAnalysis here.
7215         (ec.With): Rename from WithUnsafe and generalize.
7216         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7217         (ec.WithFlowAnalyis): New.
7218         * ecore.cs, expression.cs, statement.cs: Update.
7219
7220 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7221
7222         * statement.cs (Block.ResolveMeta): Simplify slightly.
7223
7224         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7225         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7226         check_state to flags.
7227         (CheckState, ConstantCheckState): Update.
7228         (InUnsafe): New read-only property.
7229         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7230         arbitrary flags.
7231         (WithUnsafe): New helper similar to WithCheckState.
7232         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7233         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7234
7235 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7236
7237         Make comparisons use the same IL irrespective of whether they're
7238         in a 'checked' or 'unchecked' context: one of the issues in #78899
7239         * codegen.cs (EmitContext.CheckState): Make read-only property.
7240         (EmitContext.ConstantCheckState): Likewise.
7241         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7242         helper that implement a save/restore stack for CheckState
7243         values.  This is the only way to change check-state.
7244         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7245         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7246         (CheckedExpr.EmitBranchable): New forwarding method.
7247         (UnCheckedExpr): Likewise.
7248         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7249         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7250         (Checked.Resolve, checked.DoEmit): Likewise.
7251
7252 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7253
7254         * anonymous.cs: Cache the resolved anonymous delegate, and return
7255         this so that the ResolveTopBlock is only triggered once, not
7256         twice.
7257
7258         Currently we trigger ResolvetopBlock twice due to a first pass of
7259         argument check compatibility, and a second pass that does the
7260         actual resolution.   
7261         
7262 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7263
7264         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7265         modifiers.
7266         * rootcontext.cs (Reset): Add helper_classes.
7267
7268 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7269
7270         A fix for #78860
7271         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7272         correctly.
7273
7274 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7275
7276         * statement.cs (Lock): Handle expressions of type
7277         TypeManager.null_type specially.  Fixes #78770
7278
7279 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7280
7281         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7282         to an event.
7283
7284 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7285
7286         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7287         for accessors as well.
7288         * ecore.cs (EventExpr): Add AccessorTable.
7289
7290 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7291
7292         A fix for #78738
7293         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7294         for CS0122 where appropriate.
7295         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7296         level attributes.
7297         (Filter): Assembly can be null in the case of top level attributes.
7298
7299 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7300
7301         A fix for #78690
7302
7303         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7304         is done at global level.
7305
7306 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7307
7308         A fix for #77002, Implemented TypeForwarder support.
7309
7310         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7311         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7312         * typemanager.cs (): Add type_forwarder_attr_type.
7313
7314 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7315
7316         * report.cs: Add CS0469 warning.
7317
7318 2006-06-21  Martin Baulig  <martin@ximian.com>
7319
7320         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7321         the `try'-block, so we also report CS0016 etc. there.
7322
7323 2006-06-21  Martin Baulig  <martin@ximian.com>
7324
7325         * delegate.cs
7326         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7327
7328 2006-06-21  Martin Baulig  <martin@ximian.com>
7329
7330         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7331         also report CS1686 for parameters.
7332
7333 2006-06-21  Martin Baulig  <martin@ximian.com>
7334
7335         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7336         instead of an error if the value is not implicitly convertible to
7337         the switch types; fixes #77964.
7338
7339 2006-06-21  Raja R Harinath  <rharinath@novell.com>
7340
7341         Fix #78673
7342         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7343         FieldBuilder is null.
7344
7345         Fix #78662
7346         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7347         'left' and 'right' before error-checking.
7348
7349 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
7350
7351         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7352         Fixed bug #78601.
7353         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7354         (FieldExpr.DoResolve): likewise.
7355         (PropertyExpr.InstanceResolve): likewise.
7356         (EventExpr.InstanceResolve): likewise. 
7357
7358 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
7359
7360         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7361         attribute applicable tests for attribute argument.
7362
7363 2006-06-02  Raja R Harinath  <rharinath@novell.com>
7364
7365         Fix #78079
7366         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7367         (Binary.OverloadResolve_PredefinedIntegral): New.
7368         (Binary.OverloadResolve_PredefinedFloating): New.
7369         (Binary.OverloadResolve_PredefinedString): New.
7370         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7371         Follow the standard more closely, and treat numeric promotions in
7372         terms of overload resolution.
7373         (Binary.CheckShiftArguments): Simplify.
7374
7375 2006-06-01  Raja R Harinath  <rharinath@novell.com>
7376
7377         * flowanalysis.cs (MyBitVector): Simplify representation.
7378         (MyBitVector.Clone): Avoid allocating BitArray.
7379         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7380         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7381         (*): Update.  Change all references to MyBitVector.And and
7382         MyBitVector.Or to &= and |=.
7383
7384 2006-05-29  Raja R Harinath  <rharinath@novell.com>
7385
7386         Fix cs0231-[34].cs.
7387         * cs-parser.jay (formal_parameter_list): Extend the pattern below
7388         to param arguments too.
7389
7390 2006-05-26  Miguel de Icaza  <miguel@novell.com>
7391
7392         * cs-parser.jay: Catch another parsing form for arglist being
7393         followed by other arguments.  Fixes #78313.
7394
7395 2006-05-24  Raja R Harinath  <rharinath@novell.com>
7396
7397         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7398         checking of out parameters to ...
7399         (FlowBranchingToplevel.Merge): ... here.
7400         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7401         set, propagate the origin upward, and only complain if there was
7402         no other error.
7403         (FlowBranchingException.AddContinueOrigin): Likewise.
7404         (FlowBranchingException.AddReturnOrigin): Likewise.
7405         (FlowBranchingException.AddGotoOrigin): Likewise.       
7406
7407 2006-05-23  Raja R Harinath  <rharinath@novell.com>
7408
7409         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7410         unreachable, skip it.
7411         (FlowBranchingException.Merge): Always propagate jumps, even if
7412         the finally block renders subsequent code unreachable.
7413
7414 2006-05-18  Raja R Harinath  <rharinath@novell.com>
7415
7416         Fix #77601
7417         * statement.cs (Goto.Resolve): Move responsibility for resolving
7418         'goto' to FlowBranching.AddGotoOrigin.
7419         (Goto.SetResolvedTarget): New.  Callback to set the
7420         LabeledStatement that's the target of the goto.
7421         (Goto.DoEmit): Use Leave instead of Br when crossing an
7422         unwind-protect boundary.
7423         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7424         LookupLabel and adjust to new semantics.
7425         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7426         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7427         Goto.SetResolvedTarget to update target.
7428         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7429         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7430         AddBreakOrigin & co.  Delay propagation until ...
7431         (FlowBranchingException.Merge): ... this.
7432
7433         * statement.cs (Block.Resolve): Always depend on flow-branching to
7434         determine unreachability.  Kill workaround that originally emitted
7435         only one statement after an "unreachable" label (see infloop in
7436         test-515.cs).
7437
7438         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7439         This is still "wrong", but anything better would probably need a
7440         multi-pass algorithm.
7441         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7442         usage vector.  Force current usage vector to be reachable, to
7443         optimistically signify backward jumps.
7444         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7445         detected.
7446         (FlowBranchingLabeled.Merge): New.  If no backward jump was
7447         detected, return the original salted-away usage vector instead,
7448         updated with appropriate changes.  Print unreachable warning if
7449         necessary.
7450         * statement.cs (Block.Resolve): Don't print unreachable warning on
7451         a labeled statement.
7452
7453 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
7454
7455         * driver.cs: Pass filename without path to AssemblyBuilder's 
7456         AddResourceFile. Fixes bug #78407.
7457
7458 2006-05-17  Raja R Harinath  <rharinath@novell.com>
7459
7460         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7461         * flowanalysis.cs (FlowBranchingLabeled): ... here.
7462         (FlowBranching.MergeChild): Overwrite
7463         reachability information from Labeled branchings too.
7464
7465 2006-05-16  Raja R Harinath  <rharinath@novell.com>
7466
7467         * statement.cs (Goto.Resolve): Merge jump origins here ...
7468         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7469
7470         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7471         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
7472         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
7473         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7474         here, ...
7475         * statement.cs (Goto.Resolve): ... not here.
7476         (Goto.Emit): Remove CS1632 check.
7477
7478 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
7479
7480         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7481         error message.
7482
7483 2006-05-11  Raja R Harinath  <rharinath@novell.com>
7484
7485         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7486         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7487         (FlowBranchingException.Label): Likewise.
7488
7489         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
7490         given value.
7491         (MyBitVector.Or): Use it to avoid losing information (Count).
7492         (FlowBranching.MergeOrigins): Likewise.
7493
7494         * flowanalysis.cs (UsageVector.IsDirty): Remove.
7495         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7496         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7497         (UsageVector.ToString): Simplify.
7498         (UsageVector.MergeSiblings): Move here from ...
7499         (FlowBranching.Merge): ... here.
7500         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7501         not a MyBitVector.
7502
7503 2006-05-10  Raja R Harinath  <rharinath@novell.com>
7504
7505         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7506         null bitvector is treated as all-true.
7507
7508         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7509         (MyBitVector): Rationalize invariants.  'vector != null' implies
7510         that we have our own copy of the bitvector.  Otherwise,
7511         'InheritsFrom == null' implies all inherited bits are true.
7512
7513 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
7514
7515         * statement.cs (LocalInfo): Add IsConstant.
7516         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7517         local variable for constants.
7518
7519 2006-05-09  Raja R Harinath  <rharinath@novell.com>
7520
7521         * flowanalysis.cs (MyBitVector.Empty): New.
7522         (MyBitVector): Don't allow InheritedFrom to be null.
7523         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7524         (UsageVector, FlowBranching): Update to changes.
7525
7526         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7527         recursion.  The 'Parent == null' condition isn't sufficient for
7528         anonymous methods.
7529         (FlowBranching.AddBreakOrigin): Likewise.
7530         (FlowBranching.AddContinueOrigin): Likewise.
7531         (FlowBranching.AddReturnOrigin): Likewise.
7532         (FlowBranching.StealFinallyClauses): Likewise.
7533         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7534         (FlowBranching.CheckOutParameters): Likewise.
7535         (FlowBranchingToplevel): Terminate all the above recursions here.
7536         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7537         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7538
7539         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
7540         toplevel block.
7541         (FlowBranchingToplevel): New.  Empty for now.
7542         (FlowBranching.MergeTopBlock): Update.
7543         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7544         branching for the anonymous delegate.
7545         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7546
7547         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7548         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7549         information at the start of the merge.  Reorganize.
7550
7551 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7552
7553         * class.cs (MethodData.Define): Method cannot implement interface accessor.
7554
7555 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7556
7557         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7558         to newly introduced ctor.
7559
7560         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7561         message to one place.
7562         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7563         global namespace.
7564
7565 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7566
7567         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7568
7569         * ecore.cs (Expression.ResolveAsConstant): Updated.
7570
7571         * statement.cs (ResolveMeta): Updated.
7572
7573 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7574
7575         * cs-parser.jay: __arglist cannot be used in initializer.
7576
7577 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7578
7579         A fix for #77879
7580         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7581         private types.
7582
7583 2006-05-05  Raja R Harinath  <rharinath@novell.com>
7584
7585         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7586         (LabeledStatement): Add 'name' parameter.
7587         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7588         (Block.AddLabel): Update to changes.
7589         * cs-parser.jay (labeled_statement): Likewise.
7590
7591         * flowanalysis.cs (BranchingType.Labeled): New.
7592         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7593         (FlowBranchingLabeled): New.  Does nothing for now, but will
7594         eventually handle 'goto' flows.
7595         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7596         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7597         that's terminated ...
7598         (Block.Resolve): ... here.
7599
7600         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7601         (UsageVector.MergeFinallyOrigins): Likewise.
7602         (FlowBranching.InTryOrCatch): Likewise.
7603         (FlowBranching.AddFinallyVector): Likewise.
7604         (FlowBranchingException): Update to changes.
7605
7606         Fix #78290
7607         * statement.cs (Return.Resolve): Move error checking to ...
7608         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7609         (FlowBranchingException): Handle return origins like break and
7610         continue origins.
7611         (FlowBranching.UsageVector.CheckOutParameters): Remove.
7612
7613 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7614
7615         A fix for #76122
7616         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7617         filter.
7618
7619 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7620
7621         A fix for #77543
7622         * class.cs (MethodData.Define): Do public accessor check only when method
7623         implements an interface.
7624
7625 2006-05-04  Raja R Harinath  <rharinath@novell.com>
7626
7627         Remove special handling of 'break'
7628         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7629         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
7630         (UsageVector.Break): Remove.
7631         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7632         reachability.
7633         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7634
7635         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7636         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
7637
7638 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7639
7640         A fix for #75726
7641         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7642         be the interface member.
7643
7644 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7645
7646         A fix for #60069
7647         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7648         for emitting small (int) values.
7649
7650 2006-05-03  Raja R Harinath  <rharinath@novell.com>
7651
7652         Fix #59427
7653         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7654         control-flow passes through the 'finally' after merging-in all the
7655         control-flows from 'try' and the 'catch' clauses.
7656
7657         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7658         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
7659         always true at the only non-recursive entry point.
7660         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7661         FlowBranchingBreakable.
7662         (FlowBranchingLoop): Remove.
7663         * statement.cs (Return.DoResolve): Update to changes.
7664
7665         Fix #76471, #76665
7666         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7667         (FlowBranching.CreateBranching): Handle it: create a
7668         FlowBranchingContinuable.
7669         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7670         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7671         except that it handles the 'continue' command.
7672         (FlowBranching.UsageVector.MergeOrigins): Rename from
7673         MergeBreakOrigins.
7674         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7675         except that it overrides AddContinueOrigin.
7676         (FlowBranchingException): Override AddContinueOrigin, similar to
7677         AddBreakOrigin.
7678         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7679         Create a new branching around the embedded statement.
7680         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
7681         control flow after the embedded statement.
7682         (Continue.Resolve): Move all error checking to AddContinueOrigin.
7683
7684         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
7685         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
7686         FlowBranchingBreakable.
7687         (FlowBranchingSwitch): Remove.
7688
7689         Fix test-503.cs
7690         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
7691         error reporting to ...
7692         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
7693         Rename from 'AddBreakVector'.  Add new location argument.  Return
7694         a bool indicating whether the 'break' crosses an unwind-protect.
7695         (FlowBranchingException.AddBreakOrigin): Add.
7696         (FlowBranchingException.Merge): Propagate 'break's to surrounding
7697         flowbranching after updating with the effects of the 'finally'
7698         clause.
7699         (FlowBranchingBreakable): New common base class for
7700         FlowBranchingLoop and FlowBranchingSwitch.
7701
7702         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
7703         embedded statement.
7704         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
7705
7706 2006-05-02  Raja R Harinath  <rharinath@novell.com>
7707
7708         * statement.cs (Do.Resolve): If the loop is infinite, set the
7709         barrier.
7710         (While.Resolve, For.Resolve): Set a barrier after the embedded
7711         statement.  There's no direct control flow that goes from the end
7712         of the embedded statement to the end of the loop.
7713         * flowanalysis.cs (FlowBranching.Infinite): Remove.
7714         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
7715         above ensure that the reachability is correctly computed.
7716
7717         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
7718         (UsageVector.MergeBreakOrigins): If the current path is
7719         unreachable, treat it as if all parameters/locals are initialized.
7720         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
7721         infinite loops before merging-in break origins.
7722
7723         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
7724         (Reachability.Reachable): Split part into ...
7725         (Reachability.Unreachable): ... this.  Simplify.
7726         (Reachability.IsUnreachable): Use 'Unreachable' instead.
7727
7728         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
7729         (Reachability.SetThrowsSometimes): Likewise.
7730         (FlowBranchingBlock.MergeTopBlock): Don't compare against
7731         TriState.Always, use corresponding property.
7732         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
7733         (Block.Resolve): Likewise.  Remove some redundant checks.
7734
7735 2006-05-02  Raja R Harinath  <harinath@gmail.com>
7736
7737         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
7738         (Reachability.Meet): Don't bother checking AlwaysThrows --
7739         barrier is always set.
7740         (FlowBranchingBlock.Merge): Likewise.
7741
7742 2006-05-01  Raja R Harinath  <harinath@gmail.com>
7743
7744         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
7745         checks for unreachable.
7746
7747 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
7748
7749         A fix for #77980
7750         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
7751
7752         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
7753         whether field is really assigned.
7754
7755 2006-04-30  Raja R Harinath  <harinath@gmail.com>
7756
7757         * flowanalysis.cs (Reachability): Make 4-argument constructor
7758         private.
7759         (Reachability.Meet): Rename from 'And'.  Remove static variant.
7760         (Reachability.Always): Rename from the highly misleading
7761         'Reachability.Never'.
7762         (FlowBranching.Merge): Update to changes.  Mark an impossible
7763         situation with a 'throw'.
7764         (*): Update to changes.
7765
7766 2006-04-29  Raja R Harinath  <harinath@gmail.com>
7767
7768         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
7769         Remove 'Undefined'.
7770         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
7771         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
7772         (*): Update to changes.
7773         * statement.cs: Update to changes.
7774
7775 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
7776
7777         A fix for #78049
7778         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
7779
7780 2006-04-28  Raja R Harinath  <harinath@gmail.com>
7781
7782         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
7783         dummy UsageVector.
7784
7785         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7786         argument to two arguments: an usage-vector and a bool.  Move call
7787         to FlowBranching.Merge () ...
7788         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
7789
7790         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
7791         handling of loop and switch reachability to ...
7792         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
7793
7794 2006-04-27  Raja R Harinath  <harinath@gmail.com>
7795
7796         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
7797         handling to FlowBranchingLoop.InLoop.
7798         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
7799
7800 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
7801
7802         A fix for #78115
7803         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
7804         anonymous method is allowed from AnonymousContainer here.
7805
7806         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
7807
7808 2006-04-24  Raja R Harinath  <rharinath@novell.com>
7809
7810         Fix #78156
7811         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
7812
7813 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
7814
7815         A fix for #49011.
7816         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
7817         (DoubleConstant.Reduce): Ditto.
7818
7819 2006-04-23  Raja R Harinath  <rharinath@novell.com>
7820
7821         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
7822         Remove 'lvalue_right_side' argument.  Move parts to ...
7823         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
7824         (LocalVariable.DoResolveLValue): ... these.
7825
7826 2006-04-21  Raja R Harinath  <rharinath@novell.com>
7827
7828         Fix cs1655.cs
7829         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
7830         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
7831         (LocalVariableReference.DoResolveBase): Use it to implement new
7832         CS1655 check.
7833         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
7834         (Argument.Resolve): Simplify.  Move CS1510 check ...
7835         * ecore.cs (Expression.ResolveLValue): ... here.
7836         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
7837         (PropertyExpr.DoResolveLValue): Likewise.
7838         (FieldExpr.Report_AssignToReadonly): Likewise.
7839         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
7840         LValueMemberAccess or LValueMemberOutAccess on instance depending
7841         on it.
7842         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
7843         DoResolve as appropriate.
7844
7845 2006-04-20  Raja R Harinath  <rharinath@novell.com>
7846
7847         Fix #75800
7848         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
7849         implicit conversions on 'out' and 'ref' arguments.
7850
7851         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
7852         improve clarity.  Remove dead code.
7853
7854         Fix #66031
7855         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
7856         (Catch.Resolve): Resolve VarBlock if it exists.
7857
7858 2006-04-19  Miguel de Icaza  <miguel@novell.com>
7859
7860         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
7861         twice, this was some residual code, the enumerator was emitted
7862         properly in the two branche of if later.
7863
7864 2006-04-19  Raja R Harinath  <rharinath@novell.com>
7865
7866         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
7867         cast is never an lvalue.
7868         (Cast.DoResolve, Cast.ResolveRest): Combine.
7869         (Argument.Emit): Simplify slightly.  Move 'Expr is
7870         IMemoryLocation' check ...
7871         (Argument.Resolve): ... here.
7872         (Argument.Error_LValueRequired): Remove.  Inline into only user.
7873
7874         Simplifications.  Fix cs0191-2.cs
7875         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
7876         CS1649 and CS1651 to ...
7877         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
7878         the actual selection of the error code and message to a lookup
7879         table.  Add a dummy return value to simplify callsites.
7880         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
7881         readonly fields of other instances of the same type.  Move CS0197
7882         warning from ...
7883         * expression.cs (Argument.Resolve): ... here.  Simplify code.
7884         Ensure that ec.InRefOutArgumentResolving is only set during LValue
7885         resolution of an out or ref argument.  The code simplification
7886         above uses this invariant.
7887
7888 2006-04-18  Raja R Harinath  <rharinath@novell.com>
7889
7890         Possibly fix #77752.  Fix cs1690-[4-7].cs.
7891         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
7892         CheckMarshallByRefAccess.  Drop parameter.
7893         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
7894         warning.
7895         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
7896         InstanceExpression.
7897         * report.cs (AllWarnings): Add CS1690.
7898         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
7899         for ref access too.
7900         (LocalVariableReference.DoResolveBase): Update.
7901
7902 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7903
7904         * class.cs (MethodOrOperator): Moved common parts from method class.
7905         detect obsolete attributes.
7906         (Method.Define): Simplified as it reuses code from base.
7907         (Constructor.ValidAttributeTargets): Fixed issue found during
7908         refactoring.
7909         (Destructor.ValidAttributeTargets): Fixed issue found during
7910         refactoring.
7911         (Operator): Finished refactoring set off by #78020. Operator class is now
7912         ordinary method class.
7913
7914         * anonymous.cs: Updated.
7915
7916         * decl.cs (DeclSpace): Add IsGeneric
7917
7918 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7919
7920         * class.cs (Constructor.Emit): Don't emit the attributes twice.
7921
7922 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7923
7924         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
7925         detect obsolete attributes.
7926         (Method.CreateEmitContext): Moved to MethodOrOperator.
7927
7928 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7929
7930         A fix for #78048.
7931         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
7932         customized exception to make crash detection easier.
7933         (MethodOrOperator): Started to work on new base class for methods and
7934         operators.
7935         (Method): Derives from MethodOrOperator.
7936         (Constructor.Emit): Emits its own attributes.
7937         (AbstractPropertyEventMethod.Emit): Ditto.
7938         (Operator): Derives from MethodOrOperator, will refactor fully in extra
7939         patch.
7940         (Operator.Emit): It's temporary more tricky than should be.
7941         
7942         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
7943
7944         * report.cs (InternalErrorException): Add ctor with inner exception.
7945
7946 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
7947
7948         A fix for #76744.
7949         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
7950         only not visible.
7951
7952 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
7953
7954         A fix for #77916.
7955         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
7956         array.
7957
7958 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
7959
7960         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
7961         attribute is present and Guid not.
7962         (Interface.ApplyAttributeBuilder): Ditto.
7963
7964         * attribute.cs: Add error message.
7965
7966 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
7967
7968         A fix for #78020.
7969
7970         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
7971         sources (it's composite) so hold them in extra array as they are used in
7972         Emit phase only. It worked in the previous versions by mistake.
7973         (Attribute.Emit): Emit attribute for more owners when exist.
7974
7975         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
7976         it has now different behaviour.
7977
7978 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
7979
7980         * constant.cs (Constant.IsDefaultInitializer): New method.
7981
7982         * class.cs: Updated.
7983
7984         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
7985         re-initialize default values. It saves KBs almost for every assembly.
7986         Thanks Zoltan for the idea.
7987         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
7988         (ArrayCreation.DoResolve): Resolve only once.
7989         (ArrayCreation.Emit): Emit static initializer only when it is faster.
7990         (ArrayCreation.GetAttributableValue): Cope with optimized values.
7991
7992 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
7993
7994         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
7995         From #77961.
7996
7997 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
7998
7999         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8000         in an embedded statement too.
8001
8002 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8003
8004         Fix #77958
8005         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8006
8007 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8008
8009         A fix for #77966.
8010
8011         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8012         was not specified.
8013
8014         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8015
8016 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8017
8018         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8019         phase.
8020
8021         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8022         LocalTemporary change.
8023
8024         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8025         TypeContainer.
8026         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8027         initializers optimization.
8028         (ClassOrStruct.TypeAttr): Moved from modifiers.
8029         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8030         (FieldBase.ResolveInitializer): Resolves initializer.
8031         (FieldBase.HasDefaultInitializer): New property.
8032
8033         * cs-parser.jay: Removed message.
8034
8035         * expression.cs (CompilerGeneratedThis): New specialization.
8036
8037         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8038
8039 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8040
8041         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8042
8043 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8044
8045         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8046         be now EnumConstants only.
8047
8048 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8049
8050         * attribute.cs, driver.cs: Reset more caches.
8051
8052 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8053
8054         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8055
8056 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8059         for easier reuse. Updated all overrides.
8060         (IntegralConstant): New base class for all integral constants.
8061         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8062         of the constant range, report custom error.
8063         (UIntConstant.Reduce): Fixed uint conversion.
8064
8065         * ecore.cs, literal.cs: Reduce updates.
8066
8067 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8068
8069         A fix for #75813.
8070
8071         * class.cs (Constructor.Define): Removed extra if for default ctors.
8072         A patch from Atsushi Enomoto.
8073
8074 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8075
8076         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8077         GetAttributableValue.
8078
8079         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8080         when required.
8081
8082         * convert.cs (ImplicitConversionRequired): Error message moved to
8083         DoubleLiteral.
8084
8085         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8086         automatic implicit conversion of an output value.
8087         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8088
8089         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8090         conversion.
8091         (TypeOf.GetAttributableValue): Add extra handling for object type.
8092
8093         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8094         special error message.
8095
8096 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8097
8098         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8099         InternalCall.
8100         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8101         compatible with MS runtime.
8102
8103 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8104
8105         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8106         attribute arguments here.
8107
8108         * class.cs (Indexer.Define): The check was moved to attribute class.
8109
8110 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8111
8112         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8113         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8114         easier.
8115
8116 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8117
8118         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8119         mcs to keep code differences small.
8120         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8121         * typemanager.cs (parameter_default_value_attribute_type): New.
8122         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8123         CS1908 check.
8124
8125 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8126
8127         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8128
8129 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8130
8131         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8132
8133         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8134         the blocks too.
8135
8136 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8137
8138         * doc-bootstrap.cs : fix build.
8139
8140 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8141
8142         * expression.cs (StringConcat.Append): Issue a warning when empty string
8143         is going to append.
8144
8145 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8146
8147         * assign.cs (CompoundAssign.ResolveSource): Removed.
8148
8149         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8150         clean up.
8151
8152         * class.cs (TypeContainer.FindMethods): Removed.
8153         (TypeContainer.CheckMemberUsage): Made static.
8154
8155         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8156
8157         * constant.cs (CheckRange): Removed unused type argument.
8158         (CheckUnsigned): Removed unused type argument.
8159
8160         * cs-parser.jay: Updated after MemberAccess clean up.
8161         Uses Length for empty string test.
8162
8163         * cs-tokenizer.cs: Uses Length for empty string test.
8164         (IsCastToken): Made static.
8165         (is_hex): Made static.
8166         (real_type_suffix): Made static.
8167
8168         * decl.cs (SetupCache): Made static.
8169         (OnGenerateDocComment): Removed unused ds argument.
8170
8171         * delegate.cs (VerifyDelegate): Removed unused argument.
8172
8173         * doc.cs: Uses Length for empty string test.
8174
8175         * driver.cs: Uses Length for empty string test.
8176
8177         * enum.cs (IsValidEnumType): Made static
8178
8179         * expression.cs (EnumLiftUp): Removed unused argument.
8180         (ResolveMethodGroup): Ditto.
8181         (BetterConversion): Ditto.
8182         (GetVarargsTypes): Ditto.
8183         (UpdateIndices): Ditto.
8184         (ValidateInitializers): Ditto.
8185         (MemberAccess.ctor): Ditto.
8186         (GetIndexersForType): Ditto.
8187
8188         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8189
8190         * iterators.cs: Updated after MemberAccess clean up.
8191
8192         * location.cs: Uses Length for empty string test.
8193
8194         * namespace.cs: Uses Length for empty string test.
8195
8196          * report.cs (CheckWarningCode): Made static.
8197
8198         * statement.cs (LabeledStatement): Removed unused argument.
8199
8200         * typemanager.cs (FilterNone): Removed.
8201
8202 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8203
8204         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8205         obsolete.
8206
8207         * class.cs: Updated.
8208
8209 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8210
8211         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8212
8213 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8214
8215         A fix for #77822.
8216
8217         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8218         reporting, it's more tricky than I thought.
8219
8220 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8221
8222         A fix for #77816.
8223
8224         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8225         host container.
8226         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8227         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8228         Add more error reporting; Fixed issue with params.
8229
8230         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8231
8232         * cs-parser.jay: AnonymousMethod requires host container.
8233
8234         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8235
8236 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8237
8238         * class.cs: Change 'TypeContainer ds' constructor argument to
8239         'DeclSpace parent'.  Some classes were missed below due to
8240         different naming convention.
8241
8242         * class.cs (MemberCore.Parent): Delete.  This makes the
8243         ParentContainer changes below enforceable by the compiler.
8244
8245         Treat pointers to enclosing declaration space as 'DeclSpace', not
8246         'TypeContainer'.
8247         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8248         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8249
8250         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8251         of TypeContainer.
8252         (Block.AddThisVariable): Likewise.
8253         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8254         (AbstractPropertyEventMethod.Emit): Likewise.
8255         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8256         (GetMethod.Define, SetMethod.Define): Likewise.
8257         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8258         (DelegateMethod.EmitMethod): Likewise.
8259
8260         Fix regression test-partial-13.cs.
8261         Rationalize use of PartialContainer.  Ensure that the partial
8262         class semantics can be tied to type-correctness, i.e., any
8263         violation will cause a compile error.
8264         * class.cs, const.cs: Access all fields that belong to class
8265         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8266         Resolve()-like functions still use 'Parent'.
8267
8268         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8269         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8270         (PropertyMethod.CheckModifiers): Remove unused argument.
8271         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8272         DeclSpace.
8273
8274 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8275
8276         Make semantics of PartialContainer simpler.
8277         * decl.cs (DeclSpace.IsPartial): Remove.
8278         * class.cs (TypeContainer.IsPartial): Likewise.
8279         (TypeContainer..ctor): Set PartialContainer to point to self.
8280         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8281         (TypeContainer.FindNestedType): Likewise.
8282         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8283
8284 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8285
8286         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8287
8288 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8289
8290         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8291         classes.
8292
8293 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8294
8295         * class.cs (Operator.Define): An error for base conversion was not
8296         reported correctly.
8297
8298 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8299
8300         * iterator.cs : yield break is allowed in try statement which has
8301           catch clauses. Fixed bug #77767.
8302
8303 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8304
8305         A fix for #77593, #77574.
8306
8307         * class.cs (MethodCore.CheckBase): Another if for operator.
8308
8309 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8310
8311         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8312         were not resolved
8313
8314         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8315         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8316         conversion test.
8317         
8318         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8319         not needed.
8320
8321         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8322         Updated after another emitcontext usage was clean up. It should help us to
8323         synchronize with gmcs easier.
8324
8325 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
8326
8327         A fix for #77353.
8328
8329         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8330         (Event.Define): ditto
8331         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8332
8333         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8334         Removed redundant code and set NewSlot for Invoke method too.
8335
8336         * parameter.cs (Parameters.ctor): Add custom, type ctor.
8337         (Parameters.MergeGenerated): New method. Use this method when you merge
8338         compiler generated argument with user arguments.
8339
8340 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
8341
8342         * attribute.cs (ResolveAsTypeTerminal): Removed.
8343
8344         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8345         specialization for predefined types; 30% speed up.
8346         Finally placed obsolete check to right place.
8347         (Expression.ResolveType): Removed.
8348
8349         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8350         Updated after ResolveType was removed.
8351
8352         * expression.cs (Cast.ctor): Check void cast.
8353         (Binary.ResolveAsTypeTerminal): Is never type.
8354         (Conditional.ResolveAsTypeTerminal): Is never type.
8355
8356         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8357
8358 2006-03-01  Raja R Harinath  <rharinath@novell.com>
8359
8360         Fix #77679.
8361         * expression.cs (ParameterReference.DoResolveBase): Change return
8362         type to bool.
8363         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8364         Update.
8365
8366         Fix #77628.
8367         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8368
8369         Fix #77642.
8370         * typemanager.cs (GetFullNameSignature): Don't nullref on
8371         protected accessors.
8372
8373 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
8374
8375         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8376         these two separated members to simplify the code.
8377         (Attribute.Resolve): Refactored to use new fields and methods.
8378         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8379         implemented obsolete attribute checking.
8380         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8381         implemented obsolete checking again. It look line never ending quest ;-)
8382         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8383
8384         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8385
8386         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8387
8388         *class.cs (Property.Define): Add RegisterProperty call.
8389
8390         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8391         argument groups (only 2).
8392
8393         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8394         encoding expression to arguments.
8395         (Expression.ExprClassToResolveFlags): Just turned to property.
8396
8397         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8398         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8399         optimized as well as implemented support for zero-length attributes.
8400
8401         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8402         Add caching of PropertyInfo's.
8403
8404 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8405
8406         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8407         error multiple times.
8408
8409 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8410
8411         New partial class implementation.
8412         A fix for #77027, #77029, #77403
8413
8414         * attribute.cs (Attributable): Made attributes protected.
8415
8416         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8417         the replacements of ClassPart and PartialContainer.
8418         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8419         (TypeContainer.AddInterface): Ditto.
8420         (TypeContainer.AddPartial): The main method for partial classes. It checks
8421         for errors and merges ModFlags and attributes. At the end class is added to
8422         partial_parts list.
8423         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8424         required here.
8425         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8426         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8427         from the rest of partial classes.
8428         (TypeContainer.GetClassBases): Simplified.
8429         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8430         DefineType.
8431         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8432         (TypeContainer.HasExplicitLayout): Uses Flags now.
8433         (PartialContainer): Removed.
8434         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8435         (StaticClass): Was merged with Class.
8436         (Class.GetClassBases): class and static class bases are verified here.
8437         (Class.TypeAttr): Added static attributes when class is static.
8438         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8439         (MemberBase): In some cases we need to call parent container for partial
8440         class. It should be eliminated but it's not easy now.
8441
8442         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8443
8444         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8445         partial classed to accumulate class comments.
8446         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8447
8448         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8449
8450         * driver.cs (MainDriver): Tree.GetDecl was removed.
8451
8452         * modifiers.cs (Modifiers): Add partial modifier.
8453
8454         * tree.cs (Tree.decl): Removed.
8455         (RootTypes): Started to use this class more often for root types
8456         specializations.
8457
8458 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8459
8460         A fix for #77615
8461
8462         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8463         external interface does not have an attribute.
8464
8465 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8466
8467         Another prerequisites for new partial classs implementation.
8468         
8469         * attribute.cs (Attribute.Equal): Implemented.
8470         (Attribute.Emit): Changed as attributes can be applied more than twice.
8471         (Attributes.Emit): Check for duplicate attributes here.
8472
8473         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8474         as a parameter, clean-up.
8475
8476 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8477
8478         A fix for #77485
8479
8480         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8481         contains obsolete attribute check which can in some cases look for base
8482         type of current class which is not initialized yet.
8483         (TypeContainer.BaseType): Replacement of ptype.
8484
8485         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8486
8487 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8488
8489         First of prerequisites for new partial classs implemention.
8490         
8491         * attribute.cs (Attributable): Extended by ResolveContext;
8492         Attributes finally have correct context for resolving in all cases.
8493         (AttachTo): Attribute owner is assigned here.
8494
8495         * codegen.cs (IResolveContext): Introduce new interface to hold
8496         all information needed in resolving phase.
8497         (EmitContext): Implements IResolveContext; more clean-up needed here.
8498         
8499         * decl.cs (MemberCore): Implemented IResolveContext.
8500
8501         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8502         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8503         parameter.cs, statement.cs, tree.cs, typemanager.cs:
8504         Refactored to use new IResolveContext instead of EmitContext; cleanup
8505
8506 2006-02-06  Miguel de Icaza  <miguel@novell.com>
8507
8508         * codegen.cs (EmitScopeInitFromBlock): check here the
8509         capture_context, there is no need to make two calls to the
8510         EmitContext. 
8511
8512         * anonymous.cs: Add some debugging messages that might help me
8513         track other instances of this problem in the future (the
8514         regression of test 467).
8515
8516         * cs-parser.jay: track the variable block, as we need to initalize
8517         any captured variables declared in this block for the "catch"
8518         portion of the "Try" statement.
8519
8520         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8521         scope initialization for captured variables. 
8522
8523         Also, move the emit for the variables after the block location has
8524         been marked.
8525
8526 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
8527
8528         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8529
8530 2006-02-02  Miguel de Icaza  <miguel@novell.com>
8531
8532         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8533         commit yesterday, the initialization for the roots is necessary.
8534         What is not necessary is the scope activation.
8535
8536 2006-02-02  Raja R Harinath  <rharinath@novell.com>
8537
8538         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8539         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8540         CS0206 checks.
8541         (Argument.Resolve): Remove CS0206 checks.
8542
8543 2006-02-01  Miguel de Icaza  <miguel@novell.com>
8544
8545         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8546         scopes for all the roots, the scopes will now be emitted when the
8547         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
8548
8549         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8550         code.  This reduces a lot of existing cruft.
8551         
8552         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8553         that the ScopeInfo is generated as we enter the scope, not at the
8554         time of use, which is what we used to do before.
8555
8556         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8557         every time a Block is about to be emitted if we have a
8558         CaptureContext. 
8559
8560 2006-02-01  Raja R Harinath  <rharinath@novell.com>
8561
8562         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8563         (Reset): Update.
8564         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8565
8566         * typemanager.cs (cons_param_array_attribute): Make private.
8567         (Reset): Set it to null.
8568         (InitCoreHelpers): Don't initialize it.
8569         (ConsParamArrayAttribute): New.  Initialize it as needed.
8570         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8571
8572 2006-01-31  Miguel de Icaza  <miguel@novell.com>
8573
8574         * expression.cs: There might be errors reported during the
8575         selection of applicable methods.  If there are errors, do not
8576         continue execution as it will lead the compiler to crash.
8577
8578 2006-01-30  Miguel de Icaza  <miguel@novell.com>
8579
8580         * expression.cs: Member access is not allowed on anonymous
8581         methods.  Fixes #77402.
8582
8583 2006-01-30  Raja R Harinath  <rharinath@novell.com>
8584
8585         Fix #77401
8586         * cs-parser.jay (VariableDeclaration): Don't set
8587         current_array_type to null.
8588         (field_declaration, event_declaration, declaration_statement):
8589         Set it to null here.
8590
8591 2006-01-28  Raja R Harinath  <harinath@gmail.com>
8592
8593         * typemanager.cs (GenericParameterPosition): New.
8594         * doc.cs: Use it.
8595
8596 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
8597
8598         * doc.cs : To process "include" elements, first we should create
8599           another list than XmlNodeList, because it could result in node
8600           removal, which could result in that the XmlNodeList gives up
8601           yielding next node.
8602
8603           (Also made code identical to gmcs again.)
8604
8605 2006-01-25  Miguel de Icaza  <miguel@novell.com>
8606
8607         * ecore.cs: Introduce an error report that we were not catching
8608         before, if not silent, we must report the error.  Gonzalo ran into
8609         it.
8610
8611 2006-01-23  Miguel de Icaza  <miguel@novell.com>
8612
8613         A fix for bug: #76957
8614         
8615         * iterators.cs (MoveNextMethod.CreateMethodHost): call
8616         ComputeMethodHost before creating the method, this is a new
8617         requirement. 
8618
8619         * anonymous.cs (AnonymousContainer): Now we track all the scopes
8620         that this method references (RegisterScope).  The actual scope
8621         where the method is hosted is computed with the ComputeMethodHost
8622         before we create the method.
8623
8624         Moved the Deepest routine here.
8625
8626         (AnonymousContainer.ComputeMethodHost): New routine used to
8627         compute the proper ScopeInfo that will host the anonymous method.
8628
8629         (ScopeInfo): Deal with multiple roots.  The problem was that we
8630         did not have a unique root where all ScopeInfos could be hanged
8631         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
8632         of roots.  
8633
8634         Remove AdjustMethodScope which is now computed at the end.  Remove
8635         LinkScope which did a partial link, instead link all ScopeInfos
8636         before code generation from the new "LinkScopes" routine. 
8637
8638         Simplify all the Add* routines as they no longer need to maintain
8639         the tree, they just need to record that they are using variables
8640         from a ScopeInfo.
8641
8642         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8643         routines to produce the forest of ScopeInfo trees.
8644
8645         * class.cs (TypeContainer.AppendMethod): This is just like
8646         AddMethod, but ensures that an interface implementation method
8647         (IEnumerable.XXX) is not inserted at the beginning of the queue of
8648         methods, but at the end.
8649
8650         We use this functionality to ensure that the generated MoveNext
8651         method in the iterator class is resolved/emitted before the
8652         enumerator methods created.   
8653
8654         This is required because the MoveNext method computes the right
8655         ScopeInfo for the method.  And the other methods will eventually
8656         need to resolve and fetch information computed from the anonymous
8657         method. 
8658
8659 2006-01-21  Raja R Harinath  <harinath@gmail.com>
8660             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
8661
8662         Fix rest of #76995.
8663         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8664         the 'aliases' hash.
8665         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8666         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8667
8668 2006-01-18  Raja R Harinath  <rharinath@novell.com>
8669
8670         Fix #76656, cs0231-2.cs.
8671         * cs-parser.jay (formal_parameter_list): Make error case catch
8672         more issues.
8673         (parenthesized_expression_0): Add CS1026 check.
8674         (invocation_expression): Remove unused { $$ = lexer.Location }.
8675
8676 2006-01-17  Raja R Harinath  <rharinath@novell.com>
8677
8678         Fix #76824.
8679         * cs-parser.jay (statement_expression): Don't list out the
8680         individual statement-expressions.  Convert syntax error into
8681         CS0201 check.
8682
8683 2006-01-16  Raja R Harinath  <rharinath@novell.com>
8684
8685         Fix #76874.
8686         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
8687         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
8688         CheckIntermediateModification.
8689         (FieldExpr.DoResolve): Add new two-argument version that
8690         allows us to resolve the InstanceExpression as an lvalue.
8691         The one-argument variant is now just a wrapper.
8692         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
8693         Resolve the lhs as an lvalue if the it has a value type.
8694         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
8695         from Assign.DoResolve.
8696         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
8697         resolved as an lvalue.
8698         (PropertyExpr.DoResolve): Update.
8699         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
8700         has a value type.  Move CS1612 check here from
8701         CheckIntermediateModification.
8702         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
8703         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
8704         'right_side' of a ResolveLValue on an 'out' argument.
8705         (EmptyExpression.LValueMemberAccess): New.  Used as the
8706         'right_side' of a propagated ResolveLValue on a value type.
8707         (LocalVariableReference.DoResolveBase): Recognize
8708         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
8709         Add CS1654 check.
8710         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
8711         EmptyExpression.Null.
8712
8713 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
8714
8715         * typemanager.cs : added IsGenericParameter(). In mcs it always
8716           return false.
8717         * doc.cs : for generic parameters, use GenericParameterPosition,
8718           not FullName.
8719
8720 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
8721
8722         * expression.cs: Fix Console.WriteLine ((this = x).foo);
8723
8724 2006-01-12  Miguel de Icaza  <miguel@novell.com>
8725
8726         This fixes the problem where we used ldfld instead of ldflda to
8727         load the "THIS" pointer on captured parameters, when THIS is a
8728         value type.  See bug #77205.
8729         
8730         * iterators.cs (CapturedThisReference.Emit): Pass false to
8731         EmitThis (we do not need the address).
8732
8733         * codegen.cs (EmitThis): it needs to know whether we need the
8734         address of `this' or not.  This is used by value types.  
8735
8736         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
8737         every other call passes false.
8738
8739 2006-01-12  Raja R Harinath  <rharinath@novell.com>
8740
8741         Fix #77221.
8742         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
8743         GetOverride.
8744         * expression.cs (Invocation.OverloadResolve): Update.
8745         (Invocation.DoResolve): Avoid double resolution of invocation.
8746
8747 2006-01-11  Raja R Harinath  <rharinath@novell.com>
8748
8749         Fix #77180.
8750         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
8751         unary negation of floating point types as 0-expr; negation cannot
8752         overflow in floating point types.
8753
8754         Fix #77204.
8755         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
8756         on operands of 'void' type.
8757
8758         Fix #77200.
8759         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
8760         and ExclusiveOr for boolean constants too.
8761
8762 2006-01-09  Raja R Harinath  <rharinath@novell.com>
8763
8764         Fix #75636.
8765         * expression.cs (Invocation.OverloadResolve): Replace reflected
8766         override methods with their base virtual methods, rather than
8767         skipping over them.
8768         * typemanager.cs (TypeManager.GetOverride): New.
8769
8770 2006-01-05  Jb Evain  <jbevain@gmail.com>
8771
8772         * class.cs (Property.Define, Indexer.Define): do not tag the
8773         properties as SpecialName | RTSpecialName.
8774
8775 2006-01-04  Miguel de Icaza  <miguel@novell.com>
8776
8777         * class.cs (MethodCore.IsDuplicateImplementation): This method was
8778         doing a low-level comparission of parameter types.  It was lacking
8779         a check for __argslist. 
8780
8781 2005-12-30  Miguel de Icaza  <miguel@novell.com>
8782
8783         * expression.cs (ParameterReference.DoResolveBase): Allow
8784         reference parameters if they are local to this block. 
8785
8786         This allows the ref and out parameters of a delegate to be used in
8787         an anonymous method, for example:
8788
8789         delegate void set (out int x);
8790
8791         set s = delegate (out int x){
8792                 x = 0;
8793         };
8794
8795         This is used by functionality introduced late in the C# language.
8796         
8797         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
8798         method that take ref and out parameters. 
8799
8800         Fixes #77119 which was a late change in the spec.
8801
8802 2005-12-23  Miguel de Icaza  <miguel@novell.com>
8803
8804         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
8805         parent if its the same scope.  Fixes #77060.
8806
8807 2005-12-21  Miguel de Icaza  <miguel@novell.com>
8808
8809         * driver.cs: Report the case of no source files and no -out:
8810         argument provided.
8811
8812 2005-12-20  Raja R Harinath  <rharinath@novell.com>
8813
8814         Fix #77035.
8815         * expression.cs (ComposedCast.GetSignatureForError): Define.
8816
8817 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8818
8819         Fix #76995
8820
8821         * namespace.cs (NamespaceEntry): Add extern_aliases as a
8822         ListDictionary, to contain the ExternAliasEntry entries (in
8823         addition to the NamespaceEntry.aliases hashtable). This field is
8824         shared between the original entry and its doppelganger (bodyless 
8825         copy of it).
8826         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
8827         extern_aliases field.
8828         (NamespaceEntry.Lookup): Move the IsImplicit check after the
8829         lookup in extern_aliases.
8830
8831 2005-12-16  Raja R Harinath  <rharinath@novell.com>
8832
8833         Fix #77006.
8834         * class.cs (TypeContainer.Mark_HasEquals): New.
8835         (TypeContainer.Mark_HasGetHashCode): New.
8836         (ClassPart): Override them.
8837         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
8838
8839         Fix #77008.
8840         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
8841         'parent' argument to the base constructor.
8842
8843         Remove all mention of TypeContainer from decl.cs.
8844         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
8845         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
8846         (DeclSpace.DeclSpace): Likewise.
8847         (DeclSpace.DefineMembers): Remove unused argument.
8848         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
8849         debugging check -- we don't care if the debug code throws an
8850         InvalidCastException instead of an InternalErrorException.
8851         * class.cs (TypeContainer.DefineMembers): Update to changes.
8852         (TypeContainer.DoDefineMembers): Likewise.
8853         (TypeContainer.GetMethods): Likewise.
8854         (PropertyMember.Define): Likewise.
8855         (MemberBase.Parent): New property that forwards to
8856         MemberCore.Parent, but ensures that we get a TypeContainer.
8857         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
8858         (RootContext.PopulateTypes): Likewise.  Remove special case code
8859         for !RootContext.StdLib: DefineMembers is idempotent.
8860
8861 2005-12-14  Miguel de Icaza  <miguel@novell.com>
8862
8863         * convert.cs (ExplicitConversionCore): Check the return value from
8864         ExplicitConversionCore which can return null on failure.  Fixes #76914
8865
8866 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
8867
8868         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
8869
8870 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
8871
8872         * doc.cs : The search for referenced namespace was insufficient to
8873           get global one as it used to do. Fixed bug #76965.
8874
8875 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
8876
8877         * doc.cs : check name in cref in the last phase that whether it is
8878           namespace or not.
8879
8880 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8881
8882         * cs-tokenizer.cs : reverted the latest change: it somehow broke
8883           Mono.C5.
8884
8885 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8886
8887         * doc.cs : so it turned out that we cannot skip override check for 
8888           interface members. Fixed bug #76954.
8889
8890 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8891
8892         * cs-tokenizer.cs : fixed bug #75984:
8893           - #warning and #error should not be handled when the source line
8894             is disabled.
8895           - #line is not checked strictly when the source line is disabled.
8896           - #define and #undef is on the other hand checked strictly at any
8897             state.
8898
8899 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
8900
8901         * cs-tokenizer.cs : missing Location (actually, filename) in one of
8902           CS1027 report.
8903
8904 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8905
8906         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
8907
8908         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
8909         event initializers.
8910         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
8911         (FieldBase.Initializer): Initializer is now optional.
8912         (EventField.Define): Only event field can have initializer.
8913
8914         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
8915
8916         * const.cs (Const): Reuse initializer.
8917
8918         * cs-parser.jay: Updated after FieldBase changes.
8919         Added current_array_type to simplify array initializers.
8920
8921         * ecore.cs (NullCast.IsDefaultValue): Implemented.
8922
8923         * expression.cs, iterators.cs: Updated.
8924
8925         * namespace.cs (NamespaceEntry): Made UsingFound private.
8926
8927 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8928
8929         * parameterCollection.cs: Obsolete, removed.
8930         * parser.cs: Obsolete, removed.
8931
8932 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8933
8934         Fix #76849.
8935         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
8936
8937         * enum.cs (Enum.Define): Set obsolete context here.
8938
8939 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
8940
8941         * doc.cs :
8942           - FindDocumentedMember() now expects 1) paramList as null
8943             when "we don't have to check the number of parameters" and
8944             2) Type.EmptyTypes when "there is no arguments".
8945           - Introduced FoundMember struct to hold the exact type which was
8946             used to find the documented member (the above change broke
8947             test-xml-044; it might be better just to use DeclaringType than
8948             what MS does, like this change does, but it depends on usage.)
8949
8950 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
8951
8952         * doc.cs : documented member might be from DeclaringType for nested
8953           types. Fixed bug #76782.
8954
8955 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
8956
8957         * anonymous.cs: Have the param code handle leaving copies on the
8958         stack etc. Allows anonymous params to take part in the assignment
8959         code (++, +=, etc). Fixes bug #76550
8960
8961         * expression.cs: Handle the prepare_for_load/leave_copy by passing
8962         it down to the anon code.
8963
8964         * iterators.cs: Use dummy var here
8965
8966         * codegen.cs: Handle new vars
8967
8968 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
8969
8970         Fix #76849.
8971         * class.cs (MethodData.Define): Set proper Obsolete context.
8972
8973         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
8974         obsolete context.
8975         (FieldExpr.DoResolve): Ditto.
8976
8977 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
8978
8979         Fix #76849.
8980         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
8981         parent is not obsolete.
8982
8983 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
8984
8985         * doc.cs : (FindDocumentedMember) find parameterless members first
8986           and get CS0419 in the early stage. Fixed first case of bug #76727.
8987
8988 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
8989
8990         Fix #76859.
8991         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
8992         no error was reported.
8993
8994         *expression.cs (Binary.DoResolve): left can be null.
8995
8996 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
8997
8998         Fix #76783.
8999         * class.cs (MethodData.Emit): Parameters should be labeled first.
9000
9001 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9002
9003         Fix #76761.
9004         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9005
9006 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9007
9008         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9009
9010         * class.cs (MethodCore): Parameter clean up.
9011         (IMethodData): Added ParameterInfo.
9012         (MethodData): Parameter clean up.
9013         (Indexer.Define): Parameter clean up.
9014
9015         * anonymous.cs,
9016         * codegen.cs,
9017         * cs-parser.jay,
9018         * decl.cs,
9019         * doc.cs,
9020         * ecore.cs,
9021         * flowanalysis.cs,
9022         * iterators.cs,
9023         * pending.cs,
9024         * statement.cs,
9025         * typemanager.cs: Parameter clean up.
9026
9027         * delegate.cs (Define): Get rid of duplicated code.
9028
9029         * expression.cs (ParameterReference): Removed useless parameters
9030         and simplified.
9031         (Invocation): Ditto.
9032
9033         * parameter.cs (ParamsParameter): New class, params specialization.
9034         (ArglistParameter): Attemp to separate arglist.
9035         (Parameter): Refactored to be reusable and faster.
9036         (Parameter.Modifier): Made understandable.
9037         (Parameters): Changed to be used as a class for `this' assembly
9038         parameters. Refactored to use new specialized classes.
9039
9040         * support.cs (ParameterData): Added Types property.
9041         (InternalParameters): Deleted.
9042
9043 2005-08-20  Martin Baulig  <martin@ximian.com>
9044
9045         Merging this patch from GMCS to fix #75867.
9046
9047         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9048         scope if we don't already have it.
9049
9050 2005-11-17  Martin Baulig  <martin@ximian.com>
9051
9052         * anonymous.cs
9053         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9054         inherit the scope from our parent.  Fixes #76653.
9055
9056 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9057
9058         * doc.cs : the previous patch does not actually fix the bug.
9059           PropertyInfo override check is now implemented and really fixed it.
9060         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9061
9062 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9063
9064         * doc.cs : apply "override filter" also to properties.
9065           Fixed bug #76730.
9066
9067 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9068
9069         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9070           no need to check overrides. For classes, omit those results from 
9071           interfaces since they must exist in the class. Fixed bug #76726.
9072
9073 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9074
9075         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9076           with different parameters. Fixed the second problem in #76685.
9077
9078 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9079
9080         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9081           get expected 'protected' access in CheckValidFamilyAccess()).
9082           Fixed bug #76692.
9083
9084 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9085
9086         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9087           Fixed bug #76705.  CS1569 was incorrectly commented out.
9088
9089 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9090
9091         * doc.cs : use Invocation.IsOverride() to do real override check.
9092         * expression.cs : made Invocation.IsOverride() internal.
9093
9094 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9095
9096         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9097           TypeBuilder.FindMembers() and filter overriden base members out.
9098           Fixed bug #76990.
9099
9100 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9101
9102         * doc.cs : ref/out parameters are represented as '@' (instead of
9103           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9104
9105 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9106
9107         * doc.cs : when there was no '.' in cref to methods in doc comment,
9108           then parameters were missing in the output. Fixed bug #76691.
9109
9110 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9111
9112         * driver.cs : don't output docs when there is an error.
9113           Fixed bug #76693.
9114
9115 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9116
9117         * doc.cs :
9118           Now it should detect indexers. Fixed primary concern in bug #76685.
9119           Fixed CS0419 message to not show the identical member signature in
9120           the message.
9121
9122 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9123
9124         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9125           instead of Type.FindMembers() since it does not handle events.
9126           Fixed bug #71604.
9127
9128 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9129
9130         * codegen.cs: Fixed typo (speficied -> specified).
9131
9132 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9133
9134         Fix #76369.
9135         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9136
9137 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9138
9139         * attribute.cs: Changed error message.
9140
9141         * cs-tokenizer.cs: One more check.
9142
9143 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9144
9145         * statement.cs (Block.Resolve): Ignore empty statement.
9146
9147 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9148
9149         * report.cs: Made error/warning methods more strict to avoid
9150         their misuse.
9151
9152         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9153         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9154         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9155         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9156
9157 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9158
9159         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9160         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9161
9162         * class.cs (TypeContainer.IsComImport): New property.
9163         (Constructor.Define): Create proper ctor for ComImport types.
9164
9165         * expression.cs (New.CheckComImport): Fixed.
9166
9167 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9168
9169         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9170         that a parameter has been captured does not mean that we do not
9171         have to do the rest of the processing.  This fixes the second part
9172         of #76592.  If there was another anonymous method capturing
9173         values in the past, the Scope would never be set for the second
9174         method that captured the same parameter.
9175
9176         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9177         properly manipulate the stack.   Second part of fix for #76592.
9178
9179         * expression.cs (New): Add support for invoking "new" on
9180         interfaces that have been flagged with the ComImport attribute and
9181         the CoClass.  Fixes #76637 
9182
9183         * statement.cs (Try.DoEmit): When a variable is captured, do not
9184         try to emit the vi.LocalBuilder variable as it has been captured.
9185         Create a temporary variable and store the results on the
9186         FieldBuilder.  Fixes #76642
9187
9188 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9189
9190         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9191
9192         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9193
9194         * expression.cs (Binary.DoResolve): Added && optimalization.
9195     
9196         * typemanager.cs (AddUserType): Removed useless argument.
9197
9198 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9199
9200         * statement.cs (Block.variables): Uses ListDictionary.
9201
9202 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9203
9204         Fix #75969.
9205         * class.cs (PartialContainer.EmitType): Customized to emit
9206         security attributes.
9207         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9208         for partial classes.
9209
9210 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9211
9212         Fix #76599.
9213         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9214         access has to be fixed.
9215         
9216         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9217
9218 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9219
9220         Fix #76590.
9221         * ecore.cs (NullCast.Reduce): Implemented.
9222
9223         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9224         constant type.
9225         
9226         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9227         properly.
9228         (Foreach.Resolve): Catch null properly.
9229
9230 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9231  
9232         * cs-tokenizer.cs: Warning text fix.
9233
9234         * driver.cs: AllWarningNumbers exposed on public interface.
9235
9236         * report.cs (): Reviewed warning numbers.
9237         (IsValidWarning): Use binary search.
9238
9239 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9240  
9241         * driver.cs: Implemeted resource visibility.
9242         (Resources): New class for code sharing between /res: and
9243         /linkres:
9244  
9245 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9246
9247         Fix #76568.
9248         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9249         folding.
9250         
9251         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9252         contants only.
9253         
9254         * ecore.cs (NullCast): Child is contant only.
9255         
9256         * literal.cs (NullLiteral.Reduce): null can be converted to any
9257         reference type.
9258
9259 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9260
9261         * driver.cs: Use Encoding.Default as default code page instead
9262           of ISO-28591.
9263
9264 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9265
9266         Fix #76085.
9267         * expression.cs (Invocation.Error_InvalidArguments): Handle
9268         __arglist parameters.
9269         (Invocation.VerifyArgumentsCompat): Likewise.
9270         * support.cs (ReflectionParameters.GetSignatureForError): Print
9271         __arglist parameters.
9272         (InternalParamters.GetSignatureForError): Likewise.
9273         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9274
9275 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9276
9277         * attribute.cs (GetPropertyValue): Made public.
9278
9279         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9280         Resolve.
9281         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9282         attribute.
9283         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9284         is not defined.
9285         
9286         * driver.cs: Reflect method name change.
9287         
9288         * statement.cs (Try.Resolve): Warn when try has both general
9289         exception handlers.
9290         
9291         * typemanager.cs: runtime_compatibility_attr_type new predefined
9292         type.
9293
9294 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9295
9296         Fix #76419.
9297         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9298         treat it as an empty parameter list.
9299
9300 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9301
9302         Fix #76271.     
9303         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9304         ResolveAsTypeStep silent.
9305         * statement.cs (Block.AddConstant): Mark block as used.
9306         (Block.ResolveMeta): Avoid piling on error messages
9307         if a constant initializer resolution fails.
9308
9309 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9310
9311         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9312         Remove.
9313         (NamespaceEntry.VerifyAllUsing): New.
9314         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9315         behaviour.  Delegates actual resolution of alias to ...
9316         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9317         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9318         Update.
9319         * driver.cs (Driver.MainDriver): Update.
9320         
9321         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9322         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9323         property.
9324         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9325         Remove.
9326         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9327         RootNamespace.DefineNamespacesForAll.
9328
9329 2005-10-24  Raja R Harinath  <harinath@gmail.com>
9330
9331         * typemanager.cs (assemblies, external_aliases, modules)
9332         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9333         (ComputeNamespaces, GetRootNamespace): Remove extra staging
9334         overhead.  Move resposibility ...
9335         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
9336         * driver.cs, attribute.cs, codegen.cs: Update to changes.
9337
9338 2005-10-23  Raja R Harinath  <harinath@gmail.com>
9339
9340         * namespace.cs (RootNamespace.all_namespaces): Renamed from
9341         cached_namespaces.  Improve usage.
9342         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9343         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9344         Move from GlobalRootNamespace and simplify.
9345         (RootNamespace.Global): Make instance variable.
9346         (RootNamespace.RootNamespace): Add "alias name" parameter.
9347         (GlobalRootNamespace): Simplify drastically.
9348         (Namespace.Lookup): Don't use GetNamespace.
9349         * typemanager.cs (GetRootNamespace): Rename from
9350         ComputeNamespaceForAlias.
9351         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9352
9353 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9354
9355         * anonymous.cs (AnonymousContainer): Don't crash when container
9356         doesn't exist.
9357
9358 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9359
9360         * expression.cs (Binary.DoResolve): Warn when comparing same
9361         values.
9362
9363 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9364
9365         Fix #76486.
9366         * expression.cs (Binary.DoResolve): It looks like there are no
9367         convetsion rules in enum context.
9368
9369 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9370
9371         Add support for extern alias qualifiers.
9372         * typemanager.cs: Move some LookupTypeReflection code
9373         to namespace.cs, to have cleaner code. Added some methods
9374         to help us keep track of the extern aliased references.
9375         * driver.cs: Add suport for extern alias assemblies on command
9376         line and check for their warnings/errors. Also keep track of the
9377         extern aliased assemblies.
9378         * namespace.cs: Move the global functionality of Namespace
9379         to GlobalRootNamespace/RootNamespace. Now the global namespace
9380         is GlobalRootNamespace.Globa. Also the code moved from 
9381         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
9382         Finally added LocalAliasEntry (AliasEntry before) and
9383         ExternAliasEntry, to handle alias statements.
9384         * cs-parser.jay: Add support in the grammar for extern alias
9385         statement.
9386         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
9387         Update callings to Namespace (now in GlobalRootNamespace).
9388
9389 2005-10-18  Raja R Harinath  <rharinath@novell.com>
9390
9391         Fix #76371.
9392         * class.cs (TypeContainer.DefineType): Move updating of
9393         topological sort earlier in the code.
9394         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9395
9396 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
9397
9398         Fix #76273.
9399         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9400         
9401         * constant.cs (Constant.TryReduce): Moved from Cast class.
9402         (Reduce): Made little bit more OO and fixed missing conversions.
9403         
9404         * ecore.cs (Reduce): Implemented.
9405         (Binary.EnumLiftUp): New method to upgrade values to enum values.
9406         
9407         * literal.cs (Reduce): Implemented.
9408         
9409         * class.cs: Reverted Miguel's wrong commit.
9410
9411 2005-10-14  Miguel de Icaza  <miguel@novell.com>
9412
9413         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9414
9415 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
9416
9417         * cs-parser.jay, expression.cs : CS0214 was missing error location
9418           for constants. Fixed bug #76404.
9419
9420 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
9421
9422         Fix #76370.
9423         * convert.cs (ExplicitConversionCore): Fixed object->enum
9424         conversion.
9425
9426 2005-10-10  Raja R Harinath  <rharinath@novell.com>
9427
9428         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9429         InstanceExpression.
9430         (PropertyExpr.EmitCall): Likewise.
9431         * expression.cs (Invocation.EmitArguments): Handle case where
9432         arguments == null.
9433         (Invocation.EmitCall): Avoid allocating temporary variable if
9434         there are no arguments.
9435
9436 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9437
9438         Fix #76323.
9439         * convert.cs (ImplicitConversionStandard): Move conversion of
9440         void* to arbitrary pointer types ...
9441         (ExplicitConversionStandard): .. here.
9442         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9443         error to always print typenames.
9444
9445 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9446
9447         * convert.cs (GetConversionOperator): Rename from
9448         GetConversionOperators.  Move operator selection code from ...
9449         (UserDefinedConversion): ... here.
9450
9451 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
9452
9453         * convert.cs (ExplicitConversionCore): Removed duplicate enum
9454         conversion.
9455
9456 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
9457
9458         * assign.cs (Assign.DoResolve): Error method changed.
9459
9460         * cfold.cs (DoConstantNumericPromotions): Error method changed.
9461         
9462         * const.cs (ResolveValue): Reset in_transit immediately.
9463         
9464         * constant.cs: Error method changed.
9465         
9466         * convert.cs: Removed useless location parameter.
9467         (ExplicitNumericConversion): Don't do double enum check.
9468         (ExplicitConversionCore): Renamed from ExplicitConversion.
9469         (ExplicitUnsafe): Extracted from ExplicitConversion.
9470         (ExplicitConversion): Uses for error reporting.
9471         
9472         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9473         error messages.
9474         (ResolveBoolean): Uses common error method.
9475         (CastToDecimal): Get rid of ec.
9476         (CastFromDecimal): Optimized.
9477         (ConvCast): Get rid of ec.
9478         
9479         * enum.cs (ResolveValue): Reset in_transit immediately.
9480         (Emit): Return after first error.
9481         
9482         * expression.cs: Convert changes.
9483         
9484         * literal.cs: Error method changed.
9485         
9486         * statement.cs: Error method changed.
9487
9488 2005-10-03  Raja R Harinath  <rharinath@novell.com>
9489
9490         * support.cs (SeekableStreamReader.Position): Don't error out when
9491         the requested position is just beyond the end of the current
9492         buffered data.
9493
9494 2005-09-28  Raja R Harinath  <rharinath@novell.com>
9495
9496         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
9497         try to keep in sync with the byte count of the underlying Stream.
9498         However, this limits us to a window size of 2048 characters: i.e.,
9499         the maximum lookahead of our lexer/parser can be 2048 characters.
9500
9501 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
9502
9503         Fix #76255.
9504         * driver.cs: Fix compilation files with full root path.
9505
9506 2005-09-25  Miguel de Icaza  <miguel@novell.com>
9507
9508         * report.cs (SymbolRelatedToPreviousError): Format the output so
9509         it does not use an open parenthesis that is never closed. 
9510
9511         * driver.cs: Follow coding guidelines
9512
9513 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9514
9515         Fix #72930.
9516         * const.cs (Const.ResolveValue): Check for assigning non-null
9517         value to reference type.
9518
9519 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9520
9521         * anonymous.cs: Implemented ExprClassName.
9522         
9523         * assign.cs (Assign.DoResolve): Don't chrash when type is not
9524         delegate.
9525         
9526         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9527         check.
9528         
9529         * class.cs (StaticClass.DefineContainerMembers): Report protected
9530         members as error.
9531         
9532         * codegen.cs: if(ed) PRODUCTION.
9533         
9534         * convert.cs (Error_CannotImplicitConversion): Better error
9535         distinction.
9536         
9537         * cs-parser.jay: More error checks.
9538         
9539         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9540         
9541         * driver.cs (CSCParseOption): Enabled wrong option check.
9542         
9543         * ecore.cs (Expression.ExprClassName): Turned to property.
9544         (MemberExpr.CheckIntermediateModification): For checking boxed
9545         value types     modification.
9546         
9547         * statement.cs (Fixed.Resolve): Expression type must be
9548         convertible to fixed type.
9549         (CollectionForeach.GetEnumeratorFilter,TryType):
9550         Small refactoring for easier error checking.
9551
9552 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
9553
9554         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9555         attributes.
9556         
9557         * class.cs (GeneratedBaseInitializer): New class for customization
9558         compiler generated initializers.
9559         (MemberBase.DoDefine): Check Obsolete attribute here.
9560         (FieldMember.DoDefine): Ditto.
9561         
9562         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9563         constants.
9564         
9565         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9566         (MemberCore.GetObsoleteAttribute): Removed argument.
9567         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9568         (MemberCore.CheckObsoleteType): New helper.
9569         
9570         * delegate.cs,
9571         * enum.cs,
9572         * statement.cs: Updates after MemberCore changes.
9573         
9574         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9575         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9576         
9577         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9578         obsolete attribute for compiler construct.
9579         (As.DoResolve): Cache result.
9580         
9581         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9582
9583 2005-09-26  Raja R Harinath  <rharinath@novell.com>
9584
9585         Fix #76133.
9586         * expression.cs (This.VerifyFixed): In a value type T, the type of
9587         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
9588         value type R, 'this' is treated as a value parameter.
9589
9590 2005-09-22  Miguel de Icaza  <miguel@novell.com>
9591
9592         * statement.cs (Lock): Use the TemporaryVariable class instead of
9593         manually using local variables as those do not work when variables
9594         are captured.
9595
9596         * ecore.cs: Moved the TemporaryVariable class from being a nested
9597         class inside Foreach to be a public class that can be employed in
9598         other places. 
9599
9600 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
9601
9602         * cs-parser.jay: interface_accessors replaced by
9603         accessor_declarations.
9604
9605         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9606         location.
9607         
9608         * statement.cs (GotoCase.Resolve): Convert null constant to
9609         null case.
9610         (SwitchLabel.ResolveAndReduce): Ditto.
9611         (SwitchLabel.NullStringCase): Custom null stamp.
9612         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9613         
9614         typemanager.cs (CSharpSignature): Don't skip first argument
9615         for full names.
9616
9617 2005-09-18  Miguel de Icaza  <miguel@novell.com>
9618
9619         * driver.cs: Set InEmacs based on the environment variable EMACS. 
9620
9621         * location.cs (InEmacs): in this mode, do not report column
9622         location as it confuses Emacs.
9623
9624 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
9625
9626         * cfold.cs, constant.cs, convert.cs, ecore.cs,
9627         expression.cs, iterators.cs, literal.cs: Store constants and
9628         literals location.
9629         
9630         * class.cs (MemberBase.ShortName): Pass location.
9631         
9632         * cs-parser.jay: Some location fixes.
9633         
9634         * ecore.cs (Expression.Location): Made virtual.
9635
9636 2005-09-05  Miguel de Icaza  <miguel@novell.com>
9637
9638         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9639         if the underlying types are the same, otherwise we need to produce
9640         code that will do the proper cast.
9641
9642         This was exposed by Marek's constant rewrite which produced
9643         invalid code for the call site:
9644
9645         enum X : long { a }
9646         void Method (X v) {}
9647
9648         Method ((X) 5)
9649
9650         This fixes test-49.cs
9651
9652 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9653
9654         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9655           Type/Object should be allowed as well. Fixed bug #75968.
9656
9657 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9658
9659         * expression.cs : (Binary.DoResolve): when one is enum constant and
9660           another is constant 0, then return enum one *as enum type*.
9661           Fixed bug 74846.
9662
9663 2005-09-02  Raja R Harinath  <rharinath@novell.com>
9664
9665         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9666         internal.
9667
9668         Fix #75941.
9669         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9670         flow-branching for LocalVariableReferences in case we were invoked
9671         from a MemberAccess.
9672         * expression.cs (LocalVariableReference.VerifyAssigned): New.
9673         Carved out of ...
9674         (LocalVariableReference.DoResolveBase): ... this.
9675         (MemberAccess.Resolve): Do the check that was disabled during
9676         SimpleNameResolve.
9677
9678 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9679
9680         * class.cs :
9681           (PartialContainer.Create): check abstract/sealed/static strictly
9682           but abstract/sealed can exist only at one side. Fixed bug #75883.
9683
9684 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
9685
9686         Fix #75945.
9687         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
9688         specified, don't default to UnmanagedType.I4.
9689
9690 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9691
9692         * expression.cs : conditional operator should check possibly
9693           incorrect assign expression. Fixed bug #75946.
9694
9695 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
9696
9697         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
9698           Reverting the change. gmcs is much complex than mcs on this matter.
9699
9700 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
9701
9702         * cs-tokenizer.cs : To read another token ahead of the actual 
9703           consumption, use new SavedToken and cache token instead of moving
9704           back the stream with SeekableStreamReader (it seemed problematic).
9705         * cs-parser.jay,
9706           driver.cs : Thus use StreamReader directly.
9707         * support.cs : Thus removed SeekableStreamReader.
9708
9709 2005-08-30  Raja R Harinath  <rharinath@novell.com>
9710
9711         Fix #75934.
9712         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
9713         (ScopeInfo.EmitScopeType): Use it to construct field names from
9714         names of captured locals.
9715
9716         Fix #75929.
9717         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
9718         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
9719         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
9720         (ExplicitConversion): Remove enum cases already handled by
9721         implicit conversion.  Move implicit conversion check to the beginning.
9722         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
9723         * expression.cs (ArrayCreation.EmitDynamicInitializers):
9724         Don't treat System.Enum as a struct.
9725
9726 2005-08-30  Jb Evain  <jbevain@gmail.com>
9727
9728         * attribute.cs: handles as expression in parameters.
9729
9730 2005-08-30  Raja R Harinath  <rharinath@novell.com>
9731
9732         Fix #75802.
9733         * class.cs (TypeContainer.VerifyClsName): Don't use a
9734         PartialContainer when verifying CLS compliance.
9735         (AbstractPropertyEventMethod): Set Parent here, ...
9736         (PropertyMethod): ... not here.
9737
9738 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
9739
9740         * attribute.cs : escaped attribute name should not be allowed to be
9741           resolved (e.g. @class as classAttribute). Fixed bug #75930.
9742
9743 2005-08-29  Raja R Harinath  <rharinath@novell.com>
9744
9745         Fix #75927.
9746         * convert.cs (ImplicitStandardConversionExists): Allow zero also
9747         when converting a long constant to unsigned long.
9748         * expression.cs (Invocation.OverloadResolve): Add sanity check to
9749         detect where IsApplicable and VerifyArgumentsCompat disagree.
9750
9751 2005-08-29  Raja R Harinath  <rharinath@novell.com>
9752         and Carlos Alberto Cortez  <carlos@unixmexico.org>
9753
9754         Fix #75848.
9755         * class.cs (TypeContainer.CanElideInitializer): New helper.
9756         (TypeContainer.EmitFieldInitializers): Use it to determine if we
9757         can safely emitting the initializer of a field.
9758
9759 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9760
9761         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
9762           allowed inside a switch (without loop). Fixed bug #75433.
9763
9764 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
9765
9766         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9767         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
9768
9769 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9770
9771         * driver.cs : kinda reverting the default encoding changes (not exact 
9772           revert since I noticed that "codepage:reset" might not work fine).
9773
9774 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9775
9776         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
9777           Location. Now getter and setter store location correctly.
9778           (errors/cs0111-12.cs now reports the expected location.)
9779
9780 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9781
9782         * driver.cs : Use default encoding on the environment.
9783           Removed (now that) extra parameter for SeekableStreamReader.
9784         * support.cs : (SeekableStreamReader) third .ctor() argument for
9785           StreamReader is not required (always true). preamble size could
9786           be acquired in simpler and safe way.
9787
9788 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
9789
9790         * cs-parser.jay: report CS0642 at warning level 3
9791           and report CS0642 for an if else statement also
9792           fixes bug #74745. Patch by John Luke (and a bit
9793           modified by me).
9794           Removed extra CS0642 warning check for "while",
9795           "for" and "fixed".
9796         * statement.cs: In Block.Resolve(), CS0642 check
9797           is reimplemented to check a sequence of an empty
9798           statement and a block.
9799
9800           Both fix bug #66777.
9801
9802 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
9803
9804         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
9805         detection until I fix it.
9806         
9807         * cs-tokenizer.cs: Changed error message.
9808         
9809         * cs-parser.jay: Fixed 2 error locations.
9810         
9811         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
9812         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
9813         properties.
9814         
9815         * enum.cs (GetSignatureForError): Fixed.
9816         
9817         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
9818         method detection.
9819         
9820         * class.cs,
9821         * typemanager.cs (RegisterProperty): Removed.
9822         
9823         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
9824
9825 2005-08-24  Raja R Harinath  <rharinath@novell.com>
9826
9827         Fix #75874.
9828         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
9829         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
9830
9831 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9832
9833         * expression.cs : tiny fix is required for not warning positive ulong.
9834           See test-441.cs.
9835
9836 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9837
9838         * expression.cs : add CS0652 check for constant and integral
9839           expression. Fixed bug #53974.
9840
9841 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9842
9843         * expression.cs : in DoNumericPromotions(), check if there is implicit
9844           conversion overload for string (to check CS0034). Fixed bug #52492.
9845
9846 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9847
9848         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
9849
9850 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9851
9852         * ecore.cs : report location when it is *not* Null.
9853
9854 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9855
9856         * codegen.cs,
9857           ecore.cs,
9858           flowanalysis.cs,
9859           expression.cs:
9860           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
9861           correctly. Fixed bug #75721.
9862
9863 2005-08-23  Raja R Harinath  <rharinath@novell.com>
9864
9865         * support.cs (SeekableStreamReader.Position): Avoid an expensive
9866         loop that performs 'min (pos, char_count)'.
9867
9868         Fix #75862.
9869         * expression.cs (Unary.ResolveOperator): Don't discard implicit
9870         converted value in Operator.OnesComplement.
9871
9872 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
9873
9874         * anonymous.cs: If the anon method is pulled into a helper class,
9875         it needs to be `internal' not `private'. Fixes runtime behavior on
9876         msft. bug #75704
9877
9878 2005-08-20  Martin Baulig  <martin@ximian.com>
9879
9880         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9881         scope if we don't already have it.
9882
9883         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
9884         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
9885         fixes #75867.
9886
9887 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
9888
9889         Fix #75803
9890         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
9891         is a partial class.
9892
9893 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
9894
9895         The big constants rewrite
9896         Fix #75746, #75685 and more
9897         As a side effect saved 1MB for MWF ;-)
9898         
9899         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
9900         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
9901         enum based for corlib compilation.
9902         
9903         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
9904         subtractions.
9905         
9906         * class.cs (FixedField.Define): Use ResolveAsConstant.
9907         
9908         * const.cs (IConstant): Interface constants and enums.
9909         (Const.ResolveValue): New method for constant resolvning.
9910         (ExternalConstant): Constants from imported assemblies.
9911         
9912         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
9913         conversion; like enums.
9914         (Constant.ToType): Converts this constant to different type.
9915         (Constant.Increment): Adds 1.
9916         
9917         * convert.cs (ImplicitConversionRequired): Simplified.
9918         
9919         * cs-parser.jay: Create EnumMember directly.
9920         
9921         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
9922         
9923         * doc.cs (GenerateEnumDocComment): Removed.
9924         
9925         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
9926         (ConvertIntLiteral): Removed.
9927         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
9928         
9929         * enum.cs (EnumMember): Implement IConstant.
9930         (Enum.IsValidEnumConstant): Removed.
9931         (Enum.GetNextDefaultValue): Removed.
9932         (Enum.FindMembers): Updated.
9933         (Enum.GenerateDocComment): Iterate enum members.
9934         
9935         * expression.cs (Cast.TryReduce): Handle enums correctly.
9936         (New.Constantify): Made public.
9937         (MemberAccess.DoResolve): Removed contant specific if(s).
9938         
9939         * literal.cs (NullLiteral): Implement new abstract methods.
9940         
9941         * statement.cs (GotoCase.Resolve): Use new constant methods.
9942         (SwitchLabel.ResolveAndReduce): Use new constant methods.
9943         
9944         * typemanager.cs (LookupEnum): Removed.
9945         (IsEnumType): Fixed to work with corlib.
9946         (RegisterConstant): Removed.
9947         (LookupConstant): Removed.
9948         (GetConstant): Changed to work with IConstant.
9949
9950 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
9951
9952         * location.cs : Fixed overflown (>255) column number.
9953
9954 2005-08-03  Raja R Harinath  <rharinath@novell.com>
9955
9956         First cut of the qualified-alias-member feature.
9957         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
9958         token.
9959         * cs-parser.jay (DOUBLE_COLON): New token.
9960         (namespace_or_type_name): Add rule for recognizing
9961         qualified-alias-members.
9962         (primary_expression): Likewise.
9963         (element_access): Allow QualifiedAliasMember as a possible
9964         type-bearing expression.
9965         (local_variable_type, local_variable_pointer_type): Likewise.
9966         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
9967         aliases in the current and enclosing namespace declarations.
9968         (NamespaceEntry.UsingAlias): Add CS0440 warning.
9969         * decl.cs (MemberName.is_double_colon): New.
9970         (MemberName.MemberName): Add new constructor for alias-member.
9971         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
9972         * expression.cs (QualifiedAliasMember): New expression type.
9973
9974 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9975
9976         * location.cs : it borked when no argument was specified.
9977
9978 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9979
9980         * location.cs : tiny ToString() format fix.
9981
9982 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9983
9984         * statement.cs : oops, it was missing.
9985
9986 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9987
9988         A set of fixes for precise line/column location.
9989
9990         * location.cs :
9991           "token" field now holds a file/line "delta", a line number offset 
9992           from the segment, and a column number. See also:
9993           http://lists.ximian.com/pipermail/mono-devel-list/2004-
9994           December/009508.html
9995           Removed static IsNull. Use instance IsNull property instead.
9996         * cs-tokenizer.cs :
9997           For some tokens it stores Location. For Identifier it stores
9998           LocatedToken which is a pair of string name and location.
9999           Column numbers are adjusted only at getChar().
10000         * report.cs :
10001           Use Location.ToString() for reporting (it now contains column).
10002         * cs-parser.jay :
10003           Largely modified to use LocatedToken instead of
10004           string (IDENTIFIER), and to acquire Location from some tokens.
10005         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10006           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10007           codegen.cs :
10008           Now MemberName holds Location. DeclSpace.ctor() receives Location
10009           as a parameter. Removed extra parameters to all derived classes.
10010           Replaced Location.IsNull() with instance property.
10011         * assign.cs, expression.cs :
10012           Added .ctor() overload that omits Location.
10013         * attribute.cs :
10014           Added "nameEscaped" flag that indicates the identifier was escaped
10015           in the source file. This fixes bug #57047.
10016
10017 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10018
10019         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10020         New method, looking for lo-case imported cls type.
10021
10022         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10023         here.
10024
10025         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10026
10027         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10028
10029         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10030         all_imported_types.
10031         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10032
10033         Optimized to save 3.5 MB for SWF compilation.
10034
10035 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10036
10037         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10038         (PartialContainer.Create): Moved logic AddToContainer.
10039         (PartialContainer.MarkForDuplicationCheck): Shares name.
10040         
10041         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10042         place.
10043         
10044         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10045         initialization.
10046         (Namespace.GetSignatureForError): New method.
10047         
10048         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10049         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10050
10051 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10052
10053         Fix #75669.
10054         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10055         member lookup rather than qualifier_type, since qualifier_type can
10056         be null.
10057
10058 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10059
10060         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10061         enum member.
10062
10063 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10064
10065         * statement.cs: Copy the local exception into the exception
10066         captured local.  Fixes 75674
10067
10068 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10069
10070         Fix #75658.
10071         * expression.cs (Invocation.OverloadResolve): Don't report error
10072         CS1501 if error CS1502 has been reported.
10073         (New.DoResolve): Delegate CS1501 reporting to
10074         Invocation.OverloadResolve.
10075
10076         Fix #75656.
10077         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10078         invariant-meaning-in-block property in an enclosing block if
10079         necessary.
10080
10081 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10082
10083         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10084         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10085         (Switch.CheckSwitch): Just save 50kb for SWF.
10086
10087 2005-07-27  Martin Baulig  <martin@ximian.com>
10088
10089         * anonymous.cs (CaptureContext.AddField): Added
10090         `AnonymousContainer am' argument; compute its toplevel scope if
10091         it's not already computed.  Fixes #75649.
10092
10093 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10094
10095         Fix #75628.
10096         * class.cs (Constructor.Emit): Reset block to null if the block
10097         resolve fails.
10098
10099 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10100
10101         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10102
10103 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10104
10105         * class.cs (MethodData.Define): Check whether accessor implementing
10106         interface is public.
10107
10108         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10109
10110 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10111
10112         Fix #57245
10113         * namespace.cs (LookupType): Moved same type check to...
10114         
10115         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10116         with the same name.
10117
10118 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10119
10120         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10121         already found a typebuilder.
10122         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10123         MemberNames, not strings.
10124
10125         * const.cs (Error_ExpressionMustBeConst): 
10126         Rename from Error_EpressionMustBeConst.
10127         * const.cs, class.cs, statement.cd: Update.
10128
10129 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10130
10131         Fix #65573
10132
10133         * const.cs (Const.LookupConstantValue): Report missing contant expression
10134         everytime.
10135         (Error_EpressionMustBeConstant): Only one error method.
10136
10137         * class.cs, statement.c: Updated.
10138
10139 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10140
10141         * statement.cs (Block.Flags): Add back HasVarargs.
10142         (Block.flags): Make protected.
10143         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10144
10145         * typemanager.cs (types, typecontainers, user_types): Remove.
10146         (UserTypes, TypeContainers): Likewise.
10147         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10148         (CleanUp, Reset): Update.
10149         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10150         (GetNestedType): Use Type.GetNestedType.
10151         (CoreLookupType): Take two arguments, the namespace and the
10152         basename of the type.  Update to use the Namespace.Lookup
10153         mechanism.
10154         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10155         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10156         string concatenation and substring matches.
10157         * class.cs, enum.cs, delegate.cs: Update to changes.
10158
10159 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10160
10161         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10162         Expression and made virtual.
10163
10164         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10165         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10166
10167         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10168
10169         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10170         error message.
10171
10172         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10173         change.
10174
10175 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10176
10177         Fix #57707
10178         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10179         AssemblyCultureAttribute is not used on executable.
10180
10181         * rootcontext.cs,
10182         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10183
10184 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10185
10186         Fix #60638.
10187         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10188         New.  Reports CS0252/CS0253.
10189         Mostly taken from preliminary patch by Duncak Mak.
10190         (Binary.DoResolveOperator): Store results of operator lookup.
10191         Use them to detect if we need to warn about unintended reference
10192         comparisons.
10193
10194 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10195
10196         Fix #72969.
10197         * namespace.cs (Namespace.Lookup): Add back location parameter.
10198         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10199         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10200
10201         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10202         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10203         (Namespace.LookupType): ... this.
10204         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10205         of namespaces.
10206         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10207         purported to handle pointers.
10208         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10209         CoreLookupType.
10210
10211 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10212
10213         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10214         type as namespace.
10215
10216 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10217
10218         * namespace.cs (Namespace.Lookup): Drop location parameter.
10219         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10220         (NamespaceEntry.Lookup): ... this.
10221         (NamespaceEntry.Error_AmbiguousTypeReference):
10222         Move here from DeclSpace.
10223         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10224         names ...
10225         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10226         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10227         Move to NamespaceEntry.
10228         * delegate.cs, expression.cs: Update to changes.
10229
10230 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10231
10232         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10233         CheckAttributeType and refactored.
10234         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10235         ResolveAsTypeTerminal error handling.
10236         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10237         handling.
10238         (GetSignatureForError): Print errors in same way.
10239
10240         * class.cs,
10241         * codegen.cs: Reflect attribute GetSignatureForError change.
10242
10243         * ecore.cs,
10244         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10245
10246         * namespace.cs (UsingEntry): Refactored to make fields private.
10247
10248         * assign.cs,
10249         statement.cs: Error_UnexpectedKind has extra parameter.
10250
10251 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10252
10253         * ecore.cs (IAlias): Remove.
10254         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10255         that implement the interface.
10256         * namespace.cs (Namespace): Likewise.
10257         (Namespace.declspaces): Renamed from 'defined_names'.
10258         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10259         DeclSpace instead of an IAlias.
10260         * tree.cs (Tree.AddDecl): Update.
10261
10262 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10263
10264         * statement.cs (Block.Flags); Remove HasVarargs.
10265         (Block.HasVarargs): Move to ToplevelBlock.
10266         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10267         (Block.Variables): Make protected.  Initialize variable hashtable
10268         if necessary.
10269         (Block.AddVariable): Update.
10270         (Block.Resolve): Update to changes.
10271         (ToplevelBlock.HasVarargs): New boolean.
10272         (ToplevelBlock.ThisVariable): Move here from Block.
10273         (ToplevelBlock.AddThisVariable): Likewise.
10274         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10275         * expression.cs (This.ResolveBase): Update to changes.
10276         (ArglistAccess.DoResolve): Likewise.
10277
10278 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10279
10280         Fix #75321
10281         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10282
10283         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10284         not used and not used & assigned.
10285         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10286
10287 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10288
10289         Fix #75053
10290         * expression.cs (Is.DoResolve): null is never provided type.
10291
10292 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10293
10294         Fix #52496
10295         * cs-parser.jay: Less strict event error rule to catch more errors.
10296
10297 2005-07-08  Martin Baulig  <martin@ximian.com>
10298
10299         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10300         gettter (allowed) or setter (not allowed).
10301
10302         * class.cs (Accessor): Implement IIteratorContainer.
10303         (Accessor.Yields): New public field.
10304         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10305         per-accessor basis.
10306
10307         * cs-parser.jay
10308         (get_accessor_declaration, set_accessor_declaration): Set the
10309         `yields' flag on the accessor, not the property.
10310         (property_declaration): Do the iterators check on a per-accessor
10311         basis and not for the whole property.
10312
10313 2005-07-08  Martin Baulig  <martin@ximian.com>
10314
10315         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10316         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10317
10318 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10319
10320         Fix #74975
10321         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10322         (ExtractSecurityPermissionSet): Cope with self referencing security
10323         attributes properly.
10324
10325         * driver.cs (SetOutputFile): Made public property OutputFile.
10326
10327 2005-07-07  Raja R Harinath  <rharinath@novell.com>
10328
10329         Fix #75486.
10330         * class.cs (TypeContainer.first_nonstatic_field): Rename from
10331         has_nonstatic_fields.  Make into a FieldBase pointer.
10332         (TypeContainer.AddField): Add CS0282 check.
10333         (TypeContainer.EmitType): Update.
10334
10335 2005-07-06  Miguel de Icaza  <miguel@novell.com>
10336
10337         * cs-tokenizer.cs (consume_identifier): Do not create strings to
10338         compare if they start with __.
10339
10340 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10341
10342         * statement.cs (Switch.SwitchGoverningType): Only look at
10343         UserCasts that don't need implicit standard conversions to one of
10344         the allowed switch types (Fixes test-322.cs).
10345         (LocalInfo.Resolve): Re-enable sanity-test.
10346
10347 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
10348
10349         * cs-tokenizer.cs (consume_identifier): Detect double undescores
10350         
10351         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10352         
10353         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10354
10355 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10356
10357         Fix #75472.
10358         * ecore.cs (SimpleName.GetSignatureForError): Add.
10359         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10360         (MemberAccess.GetSignatureForError): Add.
10361
10362 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
10363  
10364         The big error and warning messages review.
10365         
10366         * anonymous.cs,
10367         * assign.cs,
10368         * attribute.cs,
10369         * class.cs,
10370         * codegen.cs,
10371         * convert.cs,
10372         * cs-parser.jay,
10373         * cs-tokenizer.cs,
10374         * decl.cs,
10375         * delegate.cs,
10376         * doc.cs,
10377         * driver.cs,
10378         * ecore.cs,
10379         * enum.cs,
10380         * expression.cs,
10381         * flowanalysis.cs,
10382         * iterators.cs,
10383         * literal.cs,
10384         * location.cs,
10385         * modifiers.cs,
10386         * namespace.cs,
10387         * parameter.cs,
10388         * pending.cs,
10389         * report.cs,
10390         * rootcontext.cs,
10391         * statement.cs,
10392         * support.cs,
10393         * tree.cs,
10394         * typemanager.cs: Updated.
10395         
10396         * class.cs: (MethodCore.SetYields): Moved here to share.
10397         (PropertyMethod.Define): Moved iterator setup here.
10398         
10399         * iterators.cs: Add orig_method to have full access to parent
10400         container.
10401
10402 2005-07-05  Raja R Harinath  <rharinath@novell.com>
10403
10404         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10405         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10406         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10407         variable of struct type.
10408         * expression.cs (Unary.ResolveOperator): Update to change.
10409         (Indirection.VerifyFixed): Likewise.
10410         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10411         (ParameterReference.VerifyFixed): Value parameters are fixed.
10412         (This.VerifyFixed): Treat 'this' as a value parameter.
10413         * statement.cs (LocalInfo.IsFixed): Remove.
10414
10415 2005-07-01  Martin Baulig  <martin@ximian.com>
10416
10417         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10418         `ec.EmitThis ()' to get the correct scope.
10419
10420 2005-07-01  Martin Baulig  <martin@ximian.com>
10421
10422         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10423         instance is a ParameterReference; fixes #75299.
10424
10425 2005-07-01  Martin Baulig  <martin@ximian.com>
10426
10427         Reverted Marek's latest patch (r46725):
10428         - it contains structural changes which are neither mentioned in
10429           the ChangeLog nor explained anywhere; for example the additional
10430           argument of EmitContext's and Iterator's .ctor's and the
10431           TypeContainer.DefineMembers() change.
10432         - structural changes like this should go in in seperate patches
10433           and not be hidden in a huge patch which just seems to affect
10434           warnings and errors.
10435           a big and hard to understand patch.
10436         - it breaks iterators and causes regressions, for instance in
10437           test-iter-03.cs.      
10438
10439 2005-06-30  Raja R Harinath  <rharinath@novell.com>
10440
10441         Fix #75412.
10442         * expression.cs (Indexers.map): Remove.
10443         (Indexers.Append): Filter out inaccessible setters and getters.
10444         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10445
10446         Fix #75283.
10447         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
10448         Refactored from ...
10449         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10450         (FieldExpr.Emit, PropertyExpr.Emit): Update.
10451         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10452         * expression.cs (Invocation.EmitCall): Add CS0120 check.
10453
10454 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
10455
10456         Fix #75322
10457         * class.cs (FieldBase.GetInitializerExpression): One more field
10458         for backup.
10459
10460 2005-06-28  Miguel de Icaza  <miguel@novell.com>
10461
10462         * pending.cs: Do not define a proxy if the base method is virtual,
10463         it will be picked up by the runtime (bug 75270).
10464
10465 2005-06-08  Martin Baulig  <martin@ximian.com>
10466
10467         The big Iterators rewrite :-)
10468
10469         * iterators.cs: Rewrite this to use the anonymous methods framework.
10470
10471         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10472         before the TypeContainers; see 2test-21.cs.
10473
10474         * class.cs
10475         (TypeContainer.DefineType): Don't create a new EmitContext if we
10476         already have one (this only happens if we're an Iterator).
10477         (TypeContainer.Define): Also call Define() on all our iterators.
10478         (Method.CreateEmitContext): Added support for iterators.
10479
10480         * anonymous.cs
10481         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10482         (AnonymousContainer.CreateMethodHost): Moved here from
10483         AnonymousMethod and made abstract.
10484         (AnonymousContainer.CreateScopeType): New abstract method.
10485         (AnonymousContainer.IsIterator): New public property.
10486         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10487         get the ScopeTypeBuilder rather than manually defining it here. 
10488         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10489         iterators here.
10490
10491         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10492         before RootContext.DefineTypes().
10493
10494         * codegen.cs (EmitContext.RemapToProxy): Removed.
10495         (EmitContext.CurrentAnonymousMethod): Changed type from
10496         AnonymousMethod -> AnonymousContainer.
10497         (EmitContext.ResolveTopBlock): Protect from being called twice.
10498         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10499         (EmitContext.EmitThis): Removed the iterators hacks; use the
10500         anonymous methods framework for that.
10501
10502         * statement.cs
10503         (ToplevelBlock.Container): Make this a property, not a field.
10504         (ToplevelBlock.ReParent): New public method; move the
10505         ToplevelBlock into a new container.
10506         (Foreach.TemporaryVariable): Simplify.
10507
10508 2005-06-05  Martin Baulig  <martin@ximian.com>
10509
10510         * statement.cs (LocalInfo.CompilerGenerated): New flag.
10511         (Block.AddTemporaryVariable): New public method; creates a new
10512         `LocalInfo' for a temporary variable.
10513         (Block.EmitMeta): Create the LocalBuilders for all the temporary
10514         variables here.
10515         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10516         non-iterator variables.
10517
10518 2005-06-05  Martin Baulig  <martin@ximian.com>
10519
10520         * statement.cs (Foreach.TemporaryVariable): Create the
10521         LocalBuilder in the Emit phase and not in Resolve since in some
10522         situations, we don't have an ILGenerator during Resolve; see
10523         2test-19.cs for an example.
10524
10525 2005-06-04  Martin Baulig  <martin@ximian.com>
10526
10527         **** Merged r45395 from GCS ****
10528
10529         The big Foreach rewrite - Part II.
10530
10531         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10532         with `PropertyInfo ienumerator_getcurrent'.
10533
10534         * codegen.cs (VariableStorage): Removed.
10535
10536         * statement.cs
10537         (Foreach): Derive from Statement, not ExceptionStatement.
10538         (Foreach.CollectionForeach): New nested class.  Moved all the code
10539         dealing with collection foreach here.
10540         (Foreach.ForeachHelperMethods): Removed.
10541         (Foreach.TemporaryVariable): Implement IMemoryLocation.
10542
10543 2005-05-23  Martin Baulig  <martin@ximian.com>
10544
10545         * statement.cs (Try.DoResolve): Don't create a `finally' if we
10546         don't need to.  Fix #75014.
10547
10548 2005-05-20  Martin Baulig  <martin@ximian.com>
10549
10550         Merged r44808 from GMCS.
10551
10552         * class.cs (TypeContainer.CircularDepException): Removed.
10553         (TypeContainer.DefineType): Removed the `InTransit' stuff.
10554         (TypeContainer.CheckRecursiveDefinition): Check for circular class
10555         (CS0146) and interface (CS0529) dependencies here.
10556
10557 2005-06-21  Raja R Harinath  <rharinath@novell.com>
10558
10559         * expression.cs (Invocation.EmitCall): Fix initialization
10560         'this_call' to reflect current behaviour.  Fix indentation.
10561
10562         * convert.cs (FindMostEncompassedType): Add two trivial special
10563         cases (number_of_types == 0 || number_of_types == 1).
10564         (FindMostEncompasingType): Likewise.
10565
10566 2005-06-17  Raja R Harinath  <rharinath@novell.com>
10567
10568         Some cleanups preparing for the fix of #75283.
10569         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10570         error testing.
10571         (EventExpr.InstanceResolve): Likewise.
10572         (EventExpr.DoResolve): Remove redundant checks.
10573
10574 2005-06-10  Duncan Mak  <duncan@novell.com>
10575
10576         * cs-tokenizer.cs (process_directives): New flag for controlling
10577         the processing of preprocessor directives.
10578         (x_token): After seeing a '#', return Token.NONE instead of going
10579         to handle_preprocessing_directive() when not processing
10580         directives. This avoids unnecessary processing during the token peek in
10581         is_punct().
10582
10583         This fixes #74939.
10584
10585         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10586         the existing error reporting methods instead of Report.Error.
10587
10588         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10589         after Raja's rewrite.
10590
10591 2005-06-08  Miguel de Icaza  <miguel@novell.com>
10592
10593         * class.cs: Small fix.
10594
10595 2005-06-08  Raja R Harinath  <rharinath@novell.com>
10596
10597         Fix #75160.
10598         * class.cs (GetPartialBases): Fix return value check of
10599         part.GetClassBases.
10600
10601 2005-06-07  Raja R Harinath  <rharinath@novell.com>
10602
10603         Ensure that partial classes are registered in their enclosing
10604         namespace.  Initial part of fix of #75160.
10605         * tree.cs (Tree.RecordDecl): Add new namespace argument.
10606         Register declspace with namespace here, not in
10607         DeclSpace.RecordDecl.
10608         * cs-parser.jay: Pass namespace to RecordDecl.
10609         * class.cs (PartialContainer.Create): Likewise.
10610         (ClassPart.DefineType): New sanity-check.  Throws an exception if
10611         called.
10612         * decl.cs (Declspace.RecordDecl): Remove.
10613         * namespace.cs (NamespaceEntry.DefineName): Remove.
10614
10615 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
10616
10617         * rootcontext.cs: Reset TargetExt as well.
10618
10619 2005-06-03  Raja R Harinath  <rharinath@novell.com>
10620
10621         * ecore.cs (Expression.Resolve): Emit CS0654 error when
10622         -langversion:ISO-1.
10623
10624 2005-06-02  Raja R Harinath  <rharinath@novell.com>
10625
10626         Fix #75080, cs0119.cs.
10627         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
10628         of ...
10629         (Expression.Resolve): ... this.  Use it.  Remove bogus code
10630         allowing ExprClass.Type and ExprClass.Namespace for
10631         ResolveFlags.VariableOrValue.
10632         (Expression.Resolve) [1-argument variant]: Change default resolve
10633         flags based on language version.
10634         (Expression.Error_UnexpectedKind): Use a simple string array
10635         rather than an ArrayList.
10636         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10637         not ExprClass.Type.
10638         (TypeOfVoid.DoResolve): Likewise.
10639         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
10640         flags argument -- it always has the same value.
10641
10642 2005-05-31  Raja R Harinath  <rharinath@novell.com>
10643
10644         Fix #75081.
10645         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10646         Use it in the error message.
10647         * assign.cs, expression.cs, statement.cs: Update.
10648
10649 2005-05-30  Raja R Harinath  <rharinath@novell.com>
10650
10651         Fix #75088.
10652         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10653         the "almostMatchedMember" case too.
10654         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10655         that failed the accessibility checks to 'almost_match'.
10656
10657 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
10658
10659         * attribute.cs: Use internal MethodBuilder methods to set
10660         ExactSpelling and SetLastError on PInvoke methods, instead
10661         of passing them via charset.  Fixes #75060.
10662
10663 2005-05-27  Raja R Harinath  <rharinath@novell.com>
10664
10665         * parameter.cs (Parameter): Remove TODO comment.
10666         (Parameter.DefineParameter): Remove Location parameter.
10667         (Parameters.LabelParameters): Likewise.
10668         * class.cs (Constructor.Emit): Update to change.
10669         (MethodData.Emit): Likewise.
10670         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
10671         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10672
10673 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
10674
10675         * parameter.cs,
10676           Removed Parameters.Location and added Parameter.Location instead.
10677           Removed Location parameter from Emit() and GetSignature().
10678         * anonymous.cs,
10679           class.cs,
10680           cs-parser.jay,
10681           delegate.cs,
10682           iterators.cs,
10683           statement.cs :
10684           Modified all related calls.
10685
10686 2005-05-26  Raja R Harinath  <rharinath@novell.com>
10687
10688         Improve user-defined conversion handling.
10689         * convert.cs (GetConversionOperators): Rewrite.  Return only the
10690         applicable operators.
10691         (AddConversionOperators): New.  Helper for GetConversionOperators.
10692         (FindMostEncompassedType, FindMostEncompassingType): Verify that
10693         there is only one most encompassed/encompassing type.
10694         (FindMostSpecificSource, FindMostSpecificTarget): Remove
10695         "applicable operator" handling.
10696         (UserConversion): Move cache here from GetConversionOperators.
10697         Directly cache the chosen operator, rather than the whole
10698         MethodGroup.
10699         (ExplicitNumericConversion): Fix buggy implementation of Decimal
10700         case.  Allow conversion of decimal to sbyte and byte too.
10701         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
10702         New static methods.  Used to avoid allocating EmptyExpressions in
10703         convert.cs.
10704
10705 2005-05-24  Duncan Mak  <duncan@novell.com>
10706
10707         * ecore.cs (CastFromDecimal): New class for casting a decimal to
10708         another class, used in Convert.ExplicitNumericConversion.
10709         (CastToDecimal): New class, similar to above, but casts to
10710         System.Decimal, used in Convert.ImplicitNumericConversion and also
10711         in explicit convesion from double/float to decimal.
10712
10713         * convert.cs (ImplicitNumericConversion): Handle implicit
10714         conversions to System.Decimal.
10715         (ExplicitNumericConversion): handle explicit conversions to
10716         System.Decimal.
10717
10718         This fixes #68711.
10719         
10720 2005-05-20  Miguel de Icaza  <miguel@novell.com>
10721
10722         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
10723         know the type at this stage, just break through.   Fixes #75008 
10724
10725 2005-05-19  Martin Baulig  <martin@ximian.com>
10726
10727         * delegate.cs
10728         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
10729         to disable error reporting.
10730
10731         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
10732         here since we don't want to report an error; see the new test-336.cs.
10733
10734 2005-05-19  Raja R Harinath  <rharinath@novell.com>
10735
10736         * statement.cs (ToplevelBlock.GetParameterReference)
10737         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
10738         Move here from class Block.
10739         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
10740         * expression.cs (ParameterReference.DoResolveBase): Likewise.
10741
10742 2005-05-18  Martin Baulig  <martin@ximian.com>
10743
10744         Fix #74978.
10745
10746         * flowanalysis.cs
10747         (FlowBranching.Reachability): Add non-static public And() and Or()
10748         methods.
10749         (FlowBranchingSwitch): New class; do the `break_origins' thing
10750         like in FlowBranchingLoop.
10751         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
10752         reachability, not just locals and parameters.
10753         (FlowBranching.MergeChild): Remove some of the hacks for loop and
10754         switch; MergeBreakOrigins() now takes care of that.
10755
10756 2005-05-18  Martin Baulig  <martin@ximian.com>
10757
10758         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10759         a loop and may leave it, reset the barrier; fixes #74974.
10760
10761 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
10762         
10763         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
10764         is back.
10765         
10766         * cs-parser.jay: Catch more lexical errors.
10767         
10768         * report.cs: Add one more Error method.
10769         
10770         * rootcontext.cs,
10771         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
10772
10773 2005-05-17  Martin Baulig  <martin@ximian.com>
10774
10775         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
10776         #70970. 
10777
10778 2005-05-16  Raja R Harinath  <rharinath@novell.com>
10779
10780         Fix test-382.cs.  Emit values of decimal constants.
10781         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
10782         Carved out of ...
10783         (TypeContainer.AddField): ... this.
10784         (TypeContainer.EmitFieldInitializers): Allow the list of fields
10785         with initializers to include 'Const's.
10786         (ClassPart.RegisterFieldForInitialization): Forward to
10787         PartialContainer.
10788         * const.cs (Const.Const): Pass initializer to base class.
10789         (Const.Define): In case of decimal constants, register them for
10790         initialization in a static constructor.
10791
10792 2005-05-14  Martin Baulig  <martin@ximian.com>
10793
10794         * statement.cs (Block.Resolve): Correctly handle unreachable code;
10795         do not call ResolveUnreachable() on unreachable statements in
10796         here, see the comment in the source code.
10797
10798 2005-05-13  Raja R Harinath  <rharinath@novell.com>
10799
10800         Fix #74934.
10801         * expression.cs (BinaryResolveOperator): If one of the operands of
10802         an equality comparison is 'null' and the other is a pointer type,
10803         convert the null to a NullPointer.
10804         * convert.cs (ImplicitReferenceConversion): If the expression is a
10805         NullLiteral and the target type is a pointer type, return a
10806         NullPointer instead.
10807         (ImplicitConversionStandard): Likewise.
10808
10809 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
10810         
10811         * cs-parser.jay: Set readonly context based on special constructs.
10812         
10813         * expression.cs (LocalVariableReference.DoResolveBase): Improved
10814         readonly variable error handling.
10815         
10816         * rootcontext.cs (EmitCode): Don't verify members when error
10817         occurred.
10818         
10819         * statement.cs (LocalInfo): Add reaodnly context information.
10820         (SetReadOnlyContext, GetReadOnlyContext): New methods.
10821
10822 2005-05-13  Raja R Harinath  <rharinath@novell.com>
10823
10824         * statement.cs (Block.Resolve): Revert change below.  Modify fix
10825         for #74041 to initialize 'resolved' to false only for explicit
10826         blocks.  Fixes #74873.
10827
10828 2005-05-12  Raja R Harinath  <harinath@gmail.com>
10829
10830         Fix #74920.
10831         * typemanager.cs (unmanaged_enclosing_types): New.
10832         (IsUnmanagedType): Avoid infloops by using
10833         'unmanaged_enclosing_types' to talk with recursive invocations.
10834
10835 2005-05-13  Martin Baulig  <martin@ximian.com>
10836
10837         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
10838         instance variable, not a local.  Fix #74873.
10839         (Block.ResolveUnreachable): Set it to true here.
10840
10841 2005-05-11  Duncan Mak  <duncan@novell.com>
10842
10843         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
10844         continuing to process for 'arg'.
10845         (handle_preprocessing_directive): Check the argument of the #endif
10846         directive and report error CS1025 if there are any trailing
10847         characters.
10848
10849         According to the C# spec, having even whitespace after the #endif
10850         directive is illegal; however, because we call arg.TrimEnd ()
10851         beforehand, we have the same behavior as csc, allowing whitespace
10852         after the directive.
10853
10854         Fixes #74892.
10855
10856 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
10857
10858         Fix #74863.
10859         
10860         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
10861         (Constructor.GetObsoleteAttribute): Implemented correctly.
10862
10863 2005-05-10  Martin Baulig  <martin@ximian.com>
10864
10865         * support.cs (ReflectionParameters.ParameterModifier): Use
10866         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
10867         and `ParameterAttributes.In'.  Fixes #74884.
10868
10869 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
10870
10871         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
10872         
10873         * expression.cs (Argument.GetParameterModifier): Turned to property.
10874         (Invocation.Error_InvalidArguments): Add more descriptive errors.
10875         
10876         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
10877         its C# equivalent.
10878         
10879 2005-05-09  Raja R Harinath  <rharinath@novell.com>
10880
10881         Fix #74852.
10882         * decl.cs (MemberCache.AddMethods): Register override methods,
10883         rather than non-override methods.
10884         * typemanager.cs (RegisterOverride): New.
10885         (IsOverride): Update.
10886
10887 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
10888
10889         Fix #73105.
10890         
10891         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
10892         recursive declaration.
10893         
10894         * statement.cs (Block.ResolveMeta): Report any error in resolving.
10895         
10896 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
10897
10898         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
10899         
10900         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
10901
10902 2005-05-05  Raja R Harinath  <rharinath@novell.com>
10903
10904         Fix #74797.
10905         * decl.cs (DeclSpace.FamilyAccessible): 
10906         Use TypeManager.IsNestedFamilyAccessible.
10907
10908         Fix reopened #64812.
10909         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
10910         internal'.
10911
10912 2005-05-04  Raja R Harinath  <rharinath@novell.com>
10913             Abin Thomas  <projectmonokochi@rediffmail.com>
10914             Anoob V E  <projectmonokochi@rediffmail.com>
10915             Harilal P R  <projectmonokochi@rediffmail.com>
10916
10917         Fix #64812.
10918         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
10919         allow access to all static members.
10920
10921 2005-05-04  Martin Baulig  <martin@ximian.com>
10922
10923         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
10924
10925 2005-05-04  Martin Baulig  <martin@ximian.com>
10926
10927         Fix #74655.
10928
10929         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
10930         section at the end; make things work if `default' is not the last
10931         section.        
10932
10933 2005-05-04  Martin Baulig  <martin@ximian.com>
10934
10935         Fix #70400.
10936
10937         * statement.cs (Switch): Replaced the `got_default' field with a
10938         `default_section' one.
10939         (Switch.CheckSwitch): Set `default_section' here.
10940         (Switch.Resolve): If we're a constant switch and the constant is
10941         not found, use the default section.
10942
10943 2005-05-03  Martin Baulig  <martin@ximian.com>
10944
10945         * expression.cs (ArrayAccess.EmitGetLength): New public method.
10946
10947         * statement.cs (Foreach.ArrayForeach): New nested class.
10948         (Foreach.TemporaryVariable): New nested class.
10949         (Foreach.EmitArrayForeach): Removed; this is now in the new
10950         ArrayForeach class.
10951
10952 2005-05-03  Raja R Harinath  <rharinath@novell.com>
10953
10954         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
10955         more conservative.
10956         (VerifyPendingMethods): Revert change below.
10957
10958         * typemanager.cs (IsOverride, RegisterNonOverride): New.
10959         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
10960         that used to trigger warning -28.  Remove warning -28.
10961         * expression.cs (Invocation.OverloadResolve): Use
10962         TypeManager.IsOverride to distinguish override methods.
10963
10964         Fix #74773.
10965         * pending.cs (VerifyPendingMethods): If a base type implements the
10966         requested interface, don't bother checking individual methods of
10967         the base type.  As a side-effect, this prevents the creation of
10968         unnecessary proxies.
10969
10970 2005-05-02  Martin Baulig  <martin@ximian.com>
10971
10972         Fix #70182.
10973
10974         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10975         Also `And' the locals if the old vector is null.
10976         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
10977         null; in this case we basically reset all the variables.        
10978
10979 2005-05-02  Martin Baulig  <martin@ximian.com>
10980
10981         Fix #74529.
10982
10983         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
10984         Added `FlowBranching branching' argument; always `and' the
10985         variables instead of `or'ing them unless we're an infinite loop.
10986
10987         * statement.cs (While.Resolve): Create a new sibling unless we're
10988         infinite.       
10989
10990 2005-05-02  Martin Baulig  <martin@ximian.com>
10991
10992         Fix #70140.
10993
10994         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
10995         arguments; use it instead of creating a new TopLevelBlock.
10996         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
10997         our ConstructorInitializer.
10998
10999         * statement.cs
11000         (TopLevelBlock.TopLevelBranching): New public property.
11001         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11002         and create our `TopLevelBranching'.
11003
11004         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11005         anonymous method host, use `block.TopLevelBranching' rather than
11006         creating a new branching.
11007
11008 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11009
11010         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11011         a ScopeInfo, if any of the current children is a child of the new
11012         entry, move those children there.
11013
11014 2005-04-30  Martin Baulig  <martin@ximian.com>
11015
11016         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11017         at the beginning of a SwitchSection.  Fix #73335.
11018
11019 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11020
11021         Fix #74378
11022         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11023         
11024         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11025         (FieldExpr.DoResolve): Obsolete members are ignored for field
11026         initializers.
11027         
11028 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11029
11030         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11031         of arrays detection.
11032
11033         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11034         verification.
11035         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11036
11037         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11038         arrays report.
11039
11040 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11041
11042         * cs-parser.jay: Use the prefered version of -unsafe in error
11043         message.
11044
11045 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11046
11047         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11048         circumstances.
11049
11050 2005-04-20  John Luke  <john.luke@gmail.com>
11051
11052         * driver.cs: fix typo in error message, --outout to --output
11053
11054 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11055
11056         * codegen.cs (InRefOutArgumentResolving): New field.
11057         
11058         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11059         fields outside contructor.
11060         
11061         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11062         
11063 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11064
11065         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11066         parameter code was not completed ever, so it was not as up-to-date
11067         as local variables.  Must finish it.
11068
11069         The bug fix was to compare the Toplevel of the block, not the
11070         current block.  Thanks for Ben for pointing this out. 
11071
11072 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11073
11074         * decl.cs (AddMethods): Use the declaring type of the problem
11075         method to determine if we want to squash a warning.
11076
11077 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11078
11079         * attribute.cs: Removed debug output.
11080
11081         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11082         
11083         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11084         Report.Stderr.
11085         
11086 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11087
11088         Fix #74481.
11089         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11090         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11091         all null comparisons against reference types.
11092
11093 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11094
11095         Fix# 74565
11096         * class.cs (TypeContainer.CircularDepException) New nested
11097         exception class.
11098         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11099         (TypeContainer.DefineType): Removed error, reset InTransit before
11100         exit.
11101         (Class.DefineType): Throw exception when is in Transit.
11102         Catch exception and report error.
11103         (Struct.DefineType): Throw exception when is in Transit.
11104         Catch exception and report error.
11105         (Interface.DefineType): Throw exception when is in Transit.
11106         Catch exception and report error.
11107
11108         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11109         handle nested exception handlers.
11110
11111         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11112         a catch.
11113
11114         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11115         InFinally and InCatch storage.
11116
11117         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11118         (Catch.Resolve): Set and Restore ec.InCatch.
11119         (Try.Resolve): Set and Restore ec.InFinally.
11120         (Try.HasCatch): True when try has catch.
11121
11122 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11123
11124         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11125           for the same event member, so exclude such cases from warning 419.
11126           Fixed bug #74633.
11127
11128 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11129
11130         * expression.cs (Binary.ResolveOperator): Apply patch from John
11131         Luke to fix bug 59864: operators &, | and ^ on enumerations
11132         require that the same enum type on both sides.
11133
11134         * driver.cs: Add warnings to old flag usage, this is to assist
11135         people who produce Makefiles and hope that the Makefiles will be
11136         used on Windows.
11137
11138         * class.cs (TypeContainer.EmitType): Moved the definition of the
11139         special $PRIVATE$ field from the resolve phase to the Emit phase.
11140         During resolve we do not know if we are a struct with
11141         HasExplicitLayout, we know this only after the attributes for the
11142         type are emitted.
11143
11144         Set the FieldOffset to zero on the dummy field that we create for
11145         the class.   Fixes 74590.
11146
11147 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11148
11149         Fix #73834.
11150         * ecore.cs (PropertyExpr.resolved): New.
11151         (DoResolve): Use it to handle a case of double resolution here.
11152         Handle a case of identical-name-and-type-name.
11153         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11154         resolution by storing the results of expression resolution back
11155         into the "probes" array.
11156
11157 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11158
11159         Fix cs0208-7.cs and cs0208-8.cs.
11160         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11161         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11162         error reporting to point out the reason a struct is not unmanaged.
11163
11164 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11165
11166         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11167           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11168
11169 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11170
11171         Fix #74528.
11172         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11173         IdenticalNameAndTypeName here.
11174         (EventExpr.InstanceResolve): Likewise.
11175
11176 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11177
11178         C# 2.0 DefaultCharSetAttribute implementation
11179         
11180         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11181         which allows us to set GlobalNamespace for every resolve.
11182         (Attribute.ResolveArguments): Cut from Resolve.
11183         (Attribute.GetCharSetValue): Returns CharSet named argument.
11184         (Attribute.DefinePInvokeMethod): Gets default charset from
11185         module settings.
11186         (GlobalAttribute.ResolveAsTypeStep): Override.
11187         (GlobalAttribute.ResolveArguments): Override.
11188         
11189         * class.cs (TypeAttr): Is protected.
11190         
11191         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11192         (ModuleClass.DefaultCharSetType): New memeber.
11193         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11194         
11195         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11196         charset from module.
11197         
11198         * delegate.cs (TypeAttr): Override.
11199         (Delegate.DefineType): Use this TypeAttr.
11200         
11201         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11202         at very early stage (before types are defined) to resolve model
11203         module attributes. It will probably not work with corlib but it
11204         should be ok.
11205         
11206         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11207         charset from module.
11208         
11209         * typemanager.cs (default_charset_type): New type.
11210
11211 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11212
11213         * decl.cs (MemberCache.AddMethods): Don't warn if
11214         System.Object.Finalize has buggy MethodAttributes.
11215
11216         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11217         removed below.
11218
11219 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11220
11221         * doc.cs : detect ambiguous reference to overloaded members.
11222           Fixed bug #71603. MS 1.1 csc does not detect it.
11223
11224 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11225
11226         * doc.cs : delegates must not be referenced with parameters.
11227           Fixed bug #71605.
11228
11229 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11230
11231         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11232
11233 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11234
11235         * driver.cs (MainDriver): Stop processing if the CLS stage found
11236         errors. 
11237
11238         (CompilerCallableEntryPoint.InvokeCompiler): Always
11239         reset after execution;   Take a TextWriter argument for the
11240         output.
11241
11242         * report.cs: Use the error stream instead of hardcoding stderr. 
11243
11244 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11245
11246         * class.cs: Reduce code paths to test, too small of an
11247         optimization to make it worth the extra testing.  Always perform
11248         it. 
11249
11250 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11251
11252         Fix #74510.
11253         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11254         operators that had errors reported on them.
11255
11256 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11257
11258         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11259         argument types.
11260         (Attribute.Resolve): Add named argument type checking.
11261         
11262         * class.cs (FixedField.Define): Use IsPrimitiveType
11263         
11264         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11265         
11266         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11267         unsafe parameter types.
11268         
11269         * statement.cs (Using.ResolveExpression): Add better error description.
11270         
11271         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11272         
11273 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11274
11275         Fix #74484.
11276         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11277         AttributeUsageAttribute in the emitcontext of the attribute class,
11278         not in the emitcontext of the attributable entity it was attached to.
11279         * cs-parser.jay: Use 'current_class', not 'current_container',
11280         when creating a GlobalAttribute.
11281
11282 2005-04-08  Alp Toker  <alp@atoker.com>
11283
11284         * pending.cs: The fix to #58413 failed to compile methods implementing
11285         interfaces with/without params modifiers and vice versa, even though
11286         params modifiers aren't part of the signature. Make the modifier check
11287         less strict as in csc.
11288
11289 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11290             Anoob V E  <projectmonokochi@rediffmail.com>
11291             Harilal P R  <projectmonokochi@rediffmail.com>
11292
11293         Fix #58413.
11294         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11295         modifiers of pending methods.
11296         (PendingImplementation.PendingImplementation): Initialize it.
11297         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11298         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11299         with ParameterData.  Add check for modifiers.
11300         * class.cs (MethodData.Define): Update to changes.
11301
11302 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11303
11304         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11305
11306 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11307
11308         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11309         property.
11310         
11311         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11312         
11313         * rootcontext.cs,
11314         * typemanager.cs: Registered RequiredAttributeAttribute.
11315         
11316 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11317
11318         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11319         Warning CS0169 is back at level 3.
11320         (IMethodData.SetMemberIsUsed): New method.
11321         
11322         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11323         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11324         
11325         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11326
11327         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11328         contants.
11329         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11330         is used.
11331         
11332         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11333         is used.
11334         
11335         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11336         to avoid the problems with nested types.
11337
11338 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
11339             Anoob V.E  <projectmonokochi@rediffmail.com>
11340             Harilal P.R  <projectmonokochi@rediffmail.com>
11341             Raja R Harinath  <rharinath@novell.com>
11342
11343         Fix #73820.
11344         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11345         attribute.
11346         * typemanager (GetConstructor): Make public.
11347
11348 2005-04-05  John Luke  <john.luke@gmail.com>
11349             Raja R Harinath  <rharinath@novell.com>
11350
11351         Fix #62232.
11352         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11353         struct too.  Return false quicker in a few cases.
11354         (VerifyUnManaged): Use it.
11355
11356 2005-04-05  Raja R Harinath  <rharinath@novell.com>
11357
11358         Fix #74041.
11359         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11360         not 'unreachable_seen'.
11361
11362 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
11363
11364         * attribute.cs (Attribute.GetValue): Removed unused.
11365         
11366         * codegen.cs (CodeGen.TrimExt): Removed unused.
11367         
11368         * cs-parser.jay (output): Removed unused.
11369         
11370         * cs-tokenizer.cs (hex_digits): Removed unused.
11371         
11372         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11373         
11374         * expression.cs (Indirection.LoadExprValue): Removed unused.
11375         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11376         
11377         * iterators.cs (Iterator.param_types): Removed unused.
11378         
11379         * statement.cs (Goto.block): Removed unused.
11380         (ToplevelBlock.did): Removed unused.
11381         (Switch.ResolveConstantSwitch): Removed unused.
11382
11383 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
11384
11385         * rootcontext.cs: Allow mcs to bootstrap with the compilation
11386         resetting thingy.
11387
11388 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11389
11390         Fix #74232 and cs0208-3.cs.
11391         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11392         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11393         unmanaged type.  Don't use FieldBuilders when 't' is a
11394         TypeBuilder.  Use ModFlags and MemberType fields.
11395         * class.cs (MemberBase.member_type): Rename from MemberType.
11396         (MemberBase.MemberType): New property.  Determines member_type on
11397         demand.
11398         (MemberBase.DoDefine): Don't initialize MemberType here.
11399         (FieldMember.Define): Likewise.
11400
11401 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
11402
11403         Fix #74241
11404         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11405         Attributes are emitted there.
11406         
11407 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11408
11409         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11410         keyword in 'partial enum' too.
11411         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11412         is not allowed).
11413         Report from Kamil Skalski <nazgul@omega.pl>.
11414
11415         Fix #74309.
11416         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11417         have partial containers too.
11418
11419         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11420         in block' checks to Block.CheckInvariantMeaningInBlock.
11421         * statement.cs (Block.GetKnownVariableInfo): Make private.
11422         (Block.IsVariableUsedInChildBlock): Remove.
11423         (Block.IsVariableUsedInBlock): Likewise.
11424         (Block.CheckInvariantMeaningInBlock): New.  Show location of
11425         conflicting declaration.
11426         (Block.AddVariable): Make error messages less long-winded and more
11427         specific.  Show location of conflicting declaration.
11428         * parameter.cs (Parameters.Location): New readonly property.
11429
11430 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11431
11432         Clean up semantics of invoking ResolveMemberAccess.
11433         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11434         can have an instance, ensure that we pass in a non-TypeExpression
11435         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
11436         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11437         argument.  Update to changes and simplify.
11438         (FieldExpr.Emitinstance): Remove CS0120 check.
11439         (PropertyExpr.EmitInstance): Likewise.
11440         * expression.cs (Argument.Resolve): Likewise.
11441         (Invocation.DoResolve): Update to changes in semantics of
11442         InstanceExpression.
11443
11444 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
11445
11446         Fix #74241
11447         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11448         customization.
11449         
11450         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11451
11452 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11453
11454         Fix difference in behaviour with commandline invocation.
11455         * driver.cs (Driver.Reset): New.
11456         (CompilerCallableEntryPoint): Call it.
11457
11458         * statement.cs (If.Resolve): Avoid spurious "uninitialized
11459         variable" warnings if the boolean expression failed to resolve.
11460
11461 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
11462
11463         * attribute.cs: Fix the union of several permissions when some of them
11464         are unrestricted (so the result isn't an unrestricted permission set).
11465         Fix #74036.
11466
11467 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11468
11469         * ecore.cs (MemberExpr): New class.  Convert from interface
11470         IMemberExpr.
11471         (MemberExpr.ResolveMemberAccess): Refactor and move here from
11472         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
11473         error checks.
11474         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11475         (MethodGroupExpr.IsExplicitImpl): Remove.
11476         (Expression.GetFieldFromEvent): Remove.
11477         (SimpleName.MemberStaticCheck): Remove.
11478         (SimpleName.DoSimpleNameResolve): Update to changes.
11479         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11480         (MemberAccess.IdenticalNameAndTypeName): Remove.
11481         (MemberAccess.error176): Move to MemberExpr.
11482         (MemberAccess.DoResolve): Update to changes.
11483         (BaseAccess.DoResolve): Likewise.
11484
11485 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
11486
11487         C# 2.0 Conditional attribute class implementation
11488         
11489         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11490         Analyzes class whether it has attribute which has ConditionalAttribute
11491         and its condition is not defined.
11492         
11493         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11494         (Class.IsExcluded): New method. Search for at least one defined
11495         condition in ConditionalAttribute of attribute class.
11496
11497 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11498
11499         * ecore.cs (PropertyExpr): Derive from Expression, not
11500         ExpressionStatement.
11501         (PropertyExpr.EmitStatement): Remove.
11502
11503 2005-03-29  Raja R Harinath  <rharinath@novell.com>
11504
11505         Fix #74060.
11506         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11507         internal field "value__" of an enum be private.  The examples for
11508         "value__" that I found on MSDN all used FieldAttributes.Private.
11509
11510         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11511         Don't mention IL method attribute names.
11512
11513         Fix #47991.  Remove a TODO.
11514         * statement.cs (Block.Toplevel): Make into a field.
11515         (Block.Parameters): Move into ToplevelBlock.
11516         (Block.known_variables): Rename from child_variable_names.
11517         (Block.Block): Remove variants that take Parameters.  Initialize
11518         'Toplevel' with the immediately surrounding toplevel block.
11519         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
11520         LocalInfo parameter.
11521         (Block.GetKnownVariableInfo): New.
11522         (Block.IsVariableNameUsedInChildBlock): Update.
11523         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
11524         the block, even though it may not be in scope.
11525         (Block.AddVariable): Remove Parameters parameter.  Use
11526         Toplevel.Parameters instead.
11527         (Block.AddConstant): Remove Parameters parameter.
11528         (Block.GetParameterReference): Update to use Toplevel.Parameters.
11529         (Block.IsParamaterReference): Likewise.
11530         (Block.IsLocalParameter): Likewise.  Simplify a lot.
11531         (ToplevelBlock.Parameters): New.  Moved from Block.
11532         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
11533         initialize Parameters to a non-null value.
11534         * cs-parser.jay: Update to changes.
11535         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11536         simple names that mean different things in the same block.  Use
11537         Block.IsVariableNameUsedInBlock.
11538
11539 2005-03-28  Raja R Harinath  <rharinath@novell.com>
11540
11541         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11542         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11543         GetTypeHandle.  It is possible for a reflected type to derive from
11544         a TypeBuilder (e.g., int[] derives from the TypeBuilder
11545         System.Array during mscorlib compilation).
11546         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11547         contain a method_hash, don't create one either.  Don't create a
11548         deep copy of the base cache's method_hash.
11549         (MemberCache.SetupCache): Rename back from DeepCopy.
11550         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11551         already initialized.  If we see an override function, add its
11552         underlying base virtual function to the member_hash too.
11553
11554         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11555
11556 2005-03-26  Raja R Harinath  <harinath@acm.org>
11557
11558         Fix #73038.
11559         * assign.cs (Assign.DoResolve): When the RHS of an assignment
11560         fails to resolve, ensure that the LHS is still resolved as an
11561         lvalue.
11562
11563 2005-03-25  Raja R Harinath  <harinath@acm.org>
11564
11565         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11566         ec.ContainerType.
11567         (Enum.current_ec): Remove.
11568         (Enum.LookupEnumValue): Remove EmitContext argument.
11569         Just uses the one created during DefineType.
11570         (Enum.FindMembers): Update.
11571         * expression.cs (MemberAccess.DoResolve): Update.
11572
11573 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
11574
11575         * assign.cs (Assign.DoResolve): Check for CS1717 when
11576         source and target are same (uses Equals).
11577
11578         * expression.cs (LocalVariableReference, ParameterReference,
11579         This): Implemented Equals, GetHashCode.
11580
11581         * statement.cs (Block.GetParameterReference): Removed useless
11582         local variable.
11583
11584 2005-03-22  Raja R Harinath  <rharinath@novell.com>
11585
11586         Fix cs0128.cs
11587         * statement.cs (Block.AddVariable): Ensure that we skip implicit
11588         blocks before deciding whether the error is cs0136 or cs0128.
11589
11590         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11591         (using_alias_directive, using_namespace_directive): Pass
11592         MemberName, not an expression to Namespace.UsingAlias and
11593         Namespace.Using.
11594         (MakeName): Use the MemberName of the namespace.
11595         * namespace.cs (Namespace.MemberName): New.
11596         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11597         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11598         Likewise.
11599         * decl.cs (MemberName.Name): Make readonly.
11600         (MemberName.FromDotted): New "constructor".
11601         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11602         (MemberCore.Name): Compute from MemberName on demand.
11603         (MemberCore.SetMemberName): Provide a way to change the
11604         MemberName.
11605         (MemberCore.AddToContainer): Don't take a fullname parameter.
11606         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11607         fully qualified name of the container to the member name.
11608         (TypeContainer.AddToTypeContainer): Use a fully qualified name
11609         only if the type is a member of the root container.
11610         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11611         MemberName.Left rather than searching for an embedded ".".
11612         (PartialContainer.CreatePart): Update to changes in RootContext.
11613         (MemberBase.ShortName): Turn into a property.  Use
11614         MemberCore.SetMemberName.
11615         (MemberBase.ExplicitInterfaceName): Remove.
11616         (MemberBase.UpdateMemberName): Remove.
11617         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11618         (PropertyBase.SetMemberName): New override.
11619         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11620         (Tree.GetDecl): New.
11621         (Tree.AllDecls): Rename from Decls.
11622         * attribute.cs, enum.cs, report.cs: Update to changes.
11623         * driver.cs (MainDriver): Use MemberName.FromDotted on
11624         RootContext.MainClass.
11625
11626 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
11627
11628         * class.cs (FixedField.Define): Check for CS1664 and more sanity
11629         checks.
11630
11631         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11632
11633 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
11634
11635         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11636         property accessor modifiers.
11637
11638         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11639         fixed buffer attribute (CS1716).
11640         (PropertyMethod.HasCustomAccessModifier): When property accessor
11641         has custom modifier.
11642
11643         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11644         modifiers.
11645         (PropertyExpr.DoResolveLValue): Add CS0272.
11646
11647 2005-03-17  Miguel de Icaza  <miguel@novell.com>
11648
11649         * convert.cs: When converting to a pointer, use the proper Conv.U
11650         or Conv.I depending on the source data type.
11651
11652         * cs-tokenizer.cs: Make the size for large decimal constants,
11653         fixes #72957.
11654
11655 2005-03-17  Martin Baulig  <martin@ximian.com>
11656
11657         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11658         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
11659
11660 2005-03-17  Martin Baulig  <martin@ximian.com>
11661
11662         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11663         to bool so we can return an error condition.
11664         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11665         returned an error.
11666
11667 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
11668
11669         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11670         attributes.
11671
11672 2005-03-16  Raja R Harinath  <rharinath@novell.com>
11673
11674         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11675         Refactor to avoid traversing the list of assemblies, and to avoid
11676         string concatenation.
11677         * typemanager.cs (guid_attr_type): Remove.
11678         (negative_hits, pointers, references): Remove hashes.
11679         (type_hash): New.
11680         (GetConstructedType): New.  Uses type_hash to handle constructed
11681         types (arrays, references, pointers).
11682         (GetReferenceType, GetPointerType): Use it.
11683         (GetNestedType): New.  Uses type_hash to handle nested types of
11684         reflected types.
11685         (LookupType, LookupTypeDirect): Remove.
11686         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
11687         'types' hash and LookupTypeReflection directly.
11688         (params_string, params_object): Use GetConstructedType.
11689         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
11690         top-level types.
11691         (Namespace.Lookup): Use cached_types.
11692         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
11693         provided by old TypeManager.LookupType.
11694         * rootcontext.cs (MakeFQN): Remove.
11695         * decl.cs (DeclSpace.MakeFQN): Likewise.
11696         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
11697         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11698         TypeManager.GetConstructedType.
11699         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
11700
11701 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
11702
11703         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
11704         indexers.
11705
11706         * cs-parser.jay: Reports CS1527 for any namespace element.
11707
11708         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
11709         Added CS0407.
11710
11711         * expression.cs (ParameterReference.IsAssigned): Changed error to
11712         CS0269.
11713         (Error_WrongNumArguments): Moved CS0245 detection here.
11714
11715         * statement.cs (Return.Resolve): Add CS1622 report.
11716
11717 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
11718
11719         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
11720
11721 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
11722
11723         * attribute.cs expression.cs: Get rid of some allocations.
11724
11725 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
11726
11727         * doc.cs : just eliminate the latest change.
11728
11729 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11730
11731         * doc.cs : commented out the latest change. It breaks xml-030.cs
11732
11733 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11734
11735         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
11736           fail. So invoke CreateType() in FindDocumentedType().
11737
11738 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11739
11740         * cs-tokenizer.cs : added IsKeyword().
11741         * doc.cs : Detect keyword incorrectly used as identifier.
11742           Allow identifiers prefixed by @.
11743
11744 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
11745
11746         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
11747         It caused exception in namespace resolving (again!).
11748         
11749         * class.cs (Class.ctor): Removed exit.
11750         (PropertyMethod.ctor): ditto.
11751         
11752         * codegen.cs (Codegen.Reset): Reset static data.
11753         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11754         
11755         * cs-tokenizer.cs (Cleanup): Removed.
11756         
11757         * driver.cs (GetSystemDir): Rewrote to one line command.
11758         It caused problem with unloaded dynamic modules.
11759         (UnixParseOption): Removed Exit.
11760         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
11761         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
11762         Now can be mcs used as library.
11763         
11764         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
11765         empty location.
11766         
11767         * location.cs (Reset): Reset static data.
11768         
11769         * namespace.cs (Reset): Reset static data.
11770         
11771         * report.cs (Report.Reset): Reset static data.
11772         
11773         * rootcontext.cs (RootContext.Reset): Reset static data.
11774         
11775         * tree.cs (RootTypes.ctor): Use Location.Null
11776         
11777         * typemanager.cs (TypeManager.Reset): Reset static data.
11778         (CoreLookupType): Removed Exit.
11779         (TypeHandle.Reset): Reset static data.
11780         
11781 2005-03-10  Raja R Harinath  <rharinath@novell.com>
11782
11783         Fix #73516.
11784         * typemanager.cs (ComputeNamespaces): Import namespaces from
11785         referenced modules too.
11786
11787 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11788
11789         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
11790         than '.'.
11791
11792 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11793
11794         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
11795         enclosing DeclSpace.  This ensures that a name-lookup populates
11796         more caches and there are fewer 'TypeExpression's.  Carve out
11797         nested type lookup into ...
11798         (LookupNestedTypeInHierarchy): ... this.
11799
11800 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11801
11802         Clean up a few partial-class semantics.  
11803         Fixes test-357.cs and cs1618-2.cs.
11804         * cs-parser.jay (struct_declaration): Use 'current_class' as
11805         parent of newly-created struct.  Remove call to Register ().
11806         Use 'pop_current_class' to complete handing the current struct.
11807         (interface_declaration): Likewise.
11808         (class_declaration): Likewise.
11809         (enum_declaration): Use 'current_class' as parent of newly created
11810         enum.
11811         (delegate_declaration): Likewise.
11812         (pop_current_class): New function.  This is used to handle closing
11813         up the 'current_class' and 'current_container', and pointing them
11814         to the enclosing class/container.
11815         (CSharpParser): Initialize 'current_class' too.
11816         * decl.cs (MemberCore): Add check for invariant: a partial
11817         container is not a parsed entity, and thus does not enclose any
11818         parsed members.
11819         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
11820         (DeclSpace.BaseTypeExpr): Use it.
11821         (DeclSpace.LookupType): Add check for invariant.
11822         * class.cs (TypeContainer): Add check for invariant: a nested
11823         class should have the same NamespaceEntry as its enclosing class.
11824         (TypeContainer.EmitFieldInitializers): Make virtual.
11825         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
11826         MemberCore.
11827         (TypeContainer.Register): Remove.
11828         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
11829         null.  Use TypeResolveEmitContext for resolving base types and
11830         interfaces.  Move initialization of Parts.TypeBuilder here from
11831         ...
11832         (TypeContainer.DefineNestedTypes): ... here.
11833         (PartialContainer): Take a Namespace not a NamespaceEntry.
11834         (PartialContainer.Create): Don't use Register.  Call the
11835         appropriate Add... function directly.
11836         (ClassPart): Take both the PartialContainer and the enclosing
11837         class as constructor arguments.
11838         (ClassPart.EmitFieldInitializers): Override.
11839         (ClassPart.PartFindNestedTypes): Remove.
11840         (FieldBase.GetInitializerExpression): Resolve the initializer
11841         expression in the emit context of the enclosing class.
11842         * tree.cs (RootTypes): Remove Register ().
11843         
11844 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
11845
11846         * cs-parser.jay: Removed CS0134.
11847         
11848         * driver.cs: Removed CS1901.
11849         
11850         * expression.cs (SizeOf.DoResolve): Don't report CS0233
11851         for predefined types.
11852
11853 2005-03-07  Duncan Mak  <duncan@novell.com>
11854
11855         * codegen.cs (Save):  Catch UnauthorizedAccessException as
11856         well. Fixes bug #73454.
11857
11858 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
11859
11860         * cs-tokenizer.cs (xtoken): Add CS1035.
11861         
11862         * class.cs (MethodData.Define): Add CS0683.
11863         (FieldMember.ctor): Add CS0681.
11864
11865 2005-03-07  Raja R Harinath  <rharinath@novell.com>
11866
11867         * ecore.cs (SimpleName.DoResolve): Rename from
11868         SimpleName.DoResolveAllowStatic.
11869         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
11870         Pass 'intermediate' flag to MemberStaticCheck.
11871         (SimpleName.MemberStaticCheck): Skip "static check" only in case
11872         of "intermediate" lookups via MemberAccess.
11873         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
11874         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
11875
11876 2005-03-07  Raja R Harinath  <rharinath@novell.com>
11877
11878         Fix #73394.
11879         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
11880         slipped in because of variable names that are identical to a
11881         builtin type's BCL equivalent ('string String;', 'int Int32;').
11882         (PropertyExpr.EmitInstance): Likewise.
11883
11884 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
11885
11886         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
11887         
11888         * report.cs (warning_ignore_table): Made public.
11889
11890 2005-03-04  Raja R Harinath  <rharinath@novell.com>
11891
11892         Fix #73282.
11893         * class.cs (MethodData.Emit): Pass 'container' to
11894         container.GetObsoleteAttribute instead of 'container.Parent'.
11895
11896 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
11897
11898         * cs-parser.jay: Add 1534 error test.
11899
11900         * iterators.cs (Yield.CheckContext): Add error 1629.
11901         (Iterator.ctor): Save unsafe modifier.
11902         (MoveNextMethod.DoEmit): Restore unsafe context.
11903
11904         * namespace.cs (UsingAlias): Better error message.
11905
11906 2005-03-03  Dan Winship  <danw@novell.com>
11907
11908         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
11909         the warning message [#73219]
11910
11911 2005-03-03  Raja R Harinath  <rharinath@novell.com>
11912
11913         Fix compile with MCS 1.0.0.0.
11914         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
11915         w_restore to not depend on string constant folding.
11916
11917 2005-03-03  Raja R Harinath  <rharinath@novell.com>
11918
11919         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
11920         CS0246 check to users who passed 'silent = false'.
11921         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
11922         check.
11923         (SimpleName.SimpleNameResolve): Update.
11924         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
11925         (MemberAccess.IdenticalNameAndTypeName): Update.
11926         * doc.cs (FindDocumentedTypeNonArray): Update.
11927
11928 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
11929
11930         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
11931         * parameters.cs (ComputeAndDefineParameters): Remove.
11932         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
11933         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
11934         Use GetParameterInfo.
11935
11936 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
11937
11938         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
11939
11940 2005-03-02  Raja R Harinath  <rharinath@novell.com>
11941
11942         Unify DeclSpace.LookupType and DeclSpace.FindType.
11943         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
11944         is in charge of defining nested types on demand.
11945         (DeclSpace.LookupType): Use it when the current_type is a
11946         TypeBuilder.  Use LookupTypeDirect for reflected types.
11947         (DeclSpace.FindType): Remove.
11948         (DeclSpace.LookupInterfaceOrClass): Likewise.
11949         (DeclSpace.DefineTypeAndParents): Likewise.
11950         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
11951         DeclSpace.LookupType.
11952         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
11953         * typemanager.cs (LookupType): Simplify.
11954         (AddUserType): Remove type from negative_hits.
11955         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
11956         * class.cs (TypeContainer.FindMembers): Move handling of nested
11957         types ...
11958         (TypeContainer.FindMembers_NestedTypes): ... here.
11959         (TypeContainer.FindNestedType): Implement override.
11960         (ClassPart.FindNestedType): Delegate to PartialContainer.
11961         (ClassPart.PartFindNestedType): Looks up the nested types of the
11962         part alone.
11963
11964 2005-03-02  Martin Baulig  <martin@ximian.com>
11965
11966         * class.cs (TypeContainer.DoDefineMembers): We also need a default
11967         static constructor in static classes.
11968
11969 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
11970
11971         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
11972         sizeParamIndex is not specified.
11973
11974 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
11975
11976         Fix #73117
11977         * report.cs (WarningMessage.IsEnabled): Missing null check.
11978
11979 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
11980
11981         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
11982         in the fields and not in the properties.
11983
11984 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
11985
11986         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
11987         fields as well.
11988
11989 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
11990
11991         * attribute.cs: Small refactoring (improved robustness).
11992         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
11993         (ValidateGuid): Removed.
11994         (Resolve): Removed referenced to above mentioned.
11995         (GetAttributeUsage): Made private and changed to work without
11996         class assistance.
11997         (GetIndexerAttributeValue): Don't crash.
11998         (GetConditionalAttributeValue): Ditto.
11999         (GetClsCompliantAttributeValue): Ditto.
12000         (ExtractSecurityPermissionSet): All attributes exceptions are
12001         error 648.
12002         (GetPropertyValue): New helper.
12003         (GetMethodImplOptions): New method.
12004         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12005         some missing properties.
12006         
12007         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12008         (Method.ApplyAttributeBuilder): Updated.
12009         
12010         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12011         exception.
12012
12013 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12014
12015         Fix #73052.
12016         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12017         non-simple types (array, pointer, reference).
12018
12019 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12020
12021         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12022
12023         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12024         for operators.
12025         (Method.CheckBase): Catch wrong destructor here.
12026         (MethodData.Define): Add errors 550, 668.
12027
12028         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12029
12030         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12031
12032         * pending.cs (VerifyPendingMethods): Add error 551.
12033
12034         * typemanager.cs (CSharpName): Next error report helper.
12035
12036 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12037
12038         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12039         attributes. Removed useless attribute double check.
12040         It saves almost 2MBs for corlib.
12041
12042 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12043
12044         Fix #72924.
12045         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12046         called twice in case of error.
12047
12048 2005-02-23  Chris Toshok  <toshok@ximian.com>
12049
12050         Fix compiler portions of #72827.
12051         * statement.cs (Block.Emit): call Begin/EndScope on the
12052         EmitContext instead of the ILGenerator.
12053
12054         * codegen.cs (EmitContext.BeginScope): new method, call
12055         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12056         we have one.)
12057         (EmitContext.BeginScope): same, but EndScope and CloseScope
12058
12059         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12060         offset and call the superclass's OpenScope(int) with it.
12061         (SymbolWriter.CloseScope): get the current il
12062         offset and call superclass's CloseScope(int) with it.
12063
12064 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12065
12066         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12067         CS1677 for out and ref as well.
12068
12069         * class.cs (Method.Define): Add error CS1599 detection.
12070         
12071         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12072         
12073         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12074         
12075         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12076         
12077         * support.cs.cs (ModifierDesc): New helper method.
12078
12079 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12080             Abin Thomas  <projectmonokochi@rediffmail.com>
12081             Anoob V E  <projectmonokochi@rediffmail.com>
12082             Harilal P R  <projectmonokochi@rediffmail.com>
12083
12084         Fix #57851, #72718.
12085         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12086         MemberLookup (used for error reporting) actually returns a result.
12087         Fix error report number (122, not 112).
12088
12089 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12090             Anoob V E  <projectmonokochi@rediffmail.com>
12091             Harilal P R  <projectmonokochi@rediffmail.com>
12092
12093         Fix #71134.
12094         * pending.cs (PendingImplementation.GetAbstractMethods):
12095         Find NonPublic members too.
12096
12097 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12098
12099         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12100         Fixed error 217.
12101         
12102         * class.cs (MethodCore.CheckMethodAgainstBase):
12103         Add error 239 report.
12104
12105 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12106
12107         Fix #68955.
12108         * expression.cs (Invocation.IsApplicable): Make public.
12109         (Invocation.IsParamsMethodApplicable): Likewise.
12110         * delegate.cs (Delegate.VerifyApplicability): Don't use
12111         Invocation.VerifyArgumentCompat for parameter applicability
12112         testing.  Use Invocation.IsApplicable and
12113         Invocation.IsParamsMethodApplicable.
12114
12115 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12116
12117         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12118         
12119         * class.cs (Operator.Define): Add error 217 report.
12120         
12121 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12122
12123         * namespace.cs (UsingEntry.Resolve): Undo change below.
12124
12125 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12126
12127         Fix #72756.
12128         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12129         disable the error message when the extended MemberLookup also
12130         fails.
12131         (Expression.MemberLookupFinal): Update.
12132         (SimpleName.DoSimpleNameResolve): Update.
12133         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12134         Don't use MemberLookupFinal.
12135         (New.DoResolve): Update.
12136         (BaseAccess.CommonResolve): Update.
12137
12138 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12139
12140         Fix #72732.
12141         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12142         occured previously, don't resolve again.
12143
12144 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12145
12146         Fix #69949
12147         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12148         argument. Call ResolveAttributeUsage for unresolved.
12149         when types doesn't match ctor arguments.
12150         
12151         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12152         for nested attribute classes.
12153         (Class.attribute_usage): Removed.
12154         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12155         for attribute class.
12156         
12157         * ecore.cs (IsAttribute): Removed.
12158         
12159         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12160         
12161         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12162         now normal types.
12163         (attribute_types): Removed.
12164         (EmitCode): Global attributes are emited as the latest.
12165
12166 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12167
12168         * class.cs (EmitFieldInitializers): Don't emit field initializer
12169         for default values when optimilization is on.
12170         
12171         * constant.cs (Constant.IsDefaultValue): New property.
12172         
12173         * driver.cs: Add /optimize handling.
12174         
12175         * constant.cs,
12176         * ecore.cs,
12177         * literal.cs: Implement new IsDefaultValue property.
12178         
12179         * rootcontext.cs (Optimize): New field, holds /optimize option.
12180
12181 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12182
12183         Fix crasher in re-opened #72347.
12184         * namespace.cs (Namespace.Lookup): Return null if
12185         DeclSpace.DefineType returns null.
12186
12187         Fix #72678.
12188         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12189
12190 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12191
12192         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12193         now returns null if it cannot resolve to an lvalue.
12194         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12195         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12196         returned null.  Remove check for SimpleName.
12197         (EventExpr.DoResolveLValue): New.
12198         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12199         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12200         error from ...
12201         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12202         avoid CS0131 error.
12203         (Unary.ResolveOperator): Move CS0211 check ...
12204         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12205         CS0131 error.
12206         (Unary.DoResolveLValue): Simplify.
12207         (AddressOf.DoResolveLValue): New.
12208         (ArrayAccess.DoResolveLValue): New.
12209
12210 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12211
12212         * attribute.cs (Attribute.Resolve): Add arguments casting for
12213         when types doesn't match ctor arguments.
12214
12215 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12216
12217         Fix parts of #63202.
12218         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12219         lookup of operator in base type.  Ensure that all checks happen
12220         when the operator resolves to an "op_..." method.
12221
12222 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12223
12224         Fix #71992.
12225         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12226         'ignore_cs0104' parameter.  Pass it to ...
12227         (NamespaceEntry.Lookup): ... this.
12228         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12229         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12230         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12231         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12232         Update.  Request that cs0104 errors be ignored.
12233         (ComposedCast.ResolveAsTypeStep): Update.
12234
12235 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12236
12237         Fix #59209.
12238         * expression.cs (Invocation.BetterFunction): Remove support for
12239         comparing virtual functions and their overrides.
12240         (Invocation.IsOverride): New.
12241         (Invocation.OverloadResolve): Don't consider 'override' functions
12242         during candidate selection.  Store them in a lookaside list.
12243         If the selected method is a 'virtual' function, use the list to
12244         find any overrides that are closer to the LHS type.
12245
12246 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12247
12248         * expression.cs (New.DoResolve): Add complex core type reduction.
12249         (New.Constantify): Converts complex core type syntax like 'new int ()'
12250         to simple constant.
12251         
12252 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12253
12254         * decl.cs (EntryType.EntryType): New constructor to create an
12255         updated copy of a cache entry.
12256         (MemberCache.AddMethods): Use it.
12257         (MemberCache.ClearDeclaredOnly): Remove.
12258         (MemberCache.MemberCache): Update.
12259
12260 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12261
12262         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12263         variable.  This one is represents the actual low-level declaration
12264         of the method, as opposed to the semantic level `IsStatic'.   
12265
12266         An anonymous method which is hosted into a static method might be
12267         actually an instance method.  IsStatic would reflect the
12268         container, while MethodIsStatic represents the actual code
12269         generated.
12270
12271         * expression.cs (ParameterReference): Use the new MethodIsStatic
12272         instead of IsStatic.
12273
12274         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12275         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12276         set on the current EmitContext. 
12277
12278         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12279         resolve our casted expression as an LValue.  This triggers the
12280         proper LValue processing that is later required by Assign.
12281
12282         This fixes 72347.
12283
12284         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12285
12286 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12287
12288         C# 2.0 Fixed buffer implementation
12289
12290         * anonymous.cs: Update after RegisterHelperClass renaming.
12291
12292         * attribute.cs (AttributeTester.fixed_buffer_cache):
12293         Cache of external fixed buffers.
12294         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12295         implementation if field is fixed buffer else null.
12296
12297         * class.cs
12298         (TypeContainer.AddField): Accept FieldMember instead of Field.
12299         (FieldBase.IsFieldClsCompliant): Extracted code from
12300         VerifyClsCompliance descendant customization.
12301         (FixedField): New class handles fixed buffer fields.
12302         (FixedFieldExternal): Keeps information about imported fixed
12303         buffer.
12304         (IFixedField): Make access to internal or external fixed buffer
12305         same.
12306
12307         * cs-parser.jay: Add fixed buffer parsing.
12308
12309         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12310         buffer.
12311
12312         * expression.cs (Indirection): Extended implementation to accept
12313         fixed buffer field.
12314         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12315         (ElementAccess.MakePointerAccess): Get type as parameter.
12316         (DoResolve): Add fixed buffer field expression conversion.
12317         (DoResolveLValue): Ditto.
12318         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12319         (ArrayPtr): Derives from FixedBufferPtr.
12320         (ArrayPtr.Emit): Add extra emit for array elements.
12321
12322         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12323
12324         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12325         for compiler generated types.
12326         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12327
12328         * statement.cs (Fixed): Refactored to be easier add fixed buffer
12329         and consume less memory.
12330         (Fixed.Resolve): Add fixed buffer case.
12331
12332         * typemanager.cs (compiler_generated_attr_ctor,
12333         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12334         (HasElementType): Add our own implementation to work on every
12335         runtime.
12336
12337 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12338
12339         * anonymous.cs (CaptureContext): Track whether `this' has been
12340         referenced.   
12341
12342         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
12343         only captured `this' if it was implicitly done (instance
12344         methods/variables were used). 
12345
12346         * codegen.cs (EmitContext.CaptureThis): New method to flag that
12347         `this' must be captured.
12348
12349 2005-01-30  Miguel de Icaza  <miguel@novell.com>
12350  
12351         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12352         is null it means that there has been no need to capture anything,
12353         so we just create a sibling.
12354
12355         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12356
12357         Just a partial fix.  The other half is fairly elusive.
12358         
12359 2005-02-10  Raja R Harinath  <rharinath@novell.com>
12360
12361         Fix #52586, cs0121-4.cs.
12362         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
12363         and return a hashtable.
12364         (MemberCache.ClearDeclaredOnly): New.
12365         (MemberCache.MemberCache): Update to change.  Make a deep copy of
12366         the method_hash of a base type too.
12367         (MemberCache.AddMethods): Adapt to having a deep copy of the base
12368         type methods.  Overwrite entries with the same MethodHandle so
12369         that the ReflectedType is correct.  The process leaves in base
12370         virtual functions and their overrides as distinct entries.
12371         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
12372         matters since it was boxed in a ArrayList before.
12373         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12374         modifier.
12375         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
12376         case of a virtual function and its override (choose the overload
12377         as better).
12378         (Invocation.OverloadResolve): Avoid 'override' members during
12379         'applicable_type' calculation.
12380
12381 2005-02-09  Raja R Harinath  <rharinath@novell.com>
12382
12383         Combine two near-redundant caches.
12384         * typemanager.cs (method_params): Rename from method_internal_params.
12385         (TypeManager.GetParameterData): New.  Replace
12386         Invocation.GetParameterData.
12387         (TypeManager.LookupParametersByBuilder): Remove.
12388         * expression.cs (Invocation.method_parameter_cache): Remove.
12389         (Invocation.GetParameterData): Remove.
12390         Update to changes.
12391         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12392         Update to changes.
12393
12394 2005-02-08  Raja R Harinath  <rharinath@novell.com>
12395
12396         Fix #72015.
12397         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12398         TypeManager.multicast_delegate_type is null, resolve it by looking
12399         up "System.MulticastDelegate".
12400         * rootcontext.cs (RootContext.ResolveCore): Simplify.
12401
12402 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
12403             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
12404             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
12405
12406         Fix cs0164.cs.
12407         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12408         (LabeledStatement.AddReference): New.  Set 'referenced'.
12409         (Goto.Resolve): Use it.
12410
12411 2005-02-05  John Luke  <john.luke@gmail.com>
12412
12413         * driver.cs: remove duplicate -doc line in Usage ()
12414
12415 2005-02-04  Raja R Harinath  <rharinath@novell.com>
12416
12417         * location.cs (Location.AddFile): Fix CS2002 error report.
12418
12419 2005-02-02  Martin Baulig  <martin@ximian.com>
12420
12421         * delegate.cs (Delegate.DefineType): Report an internal error if
12422         TypeManager.multicast_delegate_type is null.  See bug #72015 for
12423         details.        
12424
12425 2005-02-02  Raja R Harinath  <rharinath@novell.com>
12426
12427         Fix a crasher in a variant of #31984.
12428         * const.cs (Constant.CheckBase): New override that defers the
12429         new-or-override check in case the base type hasn't been populated
12430         yet.
12431         (Constant.Define): Ensure the new-or-override check is performed.
12432
12433 2005-02-01  Duncan Mak  <duncan@ximian.com>
12434
12435         * const.cs (LookupConstantValue): Check that `ce' is not null
12436         before calling GetValue ().
12437
12438 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12439
12440         Fix test-334.cs (#69519).
12441         * cs-parser.jay (using_alias_directive): Pass in an expression to
12442         NamespaceEntry.UsingAlias.
12443         (using_namespace_directive): Pass in an expression to
12444         NamespaceEntry.Using.
12445         (namespace_name): Don't flatten to a string.
12446         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12447         (NamespaceEntry.AliasEntry.Resolve): Lookup using
12448         ResolveAsTypeStep.
12449         (NamespaceEntry.UsingEntry): Likewise.
12450         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12451         changes.
12452         (NamespaceEntry.LookupForUsing): Remove.
12453         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12454         names.
12455         (NamespaceEntry.Lookup): Remove support for dotted names.
12456
12457 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12458
12459         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12460         split into two.
12461         (NamespaceEntry.ImplicitParent): Compute on demand.
12462         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12463         parallels the current.
12464         (NamespaceEntry.LookupForUsing): Use it.
12465         (NamespaceEntry.Lookup): If the current namespace-entry is
12466         implicit, don't search aliases and using tables.
12467
12468 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12469
12470         Fix #31984.
12471         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12472         BaseCache here.
12473         (TypeContainer.BaseCache): Compute on demand.
12474         (TypeContainer.FindMembers): Define constants and types if they're
12475         not already created.
12476         (FieldMember.Define): Move resetting of ec.InUnsafe before error
12477         check.
12478         * const.cs (Constant.Define): Make idempotent.
12479
12480 2005-01-29  Miguel de Icaza  <miguel@novell.com>
12481
12482         * pending.cs: Produce better code (no nops produced by using Ldarg
12483         + value).
12484         
12485         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12486         i - 1' it should be arg + 1.
12487
12488         Fixes bug #71819.
12489
12490 2005-01-28  Raja R Harinath  <rharinath@novell.com>
12491
12492         * attribute.cs (Attribute.CheckAttributeType): Make private
12493         non-virtual.
12494         (Attribute.ResolveType): Make virtual.
12495         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12496         handling of RootContext.Tree.Types.
12497
12498 2005-01-27  Raja R Harinath  <rharinath@novell.com>
12499
12500         Update attribute-handling to use the SimpleName/MemberAccess
12501         mechanisms.
12502         * cs-parser.jay (attribute): Pass in an expression to the
12503         constructors of Attribute and GlobalAttribute.
12504         * attribute.cs (Attribute): Take an expression for the name.
12505         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
12506         passed in attribute name expression.
12507         (Attribute.CheckAttributeType): Use it.
12508         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12509         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12510         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
12511         argument to prevent error messages if the lookup fails.
12512
12513 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
12514
12515         * expression.cs (Indirection): Implemented IVariable interface
12516         to support indirection in AddressOf operator.
12517         (PointerArithmetic.Emit): Add optimalization for case where
12518         result can be precomputed.
12519
12520 2005-01-26  Martin Baulig  <martin@ximian.com>
12521
12522         * class.cs (TypeContainer.AttributeTargets): Return the correct
12523         AttributeTargets depending on our `Kind' instead of throwing an
12524         exception; fixes #71632.
12525
12526 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
12527
12528         Fix #71257
12529         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12530         constant members.
12531
12532 2005-01-25  Raja R Harinath  <rharinath@novell.com>
12533
12534         Fix #71602.
12535         * expression.cs (MemberAccess.DoResolve): Don't complain with
12536         cs0572 when the LHS of a member access has identical name and type
12537         name.
12538
12539 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
12540
12541         Fix #71651, #71675
12542         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12543         CreatePermission.
12544         Create custom PermissionSet only for PermissionSetAttribute.
12545
12546 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
12547
12548         Fix #71649
12549         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12550         delegates in static class.
12551
12552 2005-01-24  Martin Baulig  <martin@ximian.com>
12553
12554         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12555         merging an implicit block, just use its reachability.
12556
12557         * statement.cs (Block.Resolve): Make the unreachable code check
12558         work wrt. implicit blocks; see test-337 from #63842.
12559
12560 2005-01-21  Alp Toker  <alp@atoker.com>
12561  
12562         * cs-parser.jay: destructor_declaration's container is PartialContainer
12563         not Class when partial types are used, so use Kind prop instead of
12564         'is'.
12565         
12566 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
12567
12568         * cs-parser.jay: Improve error reporting when an interface
12569         declares new types.
12570
12571 2005-01-20  Dick Porter  <dick@ximian.com>
12572
12573         * support.cs: SeekableStreamReader fix from Sandor Dobos
12574         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12575         chars are read.  Fixes bug 70369.
12576
12577 2005-01-20  Raja R Harinath  <rharinath@novell.com>
12578
12579         * cs-parser.jay (catch_clause): Simplify current_block handling
12580         somewhat.
12581
12582 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
12583
12584         * convert.cs (ImplicitStandardConversionExists): Synchronize the
12585         code with ImplicitStandardConversion to handle the implicit
12586         conversion of method groups into valid delegate invocations. 
12587
12588         The problem is that in parameter handling we were using this code
12589         path.  Fixes bug #64698
12590
12591 2005-01-19  Raja R Harinath  <rharinath@novell.com>
12592
12593         * cs-parser.jay: Fix several infelicities.
12594         - Avoid assigning to the parser value stack.  Code like 
12595           '$3 = null' is unclean.  Synthesize a value for the code block
12596           instead. 
12597         - Avoid using oob_stack for storing location information.  Use ...
12598         (_mark_): ... this.  New (empty) rule.  Saves the current location
12599         in $$.
12600         (foreach_statement): Avoid using oob_stack for current_block
12601         handling.  Use technique used in for_statement and
12602         using_statement.  Synthesize a value for the code block to store
12603         additional intermediate information.
12604
12605 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
12606
12607         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12608         of a different type is only allowed to private fields of a
12609         containing type, not on fields of a base class.
12610
12611         See test-174.cs and error cs0122-9.cs
12612
12613 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12614
12615         Fix test-335.cs (bug #58126).
12616         * cs-parser.jay (argument): Split out non-expression parts of the
12617         rule into 'non_simple_argument'.
12618         (invocation_expression): Support parenthesized invocations with
12619         multiple arguments, and with single non-simple arguments.
12620
12621 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12622
12623         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12624         places.
12625
12626 2005-01-12  Raja R Harinath  <rharinath@novell.com>
12627
12628         Fix cs0038-1.cs, cs1640-6.cs.
12629         * ecore.cs (Expression.Resolve): Remove special-case for
12630         SimpleName in error-handling.
12631         (Expression.almostMatchedMembers): Relax access permission to
12632         protected.
12633         (Expression.MemberLookupFailed): Handle duplicates in
12634         almostMatchedMembers list.
12635         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12636         * expression.cs (New.DoResolve): Report CS1540 for more cases.
12637         * typemanager.cs (GetFullNameSignature): Use the MethodBase
12638         overload if the passed in MemberInfo is a MethodBase.
12639
12640 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
12641
12642         Fix #70749
12643         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12644         for non-CAS & merge permission sets properly.
12645
12646 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12647
12648         Improve standard-compliance of simple name and member access 
12649         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
12650         * ecore.cs (FullNamedExpression): New abstract base class 
12651         for Namespaces and TypeExpressions.
12652         (ResolveFlags.SimpleName): Remove.
12653         (SimpleName): Remove support for dotted names.
12654         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
12655         DeclSpace.FindType and DeclSpace.LookupType.
12656         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12657         (Expression.ExprClassName): Make member function.
12658         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12659         a namespace.  Remove creation of dotted "SimpleName"s.
12660         (MemberAccess.DoResolve): Likewise.
12661         * decl.cs (DeclSpace.Cache): Make private.
12662         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12663         (DeclSpace.FindType): Update.
12664         (DeclSpace.LookupType): Move here from RootContext.  Return a 
12665         FullNamedExpression.
12666         * namespace.cs (Namespace): Derive from FullNamedExpression
12667         so that it can be part of expression resolution.
12668         (Namespace.Lookup): Return an FullNamedExpression.
12669         (NamespaceEntry.LookupAlias): Lookup aliases only in current
12670         namespace.
12671         * rootcontext.cs (NamespaceLookup): Remove.
12672         (LookupType): Move to DeclSpace.
12673         * attribute.cs (CheckAttributeType): Update.
12674         * doc.cs (FindDocumentedType): Remove allowAlias argument.
12675         (FindDocumentedTypeNonArray): Likewise.
12676
12677 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12678
12679         Fix cs0509.cs, cs1632.cs.
12680         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12681         is the same as IsInterface.
12682         (TypeContainer.GetClassBases): Likewise.
12683         * statement.cs (LabeledStatement.ig): New field.
12684         (LabeledStatement.LabelTarget): Save ILGenerator which created the
12685         label.
12686         (LabeledStatement.DoEmit): Check that the label was created with
12687         the same ILGenerator.
12688
12689 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
12690
12691         Fix #71058
12692         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
12693         accessors to its properties.
12694
12695         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
12696         from accessors to property.
12697         
12698 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
12699
12700         Fix #70722
12701         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
12702         only for overrides.
12703         
12704 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
12705
12706         * attribute.cs: Check for null and empty strings.  
12707
12708         I have lost another battle to Paolo.
12709
12710 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
12711
12712         Fix #70942
12713         * class.cs (PropertyMethod): Set Parent field in ctors.
12714         (SetMethod.InternalParameters): Add unsafe switch hack.
12715         Override MarkForDuplicationCheck where it is appropriate.
12716
12717         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
12718         It says whether container allows members with the same name.
12719         Base default is no.
12720         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
12721         Removed is_method parameter.
12722
12723 2005-01-06  Duncan Mak  <duncan@ximian.com>
12724
12725         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
12726         because the previous change led to incorrect reporting of CS1032
12727         ("Cannot define/undefine preprocessor symbols after first token in
12728         file"). Instead of using `tokens_seen' as the only flag that
12729         triggers CS1040, introduce `comments_seen'. This new flag is used
12730         to signify having seen comments on the current line, so it is
12731         unset after a newline.
12732
12733 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
12734
12735         * doc.cs : When searching for a type, find nested type too.
12736           This fixes bug #71040.
12737
12738 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
12739
12740         * doc.cs :
12741           - Warn missing member comment on those classes which also does not
12742             have doc comments. Fixed bug #71041.
12743           - Don't warn missing doc comment on default constructor.
12744             Fixed bug #71042.
12745
12746 2005-01-06  Duncan Mak  <duncan@ximian.com>
12747
12748         * cs-tokenizer.cs (xtoken): After handling traditional C-style
12749         comments, set `tokens_seen' to true. This allows us to detect
12750         misplaced preprocessor directives (i.e. not at the beginning of
12751         the a line, nor after whitespaces). In that case, report error
12752         CS1040. This fixes bug #56460.
12753
12754         * cs-parser.jay (interface_member_declaration): Add checks for
12755         IsExplicitImpl, and report CS0541 error if an interface member is
12756         defined as an explicit interface declaration.
12757
12758 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
12759
12760         Fix #70817
12761         * class.cs (PropertyMethod): Set Parent field in ctors.
12762         (SetMethod.InternalParameters): Add unsafe switch hack.
12763         
12764         * decl.cs (MemberCore.Parent): Cannot be readonly.
12765
12766 2005-01-06  Raja R Harinath  <rharinath@novell.com>
12767
12768         * decl.cs (DeclSpace.ResolveType): Remove.
12769         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
12770         Merge in code from ...
12771         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
12772         * class.cs, enum.cs: Update to changes.
12773
12774 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
12775
12776         * anonymous.cs: Ensure that we init the scope of our parent if it
12777         has not been initialized yet.
12778
12779 2004-12-30  Duncan Mak  <duncan@ximian.com>
12780
12781         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
12782         if field.FieldBuilder is null. Fixes #70758.
12783
12784         * convert.cs: Fixed some typos and updated some of the comments.
12785         (ImplicitStandardConversionExists):
12786         (TryImplicitIntConversion): If `target_type' is an interface and
12787         the type of `ic' implements this interface, return true or a new
12788         BoxedCast instead of null. This fixes #70468.
12789
12790 2004-12-29  Duncan Mak  <duncan@ximian.com>
12791
12792         * expression.cs (Argument.Emit): Check that Expr is
12793         IMemoryLocation before casting to it, and report CS1510 otherwise.
12794
12795         This fixes #70402.
12796
12797 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
12798
12799         * statement.cs (Block.ThisVariable): remove the recursion here, to
12800         make the --profile more sane.
12801
12802 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
12803
12804         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
12805         assembly, by JB Evain.
12806
12807 2004-12-17  Raja R Harinath  <rharinath@novell.com>
12808
12809         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
12810           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
12811         "parent" refers to enclosing type/class.  "base" refers to superclass.
12812
12813 2004-12-17  Raja R Harinath  <rharinath@novell.com>
12814
12815         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12816         Ensure that we only have GlobalAttributes.
12817         * attribute.cs (Attribute.Emit): Make non-virtual.
12818         (GlobalAttribute.Emit): Remove.
12819         (Attribute.Resolve): Make virtual.
12820         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
12821         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
12822         the argument. Don't create one.
12823         (Attribute.GetObsoleteAttribute): Likewise.
12824         (Attribute.GetClsCompliantAttributeValue): Likewise.
12825         * class.cs, decl.cs: Update to changes.
12826
12827 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
12828
12829         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
12830         
12831         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
12832         
12833         * statement.cs (Foreach.Resolve): Add error 186 report.
12834
12835 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
12836
12837         * expression.cs (Conditional.DoResolve): Add warning 429.
12838         
12839         * statement.cs (If.Resolve): Add warning 665.
12840
12841 2004-12-16  Raja R Harinath  <rharinath@novell.com>
12842
12843         New invariant: RootContext.Tree.Types.NamespaceEntry == null
12844         except when in the parser, and in GlobalAttribute.
12845         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
12846         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
12847         RootContext.Tree.Types.NamespaceEntry once work is done.
12848         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
12849         and resets RootContext.Tree.Types.NamespaceEntry.
12850
12851 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
12852
12853         * cs-parser.jay: Don't create a block for every variable.
12854
12855 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
12856
12857         * location.cs: Provide extra information.
12858
12859         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
12860         variables from the captured environment, it is the ldarg_0.
12861
12862 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
12863
12864         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
12865         find a conclusion.
12866         
12867         * class.cs: Changed warning level for 169 to avoid developer
12868         displeasure from warning flooding. It will be changed back when they
12869         fix most of current BCL warnings.
12870         
12871         * RootContext.cs: Pushed default WarningLevel to 3.
12872         
12873         * statement.cs: Removed unused variable.
12874
12875 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
12876
12877         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
12878         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
12879         Add error 502 report.
12880         (StaticClass.DefineType): Add error 441 report.
12881         (Class.AllowedModifiersProp): New virtual property as temporary
12882         extension to AllowedModifiers.
12883         (Class.DefineType): Add error 418 report. Moved ModFlags check here
12884         to share implementation with StaticClass and don't call virtual
12885         methods from ctor.
12886         
12887         * driver.cs (MainDriver): Add error 1558 test.
12888
12889         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
12890         report. Moved error 36 test here.
12891
12892         * statement.cs (Throw.Resolve): Add error 724 report.
12893
12894         * typemanager.cs: Add out_attribute_type core type.
12895         
12896 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
12897
12898         * class.cs (TypeContainer.VerifyClsCompliance): Add error
12899         3018 report.
12900         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
12901
12902         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
12903         3017 report.
12904         
12905         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
12906
12907         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
12908         Add error 3023 report.
12909         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
12910
12911         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
12912         implementation.
12913
12914 2004-12-12  John Luke  <john.luke@gmail.com>
12915
12916         * driver.cs (AddArgs): take -- into account when
12917         adding arguments, fixes bug 65710 
12918
12919 2004-12-12  Martin Baulig  <martin@ximian.com>
12920
12921         * expression.cs (Unary.TryReduceNegative): Added support for
12922         SByteConstant and ByteConstant.
12923         (Unary.Reduce): Check error values from TryReduceNegative().
12924
12925 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
12926
12927         * attributes.cs (Attribute.Resolve): Avoid multiple error report
12928         and report exception as error 182.
12929
12930 2004-12-10  Raja R Harinath  <rharinath@novell.com>
12931
12932         * driver.cs (Main): Fix message when there are warnings.
12933
12934 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
12935
12936         * delegate.cs: Fixed my fix from yesterday, sorry about that.
12937
12938 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
12939
12940         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
12941         Reduced number of warnings.
12942         
12943         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
12944
12945 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * driver.cs: Removed message.
12948
12949         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
12950
12951 2004-12-08    <vargaz@freemail.hu>
12952
12953         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
12954
12955 2004-12-08  Martin Baulig  <martin@ximian.com>
12956
12957         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
12958         instead of a CS3002 for properties and indexer.
12959
12960 2004-12-08  Martin Baulig  <martin@ximian.com>
12961
12962         * decl.cs (MemberName.ToString): Make this work again.
12963
12964 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
12965
12966         * attribute.cs (Resolve): Add error 591 detection.
12967
12968         * class.cs (FieldMember.Define): Add error 1547 detection.
12969         (Indexer.Define): Add error 620 detection.
12970         (Operator.Define): Add error 590 detection.
12971
12972         * ecore.cs: Missing argument for error 79.
12973
12974         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
12975         detection.
12976
12977 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
12978
12979         Fix #70106
12980         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
12981         only.
12982
12983 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
12984
12985         * cs-parser.jay : handle doc comments on implicit/explicit operators.
12986           Some operator comments were suppressed.
12987         * doc.cs : Implicit/explicit operator name in doc comments are like
12988           "op_Explicit(type)~returnType", so added suffix handling.
12989
12990 2004-12-07  Martin Baulig  <martin@ximian.com>
12991
12992         * decl.cs
12993         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
12994         (MemberCore.GetClsCompliantAttributeValue): Likewise.
12995         (DeclSpace.ec): New protected field; store the EmitContext here.
12996         (DeclSpace.EmitContext): New public property; moved here from
12997         `TypeContainer'.
12998         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
12999         EmitContext.
13000
13001         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13002         (Enum.Emit): Don't create a new EmitContext.
13003
13004         * delegate.cs (Delegate.DefineType): Always create the
13005         EmitContext.
13006
13007         * iterators.cs (Iterators.DefineIterator): Create a new
13008         EmitContext and store it in `ec'.
13009
13010 2004-08-24  Martin Baulig  <martin@ximian.com>
13011
13012         * typemanager.cs
13013         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13014         this for accessibility checks.
13015         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13016         IsNestedFamilyAccessible.
13017         (TypeManager.IsSubclassOf): New method, do what the name actually
13018         says.   
13019
13020 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13021
13022         Fix crash on cs0657-17.cs.
13023         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13024         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13025         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13026         the case where the NamespaceEntry gets overwritten.
13027
13028 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13029
13030         Fixed #69195, #56821
13031         * ecore.cs (ResolveBoolean): Tiny refactoring.
13032
13033         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13034         of right expression resolving when left is false constant and
13035         operator is LogicalAnd OR true constant and operator is LogicalOr.
13036
13037         * statement.cs (ResolveUnreachable): Always reports warning.
13038
13039 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13040
13041         * class.cs: Distinguish between 1721 and 1722 (just a little help
13042         for the programmer).
13043
13044 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13045
13046         * delegate.cs: Only allow this on new versions of the language. 
13047
13048 2004-12-02  Duncan Mak  <duncan@ximian.com>
13049
13050         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13051         Expression class.
13052         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13053         here as a static method. Take an additional bool out parameter
13054         `must_do_cs1540_check' for signaling to InstanceResolve.
13055         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13056         member field from PropertyExpr class and made it an argument of
13057         the method instead.
13058         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13059         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13060         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13061         and `remove_accessor' as well as InstanceResolve: report CS0122
13062         where applicable.
13063
13064         Fixes #70129.
13065
13066 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13067
13068         Fix test-327.cs, test-328.cs, and put in early infrastructure
13069         for eventually fixing #52697.
13070         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13071         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13072         from other methods.
13073         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13074         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13075         (VerifyUsing, error246): Update.
13076         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13077         'NamespaceEntry.LookupNamespaceOrType'.
13078
13079 2004-12-03  Martin Baulig  <martin@ximian.com>
13080
13081         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13082         method as our child, call AnonymousMethod.Compatible() on it.
13083
13084 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13085
13086         Disable XML documentation support in 'basic' profile.
13087         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13088         Redirect XmlElement to System.Object.
13089         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13090         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13091         * mcs.exe.sources: Add doc-bootstrap.cs.
13092         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13093         of doc.cs.
13094
13095 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13096
13097         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13098           comments are allowed.
13099
13100 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13101
13102         * delegate.cs: Add checks for subtypes in paramaters and return values
13103         in VerifyMethod () to add support for Covariance/Contravariance
13104         in delegates.
13105         
13106 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13107
13108         * report.cs: Remove extra closing parenthesis.
13109
13110         * convert.cs (Error_CannotImplicitConversion): If the name of the
13111         types are the same, provide some extra information.
13112
13113         * class.cs (FieldBase): Use an unused bit field from the field to
13114         encode the `has_offset' property from the FieldMember.  This saves
13115         a couple of Ks on bootstrap compilation.
13116
13117         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13118         method as our child, return the AnonymousMethod resolved
13119         expression.
13120
13121         * expression.cs (New.DoResolve): Allow return values from
13122         NewDelegate to also include AnonymousMethods.
13123
13124         Fixes #70150.
13125
13126 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13127
13128         Fix bug #70102
13129         * attribute.cs (Resolve): Improved implementation of params
13130         attribute arguments.
13131
13132         * support.cs (ParameterData): Add HasParams to be faster.
13133
13134 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13135
13136         all things are for /doc support:
13137
13138         * doc.cs: new file that supports XML documentation generation.
13139         * mcs.exe.sources: added doc.cs.
13140         * driver.cs:
13141           Handle /doc command line option.
13142           Report error 2006 instead of 5 for missing file name for /doc.
13143           Generate XML documentation when required, after type resolution.
13144         * cs-tokenizer.cs:
13145           Added support for picking up documentation (/// and /** ... */),
13146           including a new XmlCommentState enumeration.
13147         * cs-parser.jay:
13148           Added lines to fill Documentation element for field, constant,
13149           property, indexer, method, constructor, destructor, operator, event
13150           and class, struct, interface, delegate, enum.
13151           Added lines to warn incorrect comment.
13152         * rootcontext.cs :
13153           Added Documentation field (passed only when /doc was specified).
13154         * decl.cs:
13155           Added DocComment, DocCommentHeader, GenerateDocComment() and
13156           OnGenerateDocComment() and some supporting private members for
13157           /doc feature to MemberCore.
13158         * class.cs:
13159           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13160         * delegate.cs:
13161           Added overriden DocCommentHeader.
13162         * enum.cs:
13163           Added overriden DocCommentHeader and GenerateDocComment().
13164
13165 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13166
13167         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13168         unwrapping the enumeration values, chain to
13169         DoConstantNumericPromotions again, so we can promote things to the
13170         fundamental types (takes care of enums that are bytes, sbytes).
13171
13172         Fixes bug #62054.
13173
13174 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13175
13176         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13177         Fix long-standing bug in type-lookup.  Use FindType instead of
13178         LookupType when ec.ResolvingTypeTree.
13179         (Attribute.ResolveType, Attribute.Resolve)
13180         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13181         Update to changes.
13182         (Attributes.Search): Remove internal version.  Update.
13183         (Attributes.SearchMulti): Update.
13184         (Attributes.GetClsCompliantAttribute): Remove.
13185         (Attributes.GetIndexerNameAttribute): Remove.
13186         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13187         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13188         * class.cs (Indexer.Define): Likewise.
13189
13190 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13191
13192         Fix bug #68790
13193         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13194         MarshallByReference members access.
13195
13196         * expression.cs: Use CheckMarshallByRefAccess;
13197         Better error CS0197 message.
13198
13199         * report.cs: Print whole related error message.
13200
13201 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13202
13203         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13204         the current directory to help debugging.
13205
13206 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13207
13208         * class (GetClassBases): Better error 60 report.
13209         (EventProperty): Disabled warning 67 detection.
13210
13211 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13212
13213         Fix bug #60324
13214         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13215
13216         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13217         precise values.
13218
13219 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13220
13221         Fix bug #49488
13222         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13223
13224         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13225
13226 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13227
13228         * attribute.cs (Attribute.Resolve): Refine error reporting and
13229         report a cs0117 if the identifier does not exist, to distinguish
13230         from 0617 which is a miss-use of the actual identifier.
13231
13232         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13233         between cs0070 and cs0079.
13234
13235         * class.cs (MemberBase.DoDefine): When reporting a wrong
13236         accessibility level, we use MethodCore to compare instead of
13237         Method (this was a regression in some refactoring effort).
13238
13239         So now we correctly report cs0056 again.
13240
13241         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13242         testing the target_type (which was known to be object_type) and
13243         not the source type (which is anonymous_method).
13244
13245         Fixed reporting of error cs1660.
13246
13247         * expression.cs (UserCast.Source): Expose the underlying cast.
13248
13249         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13250         allowed types to find a match to int32 first (most common).
13251
13252         In addition, it ignores any ImplicitUserConversions that did an
13253         internal implicit conversion (as the switch statement allows only
13254         one integral conversion to exist).
13255
13256         * class.cs (PartialContainer.Create): rename `name' to
13257         `member_name' for clarity.  Then replace the string calls with a
13258         call to MemberName.GetPartialName, as now using
13259         MemberName.ToString is an error (this is due to the side effects
13260         it had, that were fixed in the past).
13261
13262         This will restore the error reporting on a number of partial class
13263         errors that were missusing this (and getting an exception as a
13264         results, which is now just a plain textual warning, because
13265         yyparse debug output would crash otherwise).
13266
13267 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13268
13269         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13270
13271 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13272
13273         * rootcontext.cs (LookupType): Make sure to cache lookups that
13274         don't give us a negative result. This saves about 5% of corlib
13275         compilation time.
13276
13277 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13278
13279         * report.cs (AbstractMessage.Print): messages are sent to stderr
13280
13281         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13282         non-interface in the list of interfaces (at this point, either
13283         parent was properly set, or a base class is being listed in the
13284         interfaces section).
13285
13286         This flags error 1722, and resolves the crash from bug 69259.
13287
13288 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13289
13290         * statement.cs (Using.EmitExpressionFinally): make this work right
13291         for valuetypes. Fixes 69926.
13292
13293 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13294
13295         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13296         converted to an enum" here, before we try to change the underlying
13297         type.  This code exists, but it is a different code path than the
13298         one used while encoding constants.
13299
13300         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13301         old bug: when converting from the null literal to a pointer,
13302         return an EmptyCast, not the NullLiteral.
13303
13304         This fixes #69921, the recent null_type changes probably made this
13305         bug more prominent.
13306
13307         (ImplicitReferenceConversionExists): In addition, resynchronized
13308         the code here, so it matches the same code in
13309         ImplicitReferenceConversionExists for the `from any class-type S
13310         to any interface-type T'.
13311         
13312
13313 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13314
13315         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13316
13317 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13318
13319         * cs-parser.jay: Use verbosity accordingly. 
13320
13321 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13322
13323         * expression.cs (Unary.ResolveOperator): Do not report warning;
13324         AddressOf reads from variable.
13325         
13326         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13327
13328 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13329
13330         Fix bug #69462
13331
13332         * attribute.cs (Attributable): Removed CheckTargets.
13333         (Attributes.Emit): Explicit attribute targets are tested here.
13334
13335         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13336         not enabled for interfaces.
13337
13338         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13339         (GetAssemblyName): Ouch next bug there.
13340
13341 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13342
13343         * expression.cs: Error 275 added.
13344         
13345 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
13346
13347         Fix bug #69177 (Implemented decimal constant support)
13348
13349         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13350         (BinaryFold): Add DecimalConstant.
13351
13352         * const.cs (Define): Decimal constant 
13353         (is not constant.
13354         (ChangeType): Add decimal type handling.
13355         (LookupConstantValue): Don't set value for decimal type but
13356         emit DecimalConstantAttribute. Needed for constant optimization.
13357
13358         * constant.cs (ToDecimal): New method.
13359         (ConvertToDecimal): New method.
13360         (IntConstant): Implemented ConvertToDecimal.
13361         (DecimalConstant.Emit): Emit optimized version for decimals in
13362         int range.
13363
13364         * expression.cs (ResolveOperator): Changed order of constant
13365         reduction to work correctly with native types which have
13366         overloaded operators.
13367         (ResolveMemberAccess): Extract constant value from attribute
13368         for decimal type.
13369
13370         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13371
13372         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13373         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13374         (ChangeType): Decimal is special.
13375         (TypeToCoreType): Add decimal type.
13376
13377 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13378
13379         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13380         decimal types.
13381
13382 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13383
13384         * class.cs (EventField.ApplyAttributeBuilder): Fix error
13385         test cs1667-5.cs.
13386
13387 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13388
13389         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13390
13391         * pending.cs (PendingImplementation): Grab only interfaces.
13392
13393 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13394
13395         * statement.cs (ForeachHelperMethods): Add location member and
13396         error 202 detection.
13397
13398 2004-11-19  Raja R Harinath  <rharinath@novell.com>
13399
13400         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
13401         automatically handled by executable.make.
13402         (PROGRAM): Make profile-specific.
13403
13404 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
13405
13406         * expression.cs (DoResolveBase): Fixed wrong warning for out
13407         variables.
13408
13409 2004-11-18  Martin Baulig  <martin@ximian.com>
13410
13411         Merged latest changes into gmcs.  Please keep this comment in
13412         here, it makes it easier for me to see what changed in MCS since
13413         the last time I merged.
13414
13415 2004-11-17  Raja R Harinath  <rharinath@novell.com>
13416
13417         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13418         (TypeHandle.GetMemberCache): New.
13419         (TypeHandle.TypeHandle): Update.
13420         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13421         (TypeManager.LookupParentInterfacesCache):
13422         Rename from LookupInterfaceCache.  Optimize slightly.
13423         (TypeManager.MemberLookup_FindMembers): Update.
13424         * decl.cs (MemberCache.MemberCache): Set Container to null in the
13425         multi-type variant.
13426         (AddCacheContents): Rename from AddHashtable.
13427         * class.cs (TypeContainer.parent_container): Remove.
13428         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13429         (TypeContainer.DoDefineMembers): Don't initialize it.
13430         Update to name changes.
13431         
13432 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
13433
13434         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13435         that factors the code to check access modifiers on override.  
13436
13437         (PropertyBase): Use the code here.
13438
13439         Patch from Lluis S'anchez, fixes bug #69361.
13440
13441 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
13442
13443         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13444         routine that is used to report the use of a captured variable
13445         whose address has been taken.
13446
13447         There are two checks: one when variables are being captured and
13448         the other check is when the address of a variable is taken. 
13449         
13450         (because an anonymous methods might be resolved before *or* after
13451         the address has been taken) and 
13452
13453         * expression.cs (Conditional.DoResolve): Remove the special
13454         casing that Martin added to trueExpr and falseExpr being both
13455         NullLiteral.  We get the right behavior now just by introducing
13456         the null_type into the compiler. 
13457
13458         * convert.cs (ExplicitConversion): Change the code to use
13459         null_type instead of testing `expr is NullLiteral'.
13460         (ImplicitConversionStandard): use null_type too.
13461         (ImplicitReferenceConversionExists): use null_type too.
13462         (ImplicitReferenceConversion): use null_type too.
13463
13464         * literal.cs: The type of `NullLiteral' is now null_type instead
13465         of object_type. 
13466         (Resolve): Set the type here.
13467
13468         * typemanager.cs: Introduce null_type.
13469
13470 2004-11-17  Martin Baulig  <martin@ximian.com>
13471
13472         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13473         direction, like FindMembers() does.  Fixes #69546, testcase is in
13474         test-315.cs.    
13475
13476 2004-11-16  Martin Baulig  <martin@ximian.com>
13477
13478         This is based on a patch from Marek Safar, see bug #69082.
13479         Fixes bugs #63705 and #67130.
13480
13481         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13482         method; create a MemberCache for an interface type and cache the
13483         result.
13484
13485         * decl.cs (IMemberContainer.ParentContainer): Removed.
13486         (IMemberContainer.ParentCache): New property.
13487         (MemberCache.SetupCacheForInterface): Removed.
13488         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13489         to create a cache for an interface's "parent".
13490
13491         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13492         interfaces too.
13493
13494 2004-11-16  Martin Baulig  <martin@ximian.com>
13495
13496         Merged back from gmcs; these changes already went into gmcs a
13497         couple of weeks ago.
13498
13499         * typemanager.cs
13500         (TypeManager.AddUserType): Removed the `ifaces' argument.
13501         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13502         `TypeExpr []'.
13503         (TypeManager.AddUserInterface): Removed.
13504         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13505         `TypeExpr []'.
13506         (TypeManager.GetInterfaces): Likewise.
13507         (TypeManager.GetExplicitInterfaces): Likewise.
13508
13509         * ecore.cs (TypeExpr.GetInterfaces): Removed.
13510
13511         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13512         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13513
13514 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
13515
13516         * statement.cs: Avoid adding bools to a hashtable.
13517
13518 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
13519
13520         * expression.cs (Invocation.OverloadResolve): Flag error if we are
13521         calling an unsafe method from a safe location.
13522
13523 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
13524
13525         Fix #69167
13526         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13527
13528 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * namespace.cs (VerifyUsing): use GetPartialName instead of
13531         ToString. 
13532
13533 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
13534
13535         * statement.cs (Return.Resolve): Fix regression in typo: if
13536         `in_exc', we have to request a NeedReturnLabel, this was a typo
13537         introduced in the anonymous method check-in.  Fixes #69131.
13538
13539         * Indexers were using the ShortName when defining themselves,
13540         causing a regression in the compiler bootstrap when applying the
13541         patch from 2004-11-02 (first part), now they use their full name
13542         and the bug is gone.
13543
13544 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
13545
13546         * driver.cs: Strip the path from the names of embedded resources. Fixes
13547         #68519.
13548
13549 2004-11-04  Raja R Harinath  <rharinath@novell.com>
13550
13551         Fix error message regression: cs0104-2.cs.
13552         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13553         (AliasEntry.Resolve): Update.
13554         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
13555         'silent' flag.
13556         (RootContext.LookupType): Update.
13557
13558 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
13559
13560         * cs-parser.jay: Add support for handling accessor modifiers
13561         * class: Add support port accessor modifiers and error checking,
13562         define PropertyMethod.Define as virtual (not abstract anymore)
13563         * ecore.cs: Add checking for proeprties access with access modifiers
13564         * iterators.cs: Modify Accessor constructor call based in the modified
13565         constructor
13566 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
13567
13568         * expression.cs (StringConcat): Handle being called twice,
13569         as when we have a concat in a field init with more than two
13570         ctors in the class
13571
13572 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
13573
13574         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13575         special case explicit implementations, we should always produce
13576         the .property or .event declaration.
13577         
13578         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13579         since it will not return correct data if people use this
13580         unresolved in the presence of using statements (see test-313).
13581
13582         * class.cs (MethodData.Define): If we are an explicit interface
13583         implementation, set the method name to the full name of the
13584         interface plus the name of the method.  
13585
13586         Notice that using the method.MethodName.GetFullName() does not
13587         work, as it will only contain the name as declared on the source
13588         file (it can be a shorthand in the presence of using statements)
13589         and not the fully qualifed type name, for example:
13590
13591         using System;
13592
13593         class D : ICloneable {
13594                 object ICloneable.Clone ()  {
13595                 }
13596         }
13597
13598         Would produce a method called `ICloneable.Clone' instead of
13599         `System.ICloneable.Clone'.
13600
13601         * namespace.cs (Alias.Resolve): Use GetPartialName.
13602         
13603 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13604
13605         * cs-parser.jay: Add error 1055 report.
13606
13607 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
13608
13609         * assign.cs (Assign.DoResolve): Only do the transform of
13610         assignment into a New if the types are compatible, if not, fall
13611         through and let the implicit code deal with the errors and with
13612         the necessary conversions. 
13613
13614 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13615
13616         * cs-parser.jay: Add error 1031 report.
13617
13618         * cs-tokenizer.cs: Add location for error 1038.
13619
13620 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13621
13622         * cs-parser.jay: Add error 1016 report.
13623
13624 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13625
13626         * cs-parser.jay: Add errors 1575,1611 report.
13627
13628 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13629
13630         * cs-parser.jay: Add error 1001 report.
13631
13632 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13633
13634         Fix #68850
13635         * attribute.cs (GetMarshal): Add method argument for
13636         caller identification.
13637
13638         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13639         agument for GetMarshal and RuntimeMissingSupport.
13640
13641 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13642
13643         * attribute.cs (ExtractSecurityPermissionSet): Removed
13644         TypeManager.code_access_permission_type.
13645
13646         * typemanager.cs: Removed TypeManager.code_access_permission_type.
13647
13648 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
13649
13650         * expression.cs (LocalVariableReference.DoResolveLValue): Check
13651         for obsolete use of a variable here.   Fixes regression on errors
13652         cs0619-25 and cs0619-26.
13653
13654 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
13655
13656         Fix #62358, implemented security attribute encoding.
13657
13658         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13659         Tests permitted SecurityAction for assembly or other types.
13660         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13661         data from SecurityPermissionAttribute to PermisionSet class.
13662
13663         * class.cs (ApplyAttributeBuilder): Added special handling
13664         for System.Security.Permissions.SecurityAttribute based types.
13665
13666         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13667         special handling for System.Security.Permissions.SecurityAttribute
13668         based types.
13669
13670         * enum.cs (ApplyAttributeBuilder): Added special handling
13671         for System.Security.Permissions.SecurityAttribute based types.
13672
13673         * parameter.cs (ApplyAttributeBuilder): Added special handling
13674         for System.Security.Permissions.SecurityAttribute based types.
13675
13676         * rootcontext.cs: Next 2 core types.
13677
13678         * typemanager.cs (TypeManager.security_permission_attr_type):
13679         Built in type for the SecurityPermission Attribute.
13680         (code_access_permission_type): Build in type.
13681
13682 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
13683
13684         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
13685         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
13686         all of this information into
13687         EmitContext.EmitCapturedVariableInstance.
13688         
13689         * codegen.cs (EmitCapturedVariableInstance): move here the
13690         funcionality of emitting an ldarg.0 in the presence of a
13691         remapping.   This centralizes the instance emit code.
13692
13693         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
13694         then emit a load of this: it means that we have reached the
13695         topmost ScopeInfo: the one that contains the pointer to the
13696         instance of the class hosting the anonymous method.
13697
13698         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
13699         captures to the topmost CaptureContext.
13700
13701 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
13702
13703         * expression.cs (LocalVariableReference): Move the knowledge about
13704         the iterators into codegen's EmitCapturedVariableInstance.
13705
13706 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
13707
13708         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
13709         all code paths return a value from an anonymous method (it is the
13710         same as the 161 error, but for anonymous methods).
13711
13712 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
13713
13714         The introduction of anonymous methods in the compiler changed
13715         various ways of doing things in the compiler.  The most
13716         significant one is the hard split between the resolution phase
13717         and the emission phases of the compiler.
13718
13719         For instance, routines that referenced local variables no
13720         longer can safely create temporary variables during the
13721         resolution phase: they must do so from the emission phase,
13722         since the variable might have been "captured", hence access to
13723         it can not be done with the local-variable operations from the runtime.
13724         
13725         * statement.cs 
13726
13727         (Block.Flags): New flag `IsTopLevel' to indicate that this block
13728         is a toplevel block.
13729
13730         (ToplevelBlock): A new kind of Block, these are the blocks that
13731         are created by the parser for all toplevel method bodies.  These
13732         include methods, accessors and anonymous methods.
13733
13734         These contain some extra information not found in regular blocks:
13735         A pointer to an optional CaptureContext (for tracking captured
13736         local variables and parameters).  A pointer to the parent
13737         ToplevelBlock.
13738         
13739         (Return.Resolve): Catch missmatches when returning a value from an
13740         anonymous method (error 1662).
13741         Invoke NeedReturnLabel from the Resolve phase instead of the emit
13742         phase.
13743
13744         (Break.Resolve): ditto.
13745
13746         (SwitchLabel): instead of defining the labels during the
13747         resolution phase, we now turned the public ILLabel and ILLabelCode
13748         labels into methods called GetILLabelCode() and GetILLabel() that
13749         only define the label during the Emit phase.
13750
13751         (GotoCase): Track the SwitchLabel instead of the computed label
13752         (its contained therein).  Emit the code by using
13753         SwitchLabel.GetILLabelCode ().
13754
13755         (LocalInfo.Flags.Captured): A new flag has been introduce to track
13756         whether the Local has been captured or not.
13757
13758         (LocalInfo.IsCaptured): New property, used to tell whether the
13759         local has been captured.
13760         
13761         * anonymous.cs: Vastly updated to contain the anonymous method
13762         support.
13763
13764         The main classes here are: CaptureContext which tracks any
13765         captured information for a toplevel block and ScopeInfo used to
13766         track the activation frames for various local variables.   
13767
13768         Each toplevel block has an optional capture context associated
13769         with it.  When a method contains an anonymous method both the
13770         toplevel method and the anonymous method will create a capture
13771         context.   When variables or parameters are captured, they are
13772         recorded on the CaptureContext that owns them, for example:
13773
13774         void Demo () {
13775              int a;
13776              MyDelegate d = delegate {
13777                  a = 1;
13778              }
13779         }
13780
13781         Here `a' will be recorded as captured on the toplevel
13782         CapturedContext, the inner captured context will not have anything
13783         (it will only have data if local variables or parameters from it
13784         are captured in a nested anonymous method.
13785
13786         The ScopeInfo is used to track the activation frames for local
13787         variables, for example:
13788
13789         for (int i = 0; i < 10; i++)
13790                 for (int j = 0; j < 10; j++){
13791                    MyDelegate d = delegate {
13792                         call (i, j);
13793                    }
13794                 }
13795
13796         At runtime this captures a single captured variable `i', but it
13797         captures 10 different versions of the variable `j'.  The variable
13798         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
13799         recorded on a child.  
13800
13801         The toplevel ScopeInfo will also track information like the `this'
13802         pointer if instance variables were referenced (this is necessary
13803         as the anonymous method lives inside a nested class in the host
13804         type of the method). 
13805
13806         (AnonymousMethod): Expanded to track the Toplevel, implement
13807         `AnonymousMethod.Compatible' to tell whether an anonymous method
13808         can be converted to a target delegate type. 
13809
13810         The routine now also produces the anonymous method content
13811
13812         (AnonymousDelegate): A helper class that derives from
13813         DelegateCreation, this is used to generate the code necessary to
13814         produce the delegate for the anonymous method that was created. 
13815
13816         * assign.cs: API adjustments for new changes in
13817         Convert.ImplicitStandardConversionExists.
13818
13819         * class.cs: Adjustments to cope with the fact that now toplevel
13820         blocks are of type `ToplevelBlock'. 
13821
13822         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
13823         insteda of standard blocks.
13824
13825         Flag errors if params arguments are passed to anonymous methods.
13826
13827         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
13828         `CurrentAnonymousMethod' which points to the current Anonymous
13829         Method.  The variable points to the AnonymousMethod class that
13830         holds the code being compiled.  It is set in the new EmitContext
13831         created for the anonymous method.
13832
13833         (EmitContext.Phase): Introduce a variable and an enumeration to
13834         assist in enforcing some rules about when and where we are allowed
13835         to invoke certain methods (EmitContext.NeedsReturnLabel is the
13836         only one that enfonces this right now).
13837
13838         (EmitContext.HaveCaptureInfo): new helper method that returns
13839         whether we have a CapturedContext initialized.
13840
13841         (EmitContext.CaptureVariable): New method used to register that a
13842         LocalInfo must be flagged for capturing. 
13843
13844         (EmitContext.CapturedParameter): New method used to register that a
13845         parameters must be flagged for capturing. 
13846         
13847         (EmitContext.CapturedField): New method used to register that a
13848         field must be flagged for capturing. 
13849
13850         (EmitContext.HaveCapturedVariables,
13851         EmitContext.HaveCapturedFields): Return whether there are captured
13852         variables or fields. 
13853
13854         (EmitContext.EmitMethodHostInstance): This is used to emit the
13855         instance for the anonymous method.  The instance might be null
13856         (static methods), this (for anonymous methods that capture nothing
13857         and happen to live side-by-side with the current method body) or a
13858         more complicated expression if the method has a CaptureContext.
13859
13860         (EmitContext.EmitTopBlock): Routine that drives the emission of
13861         code: it will first resolve the top block, then emit any metadata
13862         and then emit the code.  The split is done so that we can extract
13863         any anonymous methods and flag any captured variables/parameters.
13864         
13865         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
13866         during this phase, the ILGenerator should not be used as labels
13867         and local variables declared here might not be accessible to any
13868         code that is part of an anonymous method.  
13869
13870         Exceptions to this include the temporary variables that are
13871         created by some statements internally for holding temporary
13872         variables. 
13873         
13874         (EmitContext.EmitMeta): New routine, in charge of emitting all the
13875         metadata for a cb
13876
13877         (EmitContext.TemporaryReturn): This method is typically called
13878         from the Emit phase, and its the only place where we allow the
13879         ReturnLabel to be defined other than the EmitMeta.  The reason is
13880         that otherwise we would have to duplicate a lot of logic in the
13881         Resolve phases of various methods that today is on the Emit
13882         phase. 
13883
13884         (EmitContext.NeedReturnLabel): This no longer creates the label,
13885         as the ILGenerator is not valid during the resolve phase.
13886
13887         (EmitContext.EmitThis): Extended the knowledge in this class to
13888         work in anonymous methods in addition to iterators. 
13889
13890         (EmitContext.EmitCapturedVariableInstance): This emits whatever
13891         code is necessary on the stack to access the instance to a local
13892         variable (the variable will be accessed as a field).
13893
13894         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
13895         EmitContext.EmitAddressOfParameter): Routines to support
13896         parameters (not completed at this point). 
13897         
13898         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
13899         will also remove the parameters.
13900
13901         * convert.cs (Convert): Define a `ConstantEC' which points to a
13902         null.  This is just to prefity some code that uses
13903         ImplicitStandardConversion code and do not have an EmitContext
13904         handy.
13905
13906         The idea is to flag explicitly that at that point in time, it is
13907         known that the conversion will not trigger the delegate checking
13908         code in implicit conversions (which requires a valid
13909         EmitContext). 
13910
13911         Everywhere: pass new EmitContext parameter since
13912         ImplicitStandardConversionExists now requires it to check for
13913         anonymous method conversions. 
13914
13915         (Convert.ImplicitStandardConversionExists): If the type of an
13916         expression is the anonymous_method_type, and the type is a
13917         delegate, we invoke the AnonymousMethod.Compatible method to check
13918         whether an implicit conversion is possible. 
13919
13920         (Convert.ImplicitConversionStandard): Only do implicit method
13921         group conversions if the language level is not ISO_1.
13922
13923         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
13924         MethodInfo for the Invoke method.  used by Delegate and
13925         AnonymousDelegate.
13926
13927         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
13928         method conversions if the target type is a delegate.
13929
13930         Removed extra debugging nops.
13931
13932         (LocalVariableReference): Turn the `local_info' into a public
13933         field. 
13934
13935         Add `prepared' field, the same hack used for FieldExprs to cope
13936         with composed assignments, as Local variables do not necessarily
13937         operate purely on the stack as they used to: they can be captured
13938         fields. 
13939
13940         Add `temp' for a temporary result, like fields.
13941
13942         Refactor DoResolve and DoResolveLValue into DoResolveBase.
13943
13944         It now copes with Local variables that are captured and emits the
13945         proper instance variable to load it from a field in the captured
13946         case. 
13947
13948         (ParameterReference.DoResolveBase): During the resolve phase,
13949         capture parameters if we are in an anonymous method.
13950
13951         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
13952         anonymous method, use the EmitContext helper routines to emit the
13953         parameter reference.
13954
13955         * iterators.cs: Set RemapToProxy to true/false during the
13956         EmitDispose class.
13957
13958         * parameters.cs (GetParameterByName): New helper method. 
13959
13960         * typemanager.cs (anonymous_method_type) a new type that
13961         represents an anonyous method.  This is always an internal type,
13962         used as a fencepost to test against the anonymous-methodness of an
13963         expression. 
13964         
13965 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
13966
13967         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
13968         561 report.
13969         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
13970
13971 2004-10-18  Martin Baulig  <martin@ximian.com>
13972
13973         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
13974         `Type' directly, but call ResolveType() on it.
13975         (Catch.Resolve): Likewise.
13976         (Foreach.Resolve): Likewise.
13977
13978 2004-10-18  Martin Baulig  <martin@ximian.com>
13979
13980         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
13981         `Type' directly, but call ResolveType() on it.
13982         (Probe.DoResolve): Likewise.
13983         (ArrayCreation.LookupType): Likewise.
13984         (TypeOf.DoResolve): Likewise.
13985         (SizeOf.DoResolve): Likewise.
13986
13987 2004-10-18  Martin Baulig  <martin@ximian.com>
13988
13989         * expression.cs (Invocation.BetterFunction): Put back
13990         TypeManager.TypeToCoreType().
13991
13992 2004-10-18  Raja R Harinath  <rharinath@novell.com>
13993
13994         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
13995         the ResolveType.
13996
13997 2004-10-18  Martin Baulig  <martin@ximian.com>
13998
13999         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14000         `Type' directly, but call ResolveType() on it.
14001
14002 2004-10-18  Martin Baulig  <martin@ximian.com>
14003
14004         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14005         `Type' directly, but call ResolveType() on it.
14006         (MemberBase.DoDefine): Likewise.
14007
14008         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14009         `Type' directly, but call ResolveType() on it.
14010         (ComposedCast.DoResolveAsTypeStep): Likewise.
14011
14012         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14013         `Type' directly, but call ResolveType() on it.
14014
14015 2004-10-17  John Luke  <john.luke@gmail.com>
14016
14017         * class.cs (Operator.GetSignatureForError): use CSharpName
14018
14019         * parameter.cs (Parameter.GetSignatureForError): Returns
14020         correct name even if was not defined.
14021
14022 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14023
14024         Fix #65816.
14025         * class.cs (TypeContainer.EmitContext): New property.
14026         (DefineNestedTypes): Create an emitcontext for each part.
14027         (MethodCore.DoDefineParameters): Use container's emitcontext.
14028         Pass type array to InternalParameters.
14029         (MemberBase.DoDefine): Use container's emitcontext.
14030         (FieldMember.Define): Likewise.
14031         (Event.Define): Likewise.
14032         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14033         Pass type array to InternalParameters.
14034         (SetIndexerMethod.GetParameterInfo): Likewise.
14035         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14036         * delegate.cs (Define): Pass emitcontext to
14037         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14038         array to InternalParameters.
14039         * expression.cs (ParameterReference.DoResolveBase): Pass
14040         emitcontext to GetParameterInfo.
14041         (ComposedCast.DoResolveAsTypeStep): Remove check on
14042         ec.ResolvingTypeTree.
14043         * parameter.cs (Parameter.Resolve): Change argument to
14044         EmitContext.  Use ResolveAsTypeTerminal.
14045         (Parameter.GetSignature): Change argument to EmitContext.
14046         (Parameters.ComputeSignature): Likewise.
14047         (Parameters.ComputeParameterTypes): Likewise.
14048         (Parameters.GetParameterInfo): Likewise.
14049         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14050         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14051         * support.cs (InternalParameters..ctor): Remove variant that takes
14052         a DeclSpace.
14053         * typemanager.cs (system_intptr_expr): New.
14054         (InitExpressionTypes): Initialize it.
14055
14056 2004-10-12  Chris Toshok  <toshok@ximian.com>
14057
14058         * cs-parser.jay: fix location for try_statement and catch_clause.
14059
14060 2004-10-11  Martin Baulig  <martin@ximian.com>
14061
14062         * report.cs: Don't make --fatal abort on warnings, we have
14063         -warnaserror for that.
14064
14065 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14066
14067         More DeclSpace.ResolveType avoidance.
14068         * decl.cs (MemberCore.InUnsafe): New property.
14069         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14070         with newly created EmitContext.
14071         (FieldMember.Define): Likewise.
14072         * delegate.cs (Delegate.Define): Likewise.
14073         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14074         only if normal name-lookup fails.
14075         (TypeExpr.DoResolve): Enable error-checking.
14076         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14077         (SizeOf.DoResolve): Likewise.
14078         (ComposedCast.DoResolveAsTypeStep): Likewise.
14079         (StackAlloc.DoResolve): Likewise.
14080         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14081         (Block.Unsafe): New property.
14082         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14083         (Unsafe): Set 'unsafe' flag of contained block.
14084         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14085         (Fixed.Resolve): Likewise.
14086         (Catch.Resolve): Likewise.
14087         (Using.ResolveLocalVariableDecls): Likewise.
14088         (Foreach.Resolve): Likewise.
14089
14090 2004-10-05  John Luke <john.luke@gmail.com>
14091
14092         * cs-parser.jay: add location to error CS0175
14093
14094 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14095
14096         * ecore.cs (Expression.Constantity): Add support for turning null
14097         into a constant.
14098
14099         * const.cs (Const.Define): Allow constants to be reference types
14100         as long as the value is Null.
14101
14102 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14103
14104         * namespace.cs (NamespaceEntry.Using): No matter which warning
14105         level is set, check if this namespace name has already been added.
14106
14107 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14108
14109         * expression.cs: reftype [!=]= null should always use br[true,false].
14110         # 67410
14111
14112 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14113
14114         Fix #67108
14115         * attribute.cs: Enum conversion moved to 
14116         GetAttributeArgumentExpression to be applied to the all
14117         expressions.
14118
14119 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14120
14121         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14122         * class.c (TypeContainer.DefineType): Flag error if
14123         base types aren't accessible due to access permissions.
14124         * decl.cs (DeclSpace.ResolveType): Move logic to
14125         Expression.ResolveAsTypeTerminal.
14126         (DeclSpace.ResolveTypeExpr): Thin layer over
14127         Expression.ResolveAsTypeTerminal.
14128         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14129         Refactor code into NestedAccess.  Use it.
14130         (DeclSpace.NestedAccess): New.
14131         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14132         argument to silence errors.  Check access permissions.
14133         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14134         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14135         (Cast.DoResolve): Likewise.
14136         (New.DoResolve): Likewise.
14137         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14138         (TypeOf.DoResolve): Likewise.
14139
14140         * expression.cs (Invocation.BetterConversion): Return the Type of
14141         the better conversion.  Implement section 14.4.2.3 more faithfully.
14142         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14143         section 14.4.2.2 explicit.
14144         (Invocation.OverloadResolve): Update.
14145         (Invocation): Remove is_base field.
14146         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14147         (Invocation.Emit): Likewise.
14148
14149 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14150
14151         * README: Update to changes.
14152
14153 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14154
14155         * cs-parser.jay: Reverted 642 warning fix.
14156
14157 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14158
14159         Fix bug #66615
14160         * decl.cs (FindMemberWithSameName): Indexer can have more than
14161         1 argument.
14162
14163 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14164
14165         * expression.cs (LocalVariableReference.DoResolveLValue):
14166         Do not report warning 219 for out values.
14167         (EmptyExpression.Null): New member to avoid extra allocations.
14168
14169 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14170
14171         * cs-parser.jay: Fix wrong warning 642 report.
14172
14173         * cs-tokenizer.cs (CheckNextToken): New helper;
14174         Inspect next character if is same as expected.
14175
14176 2004-09-23  Martin Baulig  <martin@ximian.com>
14177
14178         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14179         (Convert.ImplicitReferenceConversionExists): Likewise.
14180
14181 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14182
14183         * class.cs (Operator.Define): Add error 448 and 559 report.
14184
14185 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14186
14187         * class.cs (MemberBase.IsTypePermitted): New protected
14188         method for checking error CS0610.
14189
14190 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14191
14192         * class.cs (TypeContainer.HasExplicitLayout): New property
14193         Returns whether container has StructLayout attribute set Explicit.
14194         (FieldMember): New abstract class for consts and fields.
14195         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14196         (Field): Reuse FieldMember.
14197
14198         * const.cs (Const): Reuse FieldMember.
14199
14200         * rootcontext.cs: EmitConstants call moved to class.
14201
14202 2004-09-22  Martin Baulig  <martin@ximian.com>
14203
14204         Thanks to Peter Sestoft for this bug report.
14205
14206         * expression.cs (Conditional): If both the `trueExpr' and the
14207         `falseExpr' is a NullLiteral, return a NullLiteral.
14208
14209 2004-09-22  Martin Baulig  <martin@ximian.com>
14210
14211         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14212         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14213         for the "get_Current" call.
14214
14215 2004-09-22  Martin Baulig  <martin@ximian.com>
14216
14217         Marek and me just fixed one of our oldest bugs: #28562 :-)
14218
14219         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14220
14221         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14222         we're an EnumConstant, just return that.
14223         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14224         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14225         to get the value which'll actually be written into the attribute.
14226         However, we have to use GetValue() to access the attribute's value
14227         in the compiler.        
14228
14229 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14230
14231         * constant.cs (Constant.IsNegative): New abstract property
14232         IsNegative.
14233
14234         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14235         (StackAlloc.DoResolve): Reused IsNegative.
14236
14237 2004-09-21  Martin Baulig  <martin@ximian.com>
14238
14239         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14240         if we're used in an iterator, we may be called from different
14241         methods.
14242
14243         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14244         we actually have an exception block.
14245
14246 2004-09-20  John Luke <jluke@cfl.rr.com>
14247
14248         * class.cs, cs-parser.jay: Improve the error report for 1520:
14249         report the actual line where the error happens, not where the
14250         class was declared.
14251
14252         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14253         Pass location information that was available elsewhere.
14254
14255 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14256
14257         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14258         runtime to delay sign assemblies.
14259
14260 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14261
14262         * cs-parser.jay: Do not report the stack trace, this is barely
14263         used nowadays.
14264
14265 2004-08-22  John Luke  <john.luke@gmail.com>
14266  
14267         * driver.cs : check that a resource id is not already used
14268         before adding it, report CS1508 if it is, bug #63637
14269
14270 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14271
14272         * ecore.cs: Removed dead code.
14273
14274 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14275
14276         * class.cs: Do not report warning CS0067 on the interfaces.
14277
14278 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14279
14280         * cs-parser.jay: Add error 504 report.
14281
14282 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14283
14284         * rootcontext.cs: WarningLevel is 4 by default now.
14285
14286         * statement.cs (Fixed.Resolve): Do not null
14287         VariableInfo.
14288
14289 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14290
14291         Fixed bug #55780
14292         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14293         deep search when property is not virtual.
14294         (PropertyExpr.ResolveAccessors): Make one call for both
14295         accessors.
14296
14297 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14298
14299         Fixed bug #65766
14300         * statement.cs: Error 152 report constains also location.
14301
14302 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14303
14304         Fixed bug #65766
14305         * const.cs: Explicitly set constant as static.
14306
14307 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14308
14309         Fixed bug #64226
14310         * cs-parser.jay: Add error 1017 report.
14311
14312 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14313
14314         Fixed bug #59980, #64224
14315         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14316
14317         * typemanager.cs (IsSpecialMethod): Simplified
14318
14319 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14320
14321         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14322         condition with better params.
14323
14324 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14325
14326         Fixed bug #65238
14327         * attribute.cs (Resolve): Property has to have both
14328         accessors.
14329
14330 2004-09-14  Martin Baulig  <martin@ximian.com>
14331
14332         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14333
14334 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14335
14336         Fixed bug #61902
14337         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14338         called and is obsolete then this member suppress message
14339         when call is inside next [Obsolete] method or type.
14340
14341         * expression.cs: Use TestObsoleteMethodUsage member.
14342
14343 2004-09-14  Martin Baulig  <martin@ximian.com>
14344
14345         * cs-parser.jay: Sync a bit with the GMCS version.
14346
14347 2004-09-14  Martin Baulig  <martin@ximian.com>
14348
14349         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14350         (CSharpParser.yacc_verbose_flag): New public field.
14351
14352         * genericparser.cs: Removed.
14353
14354 2004-09-14  Raja R Harinath  <rharinath@novell.com>
14355
14356         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14357
14358 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
14359
14360         * class.cs (MethodCore.CheckBase): Fix bug #65757.
14361
14362 2004-09-10  Martin Baulig  <martin@ximian.com>
14363
14364         Backported my MemberName changes from GMCS into MCS.
14365
14366         - we are now using a special `MemberName' class instead of using
14367         strings; in GMCS, the `MemberName' also contains the type
14368         arguments.
14369
14370         - changed the grammar rules a bit:
14371           * the old `member_name' is now a `namespace_or_type_name':
14372             The rule is that we use `namespace_or_type_name' everywhere
14373             where we expect either a "member name" (GetEnumerator) or a
14374             "member name" with an explicit interface name
14375             (IEnumerable.GetEnumerator).
14376             In GMCS, the explicit interface name may include type arguments
14377             (IEnumerable<T>.GetEnumerator).
14378           * we use `member_name' instead of just `IDENTIFIER' for
14379             "member names":
14380             The rule is that we use `member_name' wherever a member may
14381             have type parameters in GMCS.       
14382
14383         * decl.cs (MemberName): New public class.
14384         (MemberCore.MemberName): New public readonly field.
14385         (MemberCore.ctor): Take a `MemberName' argument, not a string.
14386         (DeclSpace): Likewise.
14387
14388         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14389         * enum.cs (Enum.ctor): Likewise.
14390
14391         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14392         MemberName.     
14393         (AliasEntry.ctor): Take a MemberName, not an Expression.
14394         (AliasEntry.UsingAlias): Likewise.
14395
14396         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14397         (IMethodData.MemberName): Changed type from string to MemberName.
14398         (MemberBase.ExplicitInterfaceName): Likewise.
14399         (AbstractPropertyEventMethod.SetupName): Make this private.
14400         (AbstractPropertyEventMethod.ctor): Added `string prefix'
14401         argument; compute the member name here.
14402         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14403         on the `member.MemberName' and the `prefix'.
14404
14405         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14406         not `type_name'.
14407         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14408         thus, we get a `MemberName' instead of a `string'.  These
14409         declarations may have type parameters in GMCS.
14410         (interface_method_declaration, delegate_declaration): Likewise.
14411         (class_declaration, interface_declaration): Likewise.
14412         (method_header): Use `namespace_or_type_name' instead of
14413         `member_name'.  We may be an explicit interface implementation.
14414         (property_declaration, event_declaration): Likewise.
14415         (member_name): This is now just an `IDENTIFIER', not a
14416         `namespace_or_type_name'.
14417         (type_name, interface_type): Removed.
14418         (namespace_or_type_name): Return a MemberName, not an Expression.
14419         (primary_expression): Use `member_name' instead of `IDENTIFIER';
14420         call GetTypeExpression() on the MemberName to get an expression.
14421         (IndexerDeclaration.interface_type): Changed type from string to
14422         MemberName.
14423         (MakeName): Operate on MemberName's instead of string's.
14424
14425 2004-09-13  Raja R Harinath  <rharinath@novell.com>
14426
14427         Fix bug #55770.
14428         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14429         (NamespaceEntry.Lookup): Add new argument to flag if we want the
14430         lookup to avoid symbols introduced by 'using'.
14431         * rootcontext.cs (NamespaceLookup): Update.
14432
14433 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14434
14435         * class.cs (TypeContainer.DoDefineMembers): Do not call
14436         DefineDefaultConstructor for static classes.
14437
14438 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14439
14440         * attribute.cs (Attribute.Resolve): Add error 653 report.
14441
14442         * class.cs (Class.ApplyAttributeBuilder): Add error 641
14443         report.
14444         (Method.ApplyAttributeBuilder): Add error 685 report.
14445         (Operator.Define): Add error 564 report.
14446
14447         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14448
14449         * expression.cs (Invocation.DoResolve): Add error
14450         245 and 250 report.
14451
14452         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14453         error 674 report.
14454
14455 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14456
14457         * class.cs (ConstructorInitializer.Resolve):
14458         Wrong error number (515->516).
14459
14460 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14461
14462         * class.cs (Indexer.Define): Add error 631 report.
14463
14464 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14465
14466         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14467
14468 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14469
14470         * expression.cs (Probe.DoResolve): Add error CS0241 report.
14471
14472 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
14473
14474         * cs-parser.jay: Added error CS0241 report.
14475
14476 2004-09-10  Raja R Harinath  <rharinath@novell.com>
14477
14478         * cs-parser.jay (fixed_statement): Introduce a scope for the
14479         declaration in the 'fixed' statement.
14480
14481 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14482
14483         * cs-parser.jay: Added CS0230 error report.
14484
14485 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14486
14487         * cs-parser.jay: Added errors CS0231 and CS0257 report.
14488
14489 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14490
14491         * expression.cs (Argument.Resolve): Added error CS0192 and
14492         CS0199 report.
14493
14494 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14495
14496         C# 2.0 #pragma warning feature
14497
14498         * cs-tokenizer.cs (PreProcessPragma): New method; 
14499         Handles #pragma directive.
14500
14501         * report.cs (WarningRegions): New class; Support
14502         class for #pragma warning directive. It tests whether
14503         warning is enabled for a given line.
14504
14505 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
14506
14507         * const.cs: Add more descriptive error report, tahnks to
14508         Sebastien. 
14509
14510 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
14511
14512         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14513
14514 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
14515
14516         * expression.cs: Apply patch from Ben: Remove dead code from
14517         ArrayCreation, and remove the TurnintoConstant call in const.cs,
14518         as that code just threw an exception anwyays.
14519
14520         * const.cs: Remove the call to the turnintoconstant, for details
14521         see bug: #63144
14522         
14523         * literal.cs: The type of the null-literal is the null type;  So
14524         we use a placeholder type (literal.cs:System.Null, defined here)
14525         for it.
14526
14527         * expression.cs (Conditional.DoResolve): Remove some old code that
14528         is no longer needed, conversions have been fixed.
14529
14530         (ArrayCreationExpression.DoResolve): Return false if we fail to
14531         resolve the inner expression.
14532
14533 2004-09-07  Raja R Harinath  <rharinath@novell.com>
14534
14535         Fix test-290.cs.
14536         * cs-parser.jay (delegate_declaration): Record a delegate
14537         declaration as a type declaration.
14538         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14539
14540 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * parameter.cs: Do not crash if the type can not be resolved. 
14543
14544         * expression.cs: Report errors with unsafe pointers, fixes #64896
14545
14546 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14547
14548         * expression.cs: Pointer arith always needs to do a conv.i
14549         if the operand is a long. fix 65320
14550
14551 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14552
14553         Fixed cs0619-37.cs, cs0619-38.cs
14554
14555         * enum.cs (GetObsoleteAttribute): Removed.
14556
14557         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14558         on Enum member is double staged. The first is tested member
14559         and then enum.
14560
14561 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14562
14563         Fixed #56986, #63631, #65231
14564
14565         * class.cs: (TypeContainer.AddToMemberContainer): New method,
14566         adds member to name container.
14567         (TypeContainer.AddToTypeContainer): New method, adds type to
14568         name container.
14569         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14570         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14571         AddOperator): Simplified by reusing AddToMemberContainer.
14572         (TypeContainer.UserDefinedStaticConstructor): Changed to property
14573         instead of field.
14574         (Method.CheckForDuplications): Fixed implementation to test all
14575         possibilities.
14576         (MemberBase): Detection whether member is explicit interface
14577         implementation is now in constructor.
14578         (MemberBase.UpdateMemberName): Handles IndexerName.
14579         (Accessor): Changed to keep also location information.
14580         (AbstractPropertyEventMethod): Is derived from MemberCore.
14581         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14582         will be emited or not.
14583         (PropertyBase.AreAccessorsDuplicateImplementation):
14584         Tests whether accessors are not in collision with some method.
14585         (Operator): Is derived from MethodCore to simplify common
14586         operations.
14587
14588         * decl.cs (Flags.TestMethodDuplication): Test for duplication
14589         must be performed.
14590         (DeclSpace.AddToContainer): Adds the member to defined_names
14591         table. It tests for duplications and enclosing name conflicts.
14592
14593         * enum.cs (EnumMember): Clean up to reuse the base structures
14594
14595 2004-09-03  Martin Baulig  <martin@ximian.com>
14596
14597         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14598         into TypeContainer, to make partial classes work again.
14599
14600 2004-09-03  Martin Baulig  <martin@ximian.com>
14601
14602         * rootcontext.cs (RootContext.V2): Removed.
14603
14604 2004-03-23  Martin Baulig  <martin@ximian.com>
14605
14606         * expression.cs (Invocation.OverloadResolve): Added `bool
14607         may_fail' argument and use it instead of the Location.IsNull() hack.
14608
14609 2004-09-03  Martin Baulig  <martin@ximian.com>
14610
14611         Merged latest changes into gmcs.  Please keep this comment in
14612         here, it makes it easier for me to see what changed in MCS since
14613         the last time I merged.
14614
14615 2004-09-03  Raja R Harinath  <rharinath@novell.com>
14616
14617         Fix #61128.
14618         * expression.cs (BetterConversion): Don't allow either conversion 
14619         to be null.  Remove redundant implicit conversion test when 'q ==
14620         null' -- when this function is invoked, we already know that the
14621         implicit conversion exists.
14622         (BetterFunction): Assume that 'best' is non-null.  Remove
14623         redundant reimplementation of IsApplicable when 'best' is null.
14624         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14625         number of arguments.
14626         (IsAncestralType): Extract from OverloadResolve.
14627         (OverloadResolve): Make robust to the MethodGroupExpr being
14628         unsorted.  Implement all the logic of Section 14.5.5.1, and
14629         support overloading of methods from multiple applicable types.
14630         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
14631
14632         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14633         (RealError, Warning): Append type of report to related symbol.
14634
14635 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
14636
14637         * enum.cs: Fixed CLS-Compliance checks for enum members.
14638         Error tests cs3008-8.cs, cs3014-8.cs
14639
14640 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14641
14642         Fixed bug #62342, #63102
14643         * class.cs: ImplementIndexer uses member.IsExplicitImpl
14644         like ImplementMethod.
14645
14646 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14647
14648         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14649         Fixed bug #65170.
14650
14651 2004-09-02  Martin Baulig  <martin@ximian.com>
14652
14653         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14654         TypeManager.GetArgumentTypes() rather than calling GetParameters()
14655         on the MethodBase.
14656
14657 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
14658
14659         C# 2.0 Static classes implemented
14660
14661         * class.cs (TypeContainer): instance_constructors,
14662         initialized_fields, initialized_static_fields,
14663         default_constructor, base_inteface_types are protected to be
14664         accessible from StaticClass.
14665         (TypeContainer.DefineDefaultConstructor): New virtual method
14666         for custom default constructor generating
14667         (StaticClass): New class to handle "Static classes" feature.
14668
14669         * cs-parser.jay: Handle static keyword on class like instance
14670         of StaticClass.
14671
14672         * driver.cs: Added "/langversion" command line switch with two
14673         options (iso-1, default).
14674
14675 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
14676
14677         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14678
14679 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
14680
14681         * delegate.cs: Style.
14682
14683 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14684
14685         * delegate.cs: Add seperate instance expr field for miguel.
14686
14687 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14688
14689         * PointerArithmetic (Resolve): make sure we are not doing
14690         pointer arith on void*. Also, make sure we are resolved
14691         by not setting eclass until resolve.
14692
14693         All callers: Make sure that PointerArithmetic gets resolved.
14694
14695 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14696
14697         * ArrayCreation (LookupType): If the type does not resolve 
14698         to an array, give an error.
14699
14700 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
14701
14702         * statement.cs (Try.Resolve): Fixed bug #64222
14703
14704 2004-08-27  Martin Baulig  <martin@ximian.com>
14705
14706         * class.cs
14707         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
14708         crash here.     
14709
14710 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
14711
14712         * ecore.cs (Constantify): Get underlying type via
14713         System.Enum.GetUnderlyingType to avoid StackOverflow on the
14714         Windows in special cases.
14715
14716 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
14717
14718         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
14719         for obtaining also private methods.
14720         (GetRemoveMethod): Used GetRemoveMethod (true)
14721         for obtaining also private methods.
14722
14723 2004-08-24  Martin Baulig  <martin@ximian.com>
14724
14725         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
14726         MethodAttributes.HideBySig for operators.
14727
14728 2004-08-23  Martin Baulig  <martin@ximian.com>
14729
14730         Back to the old error reporting system :-)
14731
14732         * report.cs (Message): Removed.
14733         (Report.MessageData, ErrorData, WarningData): Removed.
14734         (Report.Error, Warning): Back to the old system.
14735
14736 2004-08-23  Martin Baulig  <martin@ximian.com>
14737
14738         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
14739
14740         * class.cs (TypeContainer.ParentContainer): New public virtual
14741         method; replaces the explicit interface implementation.
14742         (ClassPart.ParentContainer): Override.
14743
14744 2004-08-23  Martin Baulig  <martin@ximian.com>
14745
14746         * statement.cs (Switch): Added support for constant switches; see
14747         #59428 or test-285.cs.
14748
14749 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
14750
14751         Fixed bug #62740.
14752         * statement.cs (GetEnumeratorFilter): Removed useless
14753         logic because C# specs is strict. GetEnumerator must be
14754         public.
14755
14756 2004-08-22  Martin Baulig  <martin@ximian.com>
14757
14758         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14759         a switch and may break, reset the barrier.  Fixes #59867.
14760
14761 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
14762
14763         CLS-Compliance speed up (~5% for corlib)
14764
14765         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
14766         New method. Tests container for CLS-Compliant names
14767
14768         * class.cs (TypeContainer.VerifyClsName): New method.
14769         Checks whether container name is CLS Compliant.
14770         (Constructor): Implements IMethodData.
14771
14772         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
14773         low-case table for CLS Compliance test.
14774         (MemberCache.VerifyClsParameterConflict): New method.
14775         Checks method parameters for CS3006 error.
14776
14777         * enum.cs (EnumMember): Is derived from MemberCore.
14778         (Enum.VerifyClsName): Optimized for better performance.
14779
14780 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
14781
14782         * report.cs: Renamed Error_T to Error and changed all
14783         references.
14784
14785 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
14786
14787         * class.cs (TypeContainer.IndexerArrayList): New inner class
14788         container for indexers.
14789         (TypeContainer.DefaultIndexerName): New constant for default
14790         indexer name. Replaced all "Item" with this constant.
14791         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
14792
14793         * typemanager.cs (TypeManager.default_member_ctor): Cache here
14794         DefaultMemberAttribute constructor.
14795
14796 2004-08-05  Martin Baulig  <martin@ximian.com>
14797
14798         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14799         Fix bug #59429.
14800
14801 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
14802
14803         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
14804         multi platforms problem.
14805
14806         * compiler.csproj: Included shared files.
14807
14808 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14809
14810         Fix bug 60333, 55971 in the more general way
14811         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14812         Added arg_type argument for constant conversion.
14813         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
14814
14815 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14816
14817         Fix bug #59760
14818         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
14819         OperatorArrayList, MethodCoreArrayList for typecontainer
14820         containers. Changed class member types to these new types.
14821         (MethodArrayList.DefineMembers): Added test for CS0659.
14822
14823 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
14824
14825         * cfold.cs: Synchronize the folding with the code in expression.cs
14826         Binary.DoNumericPromotions for uint operands.
14827
14828         * attribute.cs: Revert patch from Raja, it introduced a regression
14829         while building Blam-1.2.1 (hard to isolate a test case).
14830
14831 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14832
14833         Fix for #55382
14834         * class.cs:
14835         (TypeContainer.Define): Renamed to DefineContainerMembers because of
14836         name collision.
14837         (MethodCore.parent_method): New member. The method we're overriding
14838         if this is an override method.
14839         (MethodCore.CheckBase): Moved from Method class and made common.
14840         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
14841         private.
14842         (MethodCore.CheckForDuplications): New abstract method. For custom
14843         member duplication search in a container
14844         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
14845         method and its return type.
14846         (Event.conflict_symbol): New member. Symbol with same name in the
14847         parent class.
14848
14849         * decl.cs:
14850         (MemberCache.FindMemberWithSameName): New method. The method
14851         is looking for conflict with inherited symbols.
14852
14853 2004-08-04  Martin Baulig  <martin@ximian.com>
14854
14855         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
14856
14857         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
14858
14859 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14860
14861         * report.cs (Message): New enum for better error, warning reference in
14862         the code.
14863         (MessageData): New inner abstract class. It generally handles printing of
14864         error and warning messages.
14865         Removed unused Error, Warning, Message methods.
14866
14867 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14868
14869         Fix for cs0592-8.cs test
14870         * attribute.cs
14871         (Attributable.ValidAttributeTargets): Made public.
14872         (Attribute.ExplicitTarget): New member for explicit target value.
14873         (Attribute.CheckTargets): Now we translate explicit attribute
14874         target to Target here.
14875
14876 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
14877
14878         * ecore.cs (MethodGroupExpr): new IsBase property.
14879
14880         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
14881
14882         * delegate.cs (DelegateCreation): store a MethodGroupExpr
14883         rather than an instance expr.
14884
14885         (DelegateCreation.Emit): Use the method group rather than
14886         the instance expression. Also, if you have base.Foo as the
14887         method for a delegate, make sure to emit ldftn, not ldftnvirt.
14888
14889         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
14890
14891         (NewDelegate.DoResolve): Only check for the existance of Invoke
14892         if the method is going to be needed. Use MethodGroupExpr.
14893
14894         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
14895
14896         * expression.cs: For pointer arith., make sure to use
14897         the size of the type, not the size of the pointer to
14898         the type.
14899
14900 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14901
14902         Fix for #60722
14903         * class.cs (Class): Added error CS0502 test.
14904
14905 2004-08-03  John Luke  <jluke@cfl.rr.com>
14906             Raja R Harinath  <rharinath@novell.com>
14907
14908         Fix for #60997.
14909         * attribute.cs (Attribute.complained_before): New flag.
14910         (Attribute.ResolveType, Attribute.Resolve),
14911         (Attribute.DefinePInvokeMethod): Set it.
14912         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
14913         
14914 2004-08-03  Martin Baulig  <martin@ximian.com>
14915
14916         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
14917         use a user-defined operator; we still need to do numeric
14918         promotions in case one argument is a builtin type and the other
14919         one has an implicit conversion to that type.  Fixes #62322.
14920
14921 2004-08-02  Martin Baulig  <martin@ximian.com>
14922
14923         * statement.cs (LocalInfo.Flags): Added `IsThis'.
14924         (LocalInfo.IsThis): New public property.
14925         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
14926
14927 2004-08-01  Martin Baulig  <martin@ximian.com>
14928
14929         * class.cs (TypeContainer.GetClassBases): Don't set the default
14930         here since we may get called from GetPartialBases().
14931         (TypeContainer.DefineType): If GetClassBases() didn't return a
14932         parent, use the default one.
14933
14934 2004-07-30  Duncan Mak  <duncan@ximian.com>
14935
14936         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
14937
14938 2004-07-30  Martin Baulig  <martin@ximian.com>
14939
14940         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
14941
14942         * class.cs (SourceMethod): New public class, derive from the
14943         symbol writer's ISourceMethod.
14944         (Method): Use the new symbol writer API.
14945
14946         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
14947         as argument and use the new symbol writer.
14948
14949         * location.cs
14950         (SourceFile): Implement the symbol writer's ISourceFile.
14951         (Location.SymbolDocument): Removed.
14952         (Location.SourceFile): New public property.
14953
14954         * symbolwriter.cs: Use the new symbol writer API.
14955
14956 2004-07-30  Raja R Harinath  <rharinath@novell.com>
14957
14958         * Makefile (install-local): Remove.  Functionality moved to
14959         executable.make.
14960
14961 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
14962
14963         * Makefile: Install mcs.exe.config file together with mcs.exe.
14964         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
14965         correct runtime version.
14966         
14967 2004-07-25  Martin Baulig  <martin@ximian.com>
14968
14969         * class.cs
14970         (TypeContainer.RegisterOrder): Removed, this was unused.
14971         (TypeContainer, interface_order): Removed.
14972         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
14973         TypeContainer as argument since we can also be called with a
14974         `PartialContainer' for a partial class/struct/interface.
14975         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
14976         of checking whether we're an `Interface' - we could be a
14977         `PartialContainer'.
14978         (PartialContainer.Register): Override; call
14979         AddClass()/AddStruct()/AddInterface() on our parent.
14980
14981         * cs-parser.jay (interface_member_declaration): Add things to the
14982         `current_container', not the `current_class'.
14983
14984         * rootcontext.cs (RegisterOrder): The overloaded version which
14985         takes an `Interface' was unused, removed.
14986
14987         * typemanager.cs (TypeManager.LookupInterface): Return a
14988         `TypeContainer', not an `Interface'.
14989         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
14990         contain a `PartialContainer' for an interface, so check it's
14991         `Kind' to figure out what it is.
14992
14993 2004-07-25  Martin Baulig  <martin@ximian.com>
14994
14995         * class.cs (Class.DefaultTypeAttributes): New public constant.
14996         (Struct.DefaultTypeAttributes): Likewise.
14997         (Interface.DefaultTypeAttributes): Likewise.
14998         (PartialContainer.TypeAttr): Override this and add the
14999         DefaultTypeAttributes.
15000
15001 2004-07-25  Martin Baulig  <martin@ximian.com>
15002
15003         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15004         we can just use the `Parent' field instead.
15005
15006 2004-07-25  Martin Baulig  <martin@ximian.com>
15007
15008         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15009
15010 2004-07-25  Martin Baulig  <martin@ximian.com>
15011
15012         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15013         our parts before defining any methods.
15014         (TypeContainer.VerifyImplements): Make this virtual.
15015         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15016         on our PartialContainer.
15017
15018 2004-07-25  Martin Baulig  <martin@ximian.com>
15019
15020         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15021
15022         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15023         argument, we can just use the `Parent' field instead.
15024
15025         * class.cs
15026         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15027         (MemberBase.DoDefine): Likewise.
15028
15029 2004-07-24  Martin Baulig  <martin@ximian.com>
15030
15031         * decl.cs (MemberCore.Parent): New public field.
15032         (DeclSpace.Parent): Moved to MemberCore.
15033
15034         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15035         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15036         parent's .ctor.
15037         (FieldBase, Field, Operator): Likewise.
15038         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15039         (EventField, Event): Likewise.
15040
15041 2004-07-23  Martin Baulig  <martin@ximian.com>
15042
15043         * class.cs (PartialContainer): New public class.
15044         (ClassPart): New public class.
15045         (TypeContainer): Added support for partial classes.
15046         (TypeContainer.GetClassBases): Splitted some of the functionality
15047         out into GetNormalBases() and GetPartialBases().
15048
15049         * cs-tokenizer.cs (Token.PARTIAL): New token.
15050         (Tokenizer.consume_identifier): Added some hacks to recognize
15051         `partial', but only if it's immediately followed by `class',
15052         `struct' or `interface'.
15053
15054         * cs-parser.jay: Added support for partial clases.
15055
15056 2004-07-23  Martin Baulig  <martin@ximian.com>
15057
15058         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15059         a `DeclSpace' and also made it readonly.
15060         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15061         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15062         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15063
15064         * cs-parser.jay: Pass the `current_class', not the
15065         `current_container' (at the moment, this is still the same thing)
15066         to a new Method, Property, Event, Indexer or Constructor.
15067
15068 2004-07-23  Martin Baulig  <martin@ximian.com>
15069
15070         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15071         and removed the `current_interface' one.
15072         (struct_declaration, class_declaration, interface_declaration):
15073         Set `current_class' to the newly created class/struct/interface;
15074         set their `Bases' and call Register() before parsing their body.
15075
15076 2004-07-23  Martin Baulig  <martin@ximian.com>
15077
15078         * class.cs (Kind): New public enum.
15079         (TypeContainer): Made this class abstract.
15080         (TypeContainer.Kind): New public readonly field.
15081         (TypeContainer.CheckDef): New public method; moved here from
15082         cs-parser.jay.
15083         (TypeContainer.Register): New public abstract method.
15084         (TypeContainer.GetPendingImplementations): New public abstract
15085         method.
15086         (TypeContainer.GetClassBases): Removed the `is_class' and
15087         `is_iface' parameters.
15088         (TypeContainer.DefineNestedTypes): Formerly known as
15089         DoDefineType().
15090         (ClassOrStruct): Made this class abstract.
15091
15092         * tree.cs (RootTypes): New public type. 
15093
15094 2004-07-20  Martin Baulig  <martin@ximian.com>
15095
15096         * tree.cs (Tree.RecordNamespace): Removed.
15097         (Tree.Namespaces): Removed.
15098
15099         * rootcontext.cs (RootContext.IsNamespace): Removed.
15100
15101         * cs-parser.jay (namespace_declaration): Just create a new
15102         NamespaceEntry here.
15103
15104 2004-07-20  Martin Baulig  <martin@ximian.com>
15105
15106         * statement.cs (ExceptionStatement): New abstract class.  This is
15107         now used as a base class for everyone who's using `finally'.
15108         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15109         our local variables before using them.
15110
15111         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15112         virtual method.  This is used by Yield.Resolve() to "steal" an
15113         outer block's `finally' clauses.
15114         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15115         argument.
15116
15117         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15118         version which takes an ExceptionStatement.  This version must be
15119         used to create exception branchings.
15120
15121         * iterator.cs
15122         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15123         (Iterator.EmitMoveNext): Added exception support; protect the
15124         block with a `fault' clause, properly handle 'finally' clauses.
15125         (Iterator.EmitDispose): Run all the `finally' clauses here.
15126
15127 2004-07-20  Martin Baulig  <martin@ximian.com>
15128
15129         * iterator.cs: This is the first of a set of changes in the
15130         iterator code.  Match the spec more closely: if we're an
15131         IEnumerable, then GetEnumerator() must be called.  The first time
15132         GetEnumerator() is called, it returns the current instance; all
15133         subsequent invocations (if any) must create a copy.
15134
15135 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15136
15137         * expression.cs: Resolve the constant expression before returning
15138         it. 
15139
15140 2004-07-19  Martin Baulig  <martin@ximian.com>
15141
15142         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15143         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15144         the return type of the new EmitContext.
15145
15146 2004-07-18  Martin Baulig  <martin@ximian.com>
15147
15148         * class.cs (Property.Define): Fix iterators.
15149
15150         * iterators.cs (Iterator.Define): Moved the
15151         `container.AddInterator (this)' call here from the .ctor; only do
15152         it if we resolved successfully.
15153
15154 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15155
15156         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15157         `true' for preprocessing directives that we parse.  The return
15158         value indicates whether we should return to regular tokenizing or
15159         not, not whether it was parsed successfully.
15160
15161         In the past if we were in: #if false ... #line #endif, we would
15162         resume parsing after `#line'.  See bug 61604.
15163
15164         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15165         building: IsEnumType should return true only for enums, not for
15166         enums or System.Enum itself.  This fixes #61593.
15167
15168         Likely what happened is that corlib was wrong: mcs depended on
15169         this bug in some places.  The bug got fixed, we had to add the
15170         hack, which caused bug 61593.
15171
15172         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15173         that was a workaround for the older conditions.
15174
15175 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15176
15177         * assign.cs: IAssignMethod has a new interface, as documented
15178         inline. All assignment code now uses this new api.
15179
15180         * ecore.cs, expression.cs: All classes which implement
15181         IAssignMethod now use the new interface.
15182
15183         * expression.cs (Invocation): add a hack to EmitCall so that
15184         IndexerAccess can be the target of a compound assignment without
15185         evaluating its arguments twice.
15186
15187         * statement.cs: Handle changes in Invocation api.
15188
15189 2004-07-16  Martin Baulig  <martin@ximian.com>
15190
15191         * iterators.cs: Rewrote this.  We're now using one single Proxy
15192         class for both the IEnumerable and the IEnumerator interface and
15193         `Iterator' derives from Class so we can use the high-level API.
15194
15195         * class.cs (TypeContainer.AddIterator): New method.
15196         (TypeContainer.DoDefineType): New protected virtual method, which
15197         is called from DefineType().
15198         (TypeContainer.DoDefineMembers): Call DefineType() and
15199         DefineMembers() on all our iterators.
15200         (TypeContainer.Emit): Call Emit() on all our iterators.
15201         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15202
15203         * codegen.cs (EmitContext.CurrentIterator): New public field.
15204
15205 2004-07-15  Martin Baulig  <martin@ximian.com>
15206
15207         * typemanager.cs
15208         (TypeManager.not_supported_exception_type): New type.   
15209
15210 2004-07-14  Martin Baulig  <martin@ximian.com>
15211
15212         * iterators.cs: Use real error numbers.
15213
15214 2004-07-14  Martin Baulig  <martin@ximian.com>
15215
15216         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15217         requires this to be a System.Collection.IEnumerable and not a
15218         class implementing that interface.
15219         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15220
15221 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15222
15223         * class.cs: Fixed previous fix, it broke some error tests.
15224
15225 2004-07-12  Martin Baulig  <martin@ximian.com>
15226
15227         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15228         Fixes #61293.
15229
15230 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * assign.cs (LocalTemporary): Add new argument: is_address,If
15233         `is_address' is true, then the value that we store is the address
15234         to the real value, and not the value itself.
15235         
15236         * ecore.cs (PropertyExpr): use the new local temporary
15237         stuff to allow us to handle X.Y += z (where X is a struct)
15238
15239 2004-07-08  Martin Baulig  <martin@ximian.com>
15240
15241         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15242         not always return, just like we're doing in Using.Resolve().
15243
15244 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15245
15246         * cs-parser.jay (fixed_statement): flag this as Pinned.
15247
15248 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15249
15250         * typemanager.cs (TypeManager): Removed MakePinned method, this
15251         mechanism is replaced with the .NET 2.x compatible mechanism of
15252         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15253
15254         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15255         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15256         `IsFixed' property which has a different meaning.
15257
15258 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15259
15260         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15261         visible from inside a nested class, not just the names of the
15262         immediately enclosing class.
15263         Fix for bug #60730.
15264
15265 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15266
15267         * expression.cs (BetterConversion): Remove buggy special-case
15268         handling of "implicit constant expression conversions".  At this
15269         point, we already know that the conversion is possible -- we're
15270         only checking to see which is better.
15271
15272 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15273
15274         * cs-parser.jay: Added error CS0210 test.
15275
15276 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15277
15278         * cs-parser.jay: Added error CS0134 test.
15279
15280 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15281
15282         Fix bug #52507
15283         * cs-parser.jay: Added error CS0145 test.
15284
15285 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15286
15287         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15288
15289 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15290         
15291         * expression.cs (StackAlloc.Resolve): The argument may not
15292         be a constant; deal with this case.
15293         
15294 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15295
15296         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15297         GetIndexerAttributeValue.
15298         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15299
15300         * class.cs (Indexer.Define): Added error tests for CS0415,
15301         CS0609.
15302
15303 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15304
15305         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15306         property code.
15307
15308 2004-06-23  Martin Baulig  <martin@ximian.com>
15309
15310         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15311         neither return nor throw, reset the barrier as well.  Fixes #60457.
15312
15313 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15314
15315         * class.cs : EventAttributes is now set to None by default.
15316           This fixes bug #60459.
15317
15318 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15319
15320         Fix bug #60219
15321         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15322         Don't throw exception but return null (it's sufficient now).
15323
15324 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15325
15326         * typemanager.cs (GetArgumentTypes): Faster implementation.
15327
15328 2004-06-18  Martin Baulig  <martin@ximian.com>
15329
15330         * attribute.cs (Attribute.Resolve): Check whether we're an
15331         EmptyCast which a Constant child.  Fixes #60333.
15332
15333 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
15334
15335         * statement.cs (EmitCollectionForeach): Account for the fact that
15336         not all valuetypes are in areas which we can take the address of.
15337         For these variables, we store to a temporary variable. Also, make
15338         sure that we dont emit a `callvirt' on a valuetype method.
15339
15340 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15341
15342         * expression.cs (StackAlloc.DoReSolve): Added test for
15343         negative parameter (CS0247).
15344
15345 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15346
15347         Fix bug #59792
15348         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15349
15350 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15351
15352         Fix bug #59781
15353         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15354         ulong.
15355
15356 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15357
15358         Fix bug #58254 & cs1555.cs, cs1556.cs
15359         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15360
15361 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15362
15363         * cs-parser.jay: Added error CS1669 test for indexers.
15364
15365 2004-06-11  Martin Baulig  <martin@ximian.com>
15366
15367         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15368         call this twice: for params and varargs methods.
15369
15370 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15371
15372         * class.cs:
15373         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15374
15375 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15376
15377         * attribute.cs (Attribute.GetValidTargets): Made public.
15378
15379         * class.cs: 
15380         (AbstractPropertyEventMethod): New class for better code sharing.
15381         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15382         CS1667 report.
15383         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15384
15385 2004-06-11  Raja R Harinath  <rharinath@novell.com>
15386
15387         Fix bug #59477.
15388         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15389         that the call to Resolve is part of a MemberAccess.
15390         (Expression.Resolve): Use it for SimpleName resolution.
15391         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15392         Add 'intermediate' boolean argument.
15393         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
15394         error message when the SimpleName can be resolved ambiguously
15395         between an expression and a type.
15396         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15397         public.
15398         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15399         call on the left-side.
15400
15401 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15402
15403         * class.cs:
15404         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15405
15406 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15407
15408         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15409
15410 2004-06-11  Martin Baulig  <martin@ximian.com>
15411
15412         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15413         varargs methods if applicable.
15414
15415 2004-06-11  Martin Baulig  <martin@ximian.com>
15416
15417         * expression.cs (Invocation.EmitCall): Don't use
15418         `method.CallingConvention == CallingConventions.VarArgs' since the
15419         method could also have `CallingConventions.HasThis'.
15420
15421 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15422
15423         * class.cs (Event.GetSignatureForError): Implemented.
15424         Fixed crash in error test cs3010.cs
15425
15426 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
15427
15428         * cs-tokenizer.cs: Change the way we track __arglist to be
15429         consistent with the other keywords.
15430
15431 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
15432
15433         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15434         tomorrow.
15435
15436 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
15437
15438         * codegen.cs: Check that all referenced assemblies have a strongname
15439         before strongnaming the compiled assembly. If not report error CS1577.
15440         Fix bug #56563. Patch by Jackson Harper.
15441         * typemanager.cs: Added a method to return all referenced assemblies.
15442         Fix bug #56563. Patch by Jackson Harper.
15443
15444 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15445
15446         * class.cs:
15447         (Method.ApplyAttributeBuilder): Moved and added conditional
15448         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15449
15450         * delegate.cs:
15451         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15452
15453 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15454
15455         Fixed #59640
15456         * class.cs: (EventField.attribute_targets): Changed default target.
15457
15458 2004-06-08  Martin Baulig  <martin@ximian.com>
15459
15460         * expression.cs (Invocation.EmitCall): Enable varargs methods.
15461
15462 2004-06-08  Martin Baulig  <martin@ximian.com>
15463
15464         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15465
15466 2004-06-07  Martin Baulig  <martin@ximian.com>
15467
15468         Added support for varargs methods.
15469
15470         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15471         keyword.
15472
15473         * cs-parser.jay: Added support for `__arglist'.
15474
15475         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15476
15477         * expression.cs (Argument.AType): Added `ArgList'.
15478         (Invocation): Added support for varargs methods.
15479         (ArglistAccess): New public class.
15480         (Arglist): New public class.
15481
15482         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15483
15484         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
15485         a method's top-level block if the method has varargs.
15486
15487         * support.cs (ReflectionParameters, InternalParameters): Added
15488         support for varargs methods.    
15489
15490 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
15491
15492         * class.cs: Provide location in indexer error report.
15493
15494         * driver.cs: Use standard names.
15495
15496         * namespace.cs: Catch the use of using after a namespace has been
15497         declared also on using aliases.
15498
15499 2004-06-03  Raja R Harinath  <rharinath@novell.com>
15500
15501         Bug #50820.
15502         * typemanager.cs (closure_private_ok, closure_invocation_type)
15503         (closure_qualifier_type, closure_invocation_assembly)
15504         (FilterWithClosure): Move to ...
15505         (Closure): New internal nested class.
15506         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15507         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15508         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15509         (MemberLookup, MemberLookupFailed): Use it.
15510         * expression.cs (New.DoResolve): Treat the lookup for the
15511         constructor as being qualified by the 'new'ed type.
15512         (Indexers.GetIndexersForTypeOrInterface): Update.
15513
15514 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
15515
15516         * attribute.cs
15517         (GetConditionalAttributeValue): New method. Returns
15518         condition of ConditionalAttribute.
15519         (SearchMulti): New method.  Returns all attributes of type 't'.
15520         Use it when attribute is AllowMultiple = true.
15521         (IsConditionalMethodExcluded): New method.
15522
15523         * class.cs
15524         (Method.IsExcluded): Implemented. Returns true if method has conditional
15525         attribute and the conditions is not defined (method is excluded).
15526         (IMethodData): Extended interface for ConditionalAttribute support.
15527         (PropertyMethod.IsExcluded): Implemented.
15528
15529         * decl.cs
15530         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15531
15532         * expression.cs
15533         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15534         on the method.
15535
15536 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15537
15538         * expression.cs (ArrayCreationExpression): Make this just an
15539         `expression'. It can't be a statement, so the code here was
15540         dead.
15541
15542 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15543
15544         Fixed #59072
15545         * typemanager.cs (GetFullNameSignature): New method for
15546         MethodBase types.
15547
15548 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15549
15550         Fixed #56452
15551         * class.cs (MemberBase.GetSignatureForError): New virtual method.
15552         Use this method when MethodBuilder is null.
15553         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15554         Added test for error CS0626 (MONO reports error for this situation).
15555         (IMethodData.GetSignatureForError): Extended interface.
15556
15557 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15558
15559         * attribute.cs
15560         (AttributeTester.GetObsoleteAttribute): Returns instance of
15561         ObsoleteAttribute when type is obsolete.
15562
15563         * class.cs
15564         (TypeContainer.VerifyObsoleteAttribute): Override.
15565         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15566         (MethodCode.VerifyObsoleteAttribute): Override.
15567         (MemberBase.VerifyObsoleteAttribute): Override.
15568
15569         * decl.cs
15570         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15571         and report proper error.
15572
15573         *delegate.cs
15574         Delegate.VerifyObsoleteAttribute): Override.
15575
15576         * ecore.cs
15577         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15578         and report proper error.
15579         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15580
15581         * enum.cs
15582         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15583         and enum member.
15584
15585         * expression.cs
15586         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15587         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15588         Added test for ObsoleteAttribute.
15589
15590         * statement.cs
15591         (Catch): Derived from Statement.
15592
15593 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15594  
15595         Fixed bug #59071 & cs0160.cs
15596  
15597         * statement.cs (Try.Resolve): Check here whether order of catch
15598         clauses matches their dependencies.
15599
15600 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
15601
15602         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
15603         caused a regression: #59343.  Referencing nested classes from an
15604         assembly stopped working.
15605
15606 2004-05-31  Martin Baulig  <martin@ximian.com>
15607
15608         MCS is now frozen for beta 2.
15609
15610 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15611
15612         * convert.cs: add a trivial cache for overload operator resolution.
15613
15614 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15615
15616         * decl.cs: If possible, use lookuptypedirect here. We can only do
15617         this if there is no `.' after the namespace. Avoids using
15618         LookupType, which does lots of slow processing.
15619         (FindNestedType) New method, does what it says :-).
15620         * namespace.cs: use LookupTypeDirect.
15621         * rootcontext.cs: use membercache, if possible.
15622         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15623
15624 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15625
15626         * expression.cs:
15627         According to the spec, 
15628
15629         In a member access of the form E.I, if E is a single identifier,
15630         and if the meaning of E as a simple-name (§7.5.2) is a constant,
15631         field, property, localvariable, or parameter with the same type as
15632         the meaning of E as a type-name (§3.8), then both possible
15633         meanings of E are permitted.
15634
15635         We did not check that E as a simple-name had the same type as E as
15636         a type name.
15637
15638         This trivial check gives us 5-7% on bootstrap time.
15639
15640 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15641
15642         * expression.cs (Invocation.OverloadResolve): Avoid the
15643         use of hashtables and boxing here by allocating on demand.
15644
15645 2004-05-30  Martin Baulig  <martin@ximian.com>
15646
15647         * rootcontext.cs (RootContext.LookupType): Don't cache things if
15648         we're doing a silent lookup.  Don't try to lookup nested types in
15649         TypeManager.object_type (thanks to Ben Maurer).
15650
15651 2004-05-30  Martin Baulig  <martin@ximian.com>
15652
15653         Committing a patch from Ben Maurer.
15654
15655         * rootcontext.cs (RootContext.LookupType): Cache negative results.
15656
15657 2004-05-29  Martin Baulig  <martin@ximian.com>
15658
15659         * class.cs (IMethodData.ShouldIgnore): New method.
15660
15661         * typemanager.cs (TypeManager.MethodFlags): Don't take a
15662         `Location' argument, we don't need it anywhere.  Use
15663         `IMethodData.ShouldIgnore ()' instead of
15664         `MethodData.GetMethodFlags ()'.
15665         (TypeManager.AddMethod): Removed.
15666         (TypeManager.AddMethod2): Renamed to AddMethod.
15667
15668 2004-05-29  Martin Baulig  <martin@ximian.com>
15669
15670         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15671
15672         * convert.cs (Convert.ImplicitReferenceConversion): If we're
15673         converting from a class type S to an interface type and we already
15674         have an object on the stack, don't box it again.  Fixes #52578.
15675
15676 2004-05-29  Martin Baulig  <martin@ximian.com>
15677
15678         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15679         Added support for `params' parameters.  Fixes #59267.
15680
15681 2004-05-29  Martin Baulig  <martin@ximian.com>
15682
15683         * literal.cs (NullPointer): Provide a private .ctor which sets
15684         `type' to TypeManager.object_type.  Fixes #59048.
15685
15686 2004-05-29  Martin Baulig  <martin@ximian.com>
15687
15688         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
15689         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
15690
15691         * ecore.cs (EventExpr.instance_expr): Make the field private.
15692
15693 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
15694
15695         Fixed bug #50080 & cs0214-2.cs
15696         * expression.cs (Cast.DoResolve): Check unsafe context here.
15697         
15698         * statement.cs (Resolve.DoResolve): Likewise.
15699
15700 2004-05-26  Martin Baulig  <martin@ximian.com>
15701
15702         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
15703
15704         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
15705         (RootContext.LookupType): Pass down the `silent' flag.
15706
15707 2004-05-25  Martin Baulig  <martin@ximian.com>
15708
15709         * expression.cs
15710         (MethodGroupExpr.IdenticalTypeName): New public property.
15711         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
15712         expression actually refers to a type.
15713
15714 2004-05-25  Martin Baulig  <martin@ximian.com>
15715
15716         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
15717         for #56176 and made it actually work.
15718
15719 2004-05-25  Martin Baulig  <martin@ximian.com>
15720
15721         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
15722         (FieldExpr, PropertyExpr): Override and implement
15723         CacheTemporaries.  Fixes #52279.
15724
15725 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
15726
15727         * location.cs: In the new compiler listing a file twice is a
15728         warning, not an error.
15729
15730 2004-05-24  Martin Baulig  <martin@ximian.com>
15731
15732         * enum.cs (Enum.DefineType): For the `BaseType' to be a
15733         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
15734
15735 2004-05-24  Martin Baulig  <martin@ximian.com>
15736
15737         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
15738         walking the `using' list.  Fixes #53921.
15739
15740 2004-05-24  Martin Baulig  <martin@ximian.com>
15741
15742         * const.cs (Const.LookupConstantValue): Added support for
15743         EmptyCast's; fixes #55251.
15744
15745 2004-05-24  Martin Baulig  <martin@ximian.com>
15746
15747         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
15748         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
15749         which does the CS0135 check.  The reason is that we first need to
15750         check whether the variable actually exists.
15751
15752 2004-05-24  Martin Baulig  <martin@ximian.com>
15753
15754         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
15755         than RootContext.LookupType() to find the explicit interface
15756         type.  Fixes #58584.
15757
15758 2004-05-24  Raja R Harinath  <rharinath@novell.com>
15759
15760         * Makefile: Simplify.  Use executable.make.
15761         * mcs.exe.sources: New file.  List of sources of mcs.exe.
15762
15763 2004-05-24  Anders Carlsson  <andersca@gnome.org>
15764
15765         * decl.cs:
15766         * enum.cs:
15767         Use the invariant culture when doing String.Compare for CLS case
15768         sensitivity.
15769         
15770 2004-05-23  Martin Baulig  <martin@ximian.com>
15771
15772         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
15773         don't have any dots.  Fixes #52622, added cs0246-8.cs.
15774
15775         * namespace.cs (NamespaceEntry.Lookup): Likewise.
15776         
15777 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
15778
15779         * class.cs (MemberBase.Define): Reuse MemberType member for 
15780         resolved type. Other methods can use it too.
15781
15782 2004-05-23  Martin Baulig  <martin@ximian.com>
15783
15784         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
15785         the variable also exists in the current block (otherwise, we need
15786         to report a CS0103).  Fixes #58670.
15787
15788 2004-05-23  Martin Baulig  <martin@ximian.com>
15789
15790         * flowanalysis.cs (Reachability.Reachable): Compute this
15791         on-the-fly rather than storing it as a field.
15792
15793 2004-05-23  Martin Baulig  <martin@ximian.com>
15794
15795         * flowanalysis.cs (Reachability.And): Manually compute the
15796         resulting `barrier' from the reachability.      
15797        
15798 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
15799
15800         Fix bug #57835
15801         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
15802         instance of ObsoleteAttribute when symbol is obsolete.
15803
15804         * class.cs
15805         (IMethodData): Extended interface for ObsoleteAttribute support.
15806
15807 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
15808
15809         * attribute.cs: Fix bug #55970
15810
15811 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
15812
15813         Fix bug #52705
15814         * attribute.cs
15815         (GetObsoleteAttribute): New method. Creates the instance of
15816         ObsoleteAttribute.
15817         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
15818         ObsoleteAttribute when member is obsolete.
15819         (AttributeTester.Report_ObsoleteMessage): Common method for
15820         Obsolete error/warning reporting.
15821
15822         * class.cs
15823         (TypeContainer.base_classs_type): New member for storing parent type.
15824
15825         * decl.cs
15826         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
15827         for this MemberCore.
15828
15829 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15830
15831         * attribute.cs, const.cs: Fix bug #58590
15832
15833 2004-05-21  Martin Baulig  <martin@ximian.com>
15834
15835         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
15836         out parameters if the end of the method is unreachable.  Fixes
15837         #58098. 
15838
15839 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15840
15841         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
15842         Hari was right, why extra method.
15843
15844 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15845
15846         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
15847
15848 2004-05-20  Martin Baulig  <martin@ximian.com>
15849
15850         Merged this back from gmcs to keep the differences to a minumum.
15851
15852         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
15853         instead of a Declspace.
15854         (Attribute.ResolveType): Likewise.
15855         (Attributes.Search): Likewise.
15856         (Attributes.Contains): Likewise.
15857         (Attributes.GetClsCompliantAttribute): Likewise.
15858
15859         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
15860         argument.
15861         (MethodData.ApplyAttributes): Take an EmitContext instead of a
15862         DeclSpace.
15863
15864 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
15865
15866         Fix bug #58688 (MCS does not report error when the same attribute
15867         is assigned twice)
15868
15869         * attribute.cs (Attribute.Emit): Distinction between null and default.
15870
15871 2004-05-19  Raja R Harinath  <rharinath@novell.com>
15872
15873         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
15874         of a top-level attribute without an attribute target.
15875         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
15876         Make non-static.
15877         (Attribute.Conditional_GetConditionName), 
15878         (Attribute.Obsolete_GetObsoleteMessage): Update.
15879         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
15880         part of ScanForIndexerName.
15881         (Attribute.CanIgnoreInvalidAttribute): New function.
15882         (Attribute.ScanForIndexerName): Move to ...
15883         (Attributes.ScanForIndexerName): ... here.
15884         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
15885         (Attributes.Search): New internal variant that can choose not to
15886         complain if types aren't resolved.  The original signature now
15887         complains.
15888         (Attributes.GetClsCompliantAttribute): Use internal variant, with
15889         complaints suppressed.
15890         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
15891         only if it not useful.
15892         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
15893         top-level for attributes that are shared between the assembly
15894         and a top-level class.
15895         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
15896         * class.cs: Update to reflect changes.
15897         (DefineIndexers): Fuse loops.
15898         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
15899         a couple more variants of attribute names.
15900
15901 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
15902
15903         Fix bug #52585 (Implemented explicit attribute declaration)
15904
15905         * attribute.cs:
15906         (Attributable.ValidAttributeTargets): New abstract method. It gets
15907         list of valid attribute targets for explicit target declaration.
15908         (Attribute.Target): It holds target itself.
15909         (AttributeSection): Removed.
15910         (Attribute.CheckTargets): New method. It checks whether attribute
15911         target is valid for the current element.
15912
15913         * class.cs:
15914         (EventProperty): New class. For events that are declared like
15915         property (with add and remove accessors).
15916         (EventField): New class. For events that are declared like field.
15917         class.cs
15918
15919         * cs-parser.jay: Implemented explicit attribute target declaration.
15920
15921         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
15922         Override ValidAttributeTargets.
15923
15924         * parameter.cs:
15925         (ReturnParameter): Class for applying custom attributes on 
15926         the return type.
15927         (ParameterAtribute): New class. Class for applying custom
15928         attributes on the parameter type.
15929
15930 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
15931
15932         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
15933         definitions. 
15934
15935         (Method): Allow UNSAFE here.
15936
15937         * modifiers.cs: Support unsafe reporting.
15938
15939 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
15940
15941         * decl.cs: Fix bug #58478.
15942
15943 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15944
15945         * statement.cs: When checking for unreachable code on an EmptyStatement,
15946         set the location. Fixes bug #58488.
15947
15948 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
15949
15950         * driver.cs: Add -pkg handling.
15951
15952         From Gonzalo: UseShelLExecute=false
15953
15954 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
15955
15956         * attribute.cs:
15957         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
15958         for attribute.
15959         (Attribute.IsClsCompliaceRequired): Moved to base for better
15960         accesibility.
15961         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
15962         when attribute is AttributeUsageAttribute.
15963         (Attribute.GetValidTargets): Simplified.
15964         (Attribute.GetAttributeUsage): New method returns AttributeUsage
15965         attribute for this type.
15966         (Attribute.ApplyAttributes): Method renamed to Emit and make
15967         non-static.
15968         (GlobalAttributeSection): New class for special handling of global
15969         attributes (assembly, module).
15970         (AttributeSection.Emit): New method.
15971
15972         * class.cs: Implemented Attributable abstract methods.
15973         (MethodCore.LabelParameters): Moved to Parameter class.
15974         (Accessor): Is back simple class.
15975         (PropertyMethod): Implemented Attributable abstract class.
15976         (DelegateMethod): Implemented Attributable abstract class.
15977         (Event): New constructor for disctintion between normal Event
15978         and Event with accessors.
15979
15980         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
15981
15982         * codegen.cs, const.cs, decl.cs, delegate.cs:
15983         (CommonAssemblyModulClass): Implemented Attributable abstract class
15984         and simplified.
15985
15986         * enum.cs: Implement IAttributeSupport interface.
15987         (EnumMember): New class for emum members. Implemented Attributable
15988         abstract class
15989
15990         * parameter.cs:
15991         (ParameterBase): Is abstract.
15992         (ReturnParameter): New class for easier [return:] attribute handling.
15993
15994         * typemanager.cs: Removed builder_to_attr.
15995
15996 2004-05-11  Raja R Harinath  <rharinath@novell.com>
15997
15998         Fix bug #57151.
15999         * attribute.cs (Attribute.GetPositionalValue): New function.
16000         * class.cs (TypeContainer.VerifyMembers): New function.
16001         (TypeContainer.Emit): Use it.
16002         (ClassOrStruct): New base class for Class and Struct.
16003         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16004         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16005         class.
16006         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16007         then each non-static field should have a FieldOffset attribute.
16008         Otherwise, none of the fields should have a FieldOffset attribute.
16009         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16010         and FieldOffset attributes.
16011         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16012         (TypeManager.field_offset_attribute_type): New core types.
16013         (TypeManager.InitCoreTypes): Initialize them.
16014
16015 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16016
16017         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16018         Return correct type.
16019         From bug #58270.
16020
16021 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16022
16023         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16024         be implicitly converted to ulong.
16025         
16026         * expression.cs: The logic for allowing operator &, | and ^ worked
16027         was wrong, it worked before because we did not report an error in
16028         an else branch.  Fixes 57895.
16029
16030         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16031         allow volatile fields to be reference types.
16032
16033 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16034
16035         * driver.cs: Add support for /debug-
16036
16037 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16038
16039         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16040         Add a 'complain' parameter to silence errors.
16041         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16042         silently overlooked type-resolutions.
16043         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16044         to reflect changes.
16045         (Attributes.Search): New function.
16046         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16047         (Attributes.GetAttributeFullName): Remove hack.
16048         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16049         Update to reflect changes.
16050         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16051         Use Attributes.Search instead of nested loops.
16052
16053 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16054
16055         * decl.cs:
16056         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16057         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16058         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16059
16060         * report.cs: (Report.Warning): Renamed to Warning_T because of
16061         parameter collision.
16062
16063 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16064
16065         * expression.cs (MemberAccess.ResolveMemberAccess):
16066         Exit with non-zero status after Report.Error.
16067         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16068         Likewise.
16069         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16070
16071 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16072
16073         * support.cs: Don't hang when the file is empty.
16074
16075 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16076
16077         * support.cs: In SeekableStreamReader, compute the preamble size of the
16078           underlying stream. Position changes should take into account that initial
16079           count of bytes.
16080
16081 2004-05-03  Todd Berman  <tberman@sevenl.net>
16082
16083         * driver.cs: remove unused GetSysVersion function.
16084
16085 2004-05-03  Todd Berman  <tberman@sevenl.net>
16086
16087         * driver.cs: Remove the hack from saturday, as well as the hack
16088         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16089         link_paths to get that bit proper.
16090
16091 2004-05-01  Todd Berman  <tberman@sevenl.net>
16092
16093         * driver.cs: Try a LoadFrom before a Load, this checks the current
16094         path. This is currently a bug in mono that is be fixed, however, this
16095         provides a workaround for now. This will be removed when the bug
16096         is fixed.
16097
16098 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16099
16100         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16101         incomplete key pairs (#57941).
16102
16103 2004-05-01  Todd Berman  <tberman@sevenl.net>
16104
16105         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16106         from the GAC
16107
16108 2004-04-30  Jackson Harper  <jackson@ximian.com>
16109
16110         * codegen.cs: Open keys readonly.
16111         
16112 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16113
16114         * typemanager.cs: don't report cyclic struct layout when a struct
16115         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16116         which has 2 Pango.Rectangle fields.
16117
16118 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16119
16120         * expression.cs: Handle IntPtr comparisons with IL code
16121         rather than a method call.
16122
16123 2004-04-29  Martin Baulig  <martin@ximian.com>
16124
16125         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16126         the list of PropertyInfo's in class hierarchy and find the
16127         accessor.  Fixes #56013.
16128
16129 2004-04-29  Martin Baulig  <martin@ximian.com>
16130
16131         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16132
16133 2004-04-29  Martin Baulig  <martin@ximian.com>
16134
16135         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16136
16137         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16138
16139 2004-04-29  Martin Baulig  <martin@ximian.com>
16140
16141         * class.cs (ConstructorInitializer.Resolve): Check whether the
16142         parent .ctor is accessible.  Fixes #52146.
16143
16144 2004-04-29  Martin Baulig  <martin@ximian.com>
16145
16146         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16147
16148         * statement.cs (Using.EmitLocalVariableDecls): Use
16149         TypeManager.idisposable_type, not typeof (IDisposable).
16150         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16151
16152 2004-04-29  Martin Baulig  <martin@ximian.com>
16153
16154         * class.cs (Event.Define): Don't emit the field and don't set
16155         RTSpecialName and SpecialName for events on interfaces.  Fixes
16156         #57703. 
16157
16158 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16159
16160         Refactor Attribute.ApplyAttributes.
16161         * attribute.cs (Attributable): New base class for objects that can
16162         have Attributes applied on them.
16163         (Attribute): Make AttributeUsage fields public.
16164         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16165         (Attribute.IsInternalCall): New property.
16166         (Attribute.UsageAttr): Convert to a public read-only property.
16167         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16168         (Attribute.ResolveType, Attribute.Resolve)
16169         (Attribute.ScanForIndexerName): Update to reflect changes.
16170         (Attribute.CheckAttributeTarget): Re-format.
16171         (Attribute.ApplyAttributes): Refactor, to various
16172         Attributable.ApplyAttributeBuilder methods.
16173         * decl.cs (MemberCore): Make Attributable.
16174         * class.cs (Accessor): Make Attributable.
16175         (MethodData.ApplyAttributes): Use proper attribute types, not
16176         attribute names.
16177         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16178         (TypeContainer.ApplyAttributeBuilder)
16179         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16180         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16181         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16182         (Operator.ApplyAttributeBuilder): New factored-out methods.
16183         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16184         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16185         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16186         * parameter.cs (ParameterBase): New Attributable base class
16187         that can also represent Return types.
16188         (Parameter): Update to the changes.
16189
16190 2004-04-29  Jackson Harper  <jackson@ximian.com>
16191
16192         * driver.cs: Prefer the corlib system version when looking for
16193         assemblies in the GAC. This is still a hack, but its a better hack
16194         now.
16195         
16196 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16197
16198         * decl.cs, enum.cs: Improved error 3005 reporting.
16199   
16200         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16201         (related_symbols): New private member for list of symbols
16202         related to reported error/warning.
16203         
16204         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16205
16206 2004-04-29  Martin Baulig  <martin@ximian.com>
16207
16208         * ecore.cs (Expression.Constantify): If we're an enum and
16209         TypeManager.TypeToCoreType() doesn't give us another type, use
16210         t.UnderlyingSystemType.  Fixes #56178.  
16211
16212 2004-04-29  Martin Baulig  <martin@ximian.com>
16213
16214         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16215         interfaces and for each interface, only add members directly
16216         declared in that interface.  Fixes #53255.
16217
16218 2004-04-28  Martin Baulig  <martin@ximian.com>
16219
16220         * expression.cs (ConditionalLogicalOperator): Use a temporary
16221         variable for `left' to avoid that we evaluate it more than once;
16222         bug #52588.
16223
16224 2004-04-28  Martin Baulig  <martin@ximian.com>
16225
16226         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16227         `void[]' (CS1547).
16228
16229 2004-04-28  Martin Baulig  <martin@ximian.com>
16230
16231         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16232         void (CS1547).
16233
16234         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16235         whether the type is not void (CS1547).
16236
16237 2004-04-28  Martin Baulig  <martin@ximian.com>
16238
16239         * expression.cs (Unary.DoResolveLValue): Override this and report
16240         CS0131 for anything but Operator.Indirection.
16241
16242 2004-04-28  Martin Baulig  <martin@ximian.com>
16243
16244         Committing a patch from Ben Maurer; see bug #50820.
16245
16246         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16247         check for classes.
16248
16249         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16250         classes.        
16251
16252 2004-04-28  Martin Baulig  <martin@ximian.com>
16253
16254         Committing a patch from Ben Maurer; see bug #50820.
16255
16256         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16257         check for classes.
16258
16259         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16260         classes.        
16261
16262 2004-04-28  Martin Baulig  <martin@ximian.com>
16263
16264         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16265         (Block.AddLabel): Call DoLookupLabel() to only search in the
16266         current block.
16267
16268 2004-04-28  Martin Baulig  <martin@ximian.com>
16269
16270         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16271         comparing StringConstants and NullLiterals in Equality and Inequality.
16272
16273 2004-04-28  Jackson Harper  <jackson@ximian.com>
16274
16275         * driver.cs: Attempt to load referenced assemblies from the
16276         GAC. This is the quick and dirty version of this method that
16277         doesnt take into account versions and just takes the first
16278         canidate found. Will be good enough for now as we will not have more
16279         then one version installed into the GAC until I update this method.
16280
16281 2004-04-28  Martin Baulig  <martin@ximian.com>
16282
16283         * typemanager.cs (TypeManager.CheckStructCycles): New public
16284         static method to check for cycles in the struct layout.
16285
16286         * rootcontext.cs (RootContext.PopulateTypes): Call
16287         TypeManager.CheckStructCycles() for each TypeContainer.
16288         [Note: We only need to visit each type once.]
16289
16290 2004-04-28  Martin Baulig  <martin@ximian.com>
16291
16292         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16293
16294         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16295         success and added `out object value'.  Use a `bool resolved' field
16296         to check whether we've already been called rather than
16297         `ConstantValue != null' since this breaks for NullLiterals.
16298
16299 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16300
16301         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16302         setting of this flag, since the 'set' method may be non-public.
16303
16304 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16305
16306         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16307         check on current_vector.Block.
16308
16309 2004-04-27  Martin Baulig  <martin@ximian.com>
16310
16311         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16312         a field initializer.  Fixes #56459.
16313
16314 2004-04-27  Martin Baulig  <martin@ximian.com>
16315
16316         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16317         we're not attempting to use an indexer.  Fixes #52154.
16318
16319 2004-04-27  Martin Baulig  <martin@ximian.com>
16320
16321         * statement.cs (Return): Don't create a return label if we don't
16322         need it; reverts my change from January 20th.  Thanks to Ben
16323         Maurer for this.
16324
16325 2004-04-27  Martin Baulig  <martin@ximian.com>
16326
16327         According to the spec, `goto' can only leave a nested scope, but
16328         never enter it.
16329
16330         * statement.cs (Block.LookupLabel): Only lookup in the current
16331         block, don't recurse into parent or child blocks.
16332         (Block.AddLabel): Check in parent and child blocks, report
16333         CS0140/CS0158 if we find a duplicate.
16334         (Block): Removed this indexer for label lookups.
16335         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16336         this already does the error reporting for us.
16337
16338         * flowanalysis.cs
16339         (FlowBranching.UsageVector.Block): New public variable; may be null.
16340         (FlowBranching.CreateSibling): Added `Block' argument.
16341         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
16342         label for the target of a `goto' and check whether we're not
16343         leaving a `finally'.
16344
16345 2004-04-27  Martin Baulig  <martin@ximian.com>
16346
16347         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16348         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16349         just for returns).
16350
16351 2004-04-27  Martin Baulig  <martin@ximian.com>
16352
16353         * statement.cs (Block.AddLabel): Also check for implicit blocks
16354         and added a CS0158 check.
16355
16356 2004-04-27  Martin Baulig  <martin@ximian.com>
16357
16358         * flowanalysis.cs (FlowBranchingLoop): New class.
16359         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16360         UsageVector's instead of an ArrayList.
16361         (FlowBranching.Label): Likewise.
16362         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16363         (FlowBranching.AddBreakVector): New method.
16364
16365 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
16366
16367         * attribute.cs: Small regression fix: only convert the type if we
16368         the type is different, fixes System.Drawing build.
16369
16370 2004-04-27  Martin Baulig  <martin@ximian.com>
16371
16372         * attribute.cs (Attribute.Resolve): If we have a constant value
16373         for a named field or property, implicity convert it to the correct
16374         type.
16375
16376 2004-04-27  Raja R Harinath  <rharinath@novell.com>
16377
16378         * statement.cs (Block.Block): Implicit blocks share
16379         'child_variable_names' fields with parent blocks.
16380         (Block.AddChildVariableNames): Remove.
16381         (Block.AddVariable): Mark variable as "used by a child block" in
16382         every surrounding block.
16383         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16384         been used in a child block, complain about violation of "Invariant
16385         meaning in blocks" rule.
16386         * cs-parser.jay (declare_local_variables): Don't use
16387         AddChildVariableNames.
16388         (foreach_statement): Don't create an implicit block: 'foreach'
16389         introduces a scope.
16390
16391 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
16392
16393         * convert.cs (ImplicitNumericConversion): 0 is also positive when
16394         converting from 0L to ulong.  Fixes 57522.
16395
16396 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16397
16398         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16399         derived class hides via 'new' keyword field from base class (test-242.cs).
16400         TODO: Handle this in the more general way.
16401         
16402         * class.cs (CheckBase): Ditto.
16403
16404 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16405
16406         * decl.cs (caching_flags): New member for storing cached values
16407         as bit flags.
16408         (MemberCore.Flags): New enum where bit flags for caching_flags
16409         are defined.
16410         (MemberCore.cls_compliance): Moved to caching_flags.
16411         (DeclSpace.Created): Moved to caching_flags.
16412
16413         * class.cs: Use caching_flags instead of DeclSpace.Created
16414         
16415 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
16416
16417         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16418         if we are only a derived class, not a nested class.
16419
16420         * typemanager.cs: Same as above, but do this at the MemberLookup
16421         level (used by field and methods, properties are handled in
16422         PropertyExpr).   Allow for the qualified access if we are a nested
16423         method. 
16424
16425 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
16426
16427         * class.cs: Refactoring.
16428         (IMethodData): New inteface; Holds links to parent members
16429         to avoid member duplication (reduced memory allocation).
16430         (Method): Implemented IMethodData interface.
16431         (PropertyBase): New inner classes for get/set methods.
16432         (PropertyBase.PropertyMethod): Implemented IMethodData interface
16433         (Event): New inner classes for add/remove methods.
16434         (Event.DelegateMethod): Implemented IMethodData interface.
16435
16436         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16437         EmitContext (related to class.cs refactoring).
16438
16439 2004-04-21  Raja R Harinath  <rharinath@novell.com>
16440
16441         * delegate.cs (Delegate.VerifyApplicability): If the number of
16442         arguments are the same as the number of parameters, first try to
16443         verify applicability ignoring  any 'params' modifier on the last
16444         parameter.
16445         Fixes #56442.
16446
16447 2004-04-16  Raja R Harinath  <rharinath@novell.com>
16448
16449         * class.cs (TypeContainer.AddIndexer): Use
16450         'ExplicitInterfaceName' to determine if interface name was
16451         explicitly specified.  'InterfaceType' is not initialized at this time.
16452         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
16453         Indexers array is already in the required order.  Initialize
16454         'IndexerName' only if there are normal indexers.
16455         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16456         (TypeContainer.Emit): Emit DefaultMember attribute only if
16457         IndexerName is initialized.
16458         Fixes #56300.
16459
16460 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
16461
16462         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16463         Fixes #57007
16464
16465 2004-04-15  Raja R Harinath  <rharinath@novell.com>
16466
16467         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16468         attributes.
16469         Fix for #56456.
16470
16471         * attribute.cs (Attribute.Resolve): Check for duplicate named
16472         attributes.
16473         Fix for #56463.
16474
16475 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * iterators.cs (MarkYield): track whether we are in an exception,
16478         and generate code accordingly.  Use a temporary value to store the
16479         result for our state.
16480
16481         I had ignored a bit the interaction of try/catch with iterators
16482         since their behavior was not entirely obvious, but now it is
16483         possible to verify that our behavior is the same as MS .NET 2.0
16484
16485         Fixes 54814
16486
16487 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * iterators.cs: Avoid creating temporaries if there is no work to
16490         do. 
16491
16492         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16493         Enumerations, use TypeManager.EnumToUnderlying and call
16494         recursively. 
16495
16496         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16497         bug #57013
16498
16499         (This.Emit): Use EmitContext.EmitThis to emit our
16500         instance variable.
16501
16502         (This.EmitAssign): Ditto.
16503
16504         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16505         codepaths, we will move all the functionality into
16506         Mono.CSharp.This 
16507
16508         (FieldExpr.EmitAssign): Ditto.
16509
16510         This fixes several hidden bugs that I uncovered while doing a code
16511         review of this today.
16512
16513         * codegen.cs (EmitThis): reworked so the semantics are more clear
16514         and also support value types "this" instances.
16515
16516         * iterators.cs: Changed so that for iterators in value types, we
16517         do not pass the value type as a parameter.  
16518
16519         Initialization of the enumerator helpers is now done in the caller
16520         instead of passing the parameters to the constructors and having
16521         the constructor set the fields.
16522
16523         The fields have now `assembly' visibility instead of private.
16524
16525 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * expression.cs (Argument.Resolve): Check if fields passed as ref
16528         or out are contained in a MarshalByRefObject.
16529
16530         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16531         another compiler type.
16532
16533 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16534
16535         * class.cs (Indexer.Define): use the new name checking method.
16536         Also, return false on an error.
16537         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16538         (is_identifier_[start/part]_character): make static.
16539
16540 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * expression.cs (Binary.ResolveOperator): Do no append strings
16543         twice: since we can be invoked more than once (array evaluation)
16544         on the same concatenation, take care of this here.  Based on a fix
16545         from Ben (bug #56454)
16546
16547 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
16548
16549         * codegen.cs: Fix another case where CS1548 must be reported (when 
16550         delay-sign isn't specified and no private is available #56564). Fix
16551         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
16552         error when MCS is used on the MS runtime and we need to delay-sign 
16553         (which seems unsupported by AssemblyBuilder - see #56621).
16554
16555 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
16556
16557         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16558         (TypeManager.ComputeNamespaces): Faster implementation for
16559         Microsoft runtime.
16560
16561         * compiler.csproj: Updated AssemblyName to mcs.
16562
16563 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
16564
16565         * rootcontext.cs: Add new types to the boot resolution.
16566
16567         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16568         MulticastDelegate is not allowed.
16569
16570         * typemanager.cs: Add new types to lookup: System.TypedReference
16571         and ArgIterator.
16572
16573         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16574         check for TypedReference or ArgIterator, they are not allowed. 
16575
16576         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16577         makes us properly catch 1510 in some conditions (see bug 56016 for
16578         details). 
16579
16580 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
16581
16582         * CryptoConvert.cs: update from corlib version
16583         with endian fixes.
16584
16585 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
16586
16587         * class.cs (Indexer.Define): Check indexername declaration
16588
16589 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
16590
16591         * attribute.cs (IsClsCompliant): Fixed problem with handling
16592         all three states (compliant, not-compliant, undetected).
16593
16594 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
16595
16596         * attribute.cs (Attribute): Location is now public.
16597         (Resolve): Store resolved arguments (pos_values) in attribute class.
16598         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16599         (GetClsCompliantAttributeValue): New method that gets
16600         CLSCompliantAttribute value.
16601         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16602         if exists else null.
16603         (AttributeTester): New class for CLS-Compliant verification routines.
16604
16605         * class.cs (Emit): Add CLS-Compliant verification.
16606         (Method.GetSignatureForError): Implemented.
16607         (Constructor.GetSignatureForError): Implemented
16608         (Constructor.HasCompliantArgs): Returns if constructor has
16609         CLS-Compliant arguments.
16610         (Constructor.Emit): Override.
16611         (Construcor.IsIdentifierClsCompliant): New method; For constructors
16612         is needed to test only parameters.
16613         (FieldBase.GetSignatureForError): Implemented.
16614         (TypeContainer): New member for storing base interfaces.
16615         (TypeContainer.FindMembers): Search in base interfaces too.
16616
16617         * codegen.cs (GetClsComplianceAttribute): New method that gets
16618         assembly or module CLSCompliantAttribute value.
16619         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16620         for assembly.
16621         (ModuleClass.Emit): Add error 3012 test.
16622
16623         * const.cs (Emit): Override and call base for CLS-Compliant tests.
16624
16625         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16626         state for all decl types.
16627         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16628         if CLS-Compliant tests are required.
16629         (IsClsCompliaceRequired): New method. Analyze whether code
16630         must be CLS-Compliant.
16631         (IsExposedFromAssembly): New method. Returns true when MemberCore
16632         is exposed from assembly.
16633         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16634         value or gets cached value.
16635         (HasClsCompliantAttribute): New method. Returns true if MemberCore
16636         is explicitly marked with CLSCompliantAttribute.
16637         (IsIdentifierClsCompliant): New abstract method. This method is
16638         used to testing error 3005.
16639         (IsIdentifierAndParamClsCompliant): New method. Common helper method
16640         for identifier and parameters CLS-Compliant testing.
16641         (VerifyClsCompliance): New method. The main virtual method for
16642         CLS-Compliant verifications.
16643         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16644         null. I don't know why is null (too many public members !).
16645         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16646         and get value of first CLSCompliantAttribute that found.
16647
16648         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16649         (VerifyClsCompliance): Override and add extra tests.
16650
16651         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16652         clscheck- disable CLS-Compliant verification event if assembly is has
16653         CLSCompliantAttribute(true).
16654
16655         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16656         ApllyAttribute is now called in emit section as in the other cases.
16657         Possible future Emit integration.
16658         (IsIdentifierClsCompliant): New override.
16659         (VerifyClsCompliance): New override.
16660         (GetEnumeratorName): Returns full enum name.
16661
16662         * parameter.cs (GetSignatureForError): Implemented.
16663
16664         * report.cs (WarningData): New struct for Warning message information.
16665         (LocationOfPreviousError): New method.
16666         (Warning): New method. Reports warning based on the warning table.
16667         (Error_T): New method. Reports error based on the error table.
16668
16669         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16670         verifications are done here.
16671
16672         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16673
16674         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16675         CLSCompliantAttribute.
16676         (all_imported_types): New member holds all imported types from other
16677         assemblies.
16678         (LoadAllImportedTypes): New method fills static table with exported types
16679         from all referenced assemblies.
16680         (Modules): New property returns all assembly modules.
16681
16682 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
16683
16684         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
16685         throwing a parser error.
16686
16687         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
16688         which removes the hardcoded get_/set_ prefixes for properties, as
16689         IL allows for the properties to be named something else.  
16690
16691         Bug #56013
16692
16693         * expression.cs: Do not override operand before we know if it is
16694         non-null.  Fix 56207
16695
16696 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16697
16698         * typemanager.cs: support for pinned variables.
16699
16700 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16701
16702         * decl.cs, typemanager.cs: Avoid using an arraylist
16703         as a buffer if there is only one result set.
16704
16705 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16706
16707         * expression.cs: Make sure you cant call a static method
16708         with an instance expression, bug #56174.
16709
16710 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
16711
16712         * class.cs (IsDuplicateImplementation): Improve error reporting to
16713         flag 663 (method only differs in parameter modifier).
16714
16715         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
16716         in preprocessor directives.
16717
16718         * location.cs (LookupFile): Allow for the empty path.
16719
16720         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
16721         better approach for some of that patch, but its failing with the
16722         CharSet enumeration.  For now try/catch will do.
16723
16724         * typemanager.cs: Do not crash if a struct does not have fields.
16725         Fixes 56150.
16726
16727 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16728
16729         * expression.cs: cs0213, cant fix a fixed expression.
16730         fixes 50231.
16731
16732 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16733
16734         * cs-parser.jay: detect invalid embeded statements gracefully.
16735         bug #51113.
16736
16737 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16738
16739         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
16740         As a regex:
16741         s/
16742         the invocation type may not be a subclass of the tye of the item/
16743         The type of the item must be a subclass of the invocation item.
16744         /g
16745
16746         Fixes bug #50820.
16747
16748 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
16749
16750         * attribute.cs: Added methods to get a string and a bool from an
16751         attribute. Required to information from AssemblyKeyFileAttribute,
16752         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
16753         * codegen.cs: Modified AssemblyName creation to include support for
16754         strongnames. Catch additional exceptions to report them as CS1548.
16755         * compiler.csproj: Updated include CryptoConvert.cs.
16756         * compiler.csproj.user: Removed file - user specific configuration.
16757         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
16758         Mono.Security assembly. The original class is maintained and tested in
16759         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
16760         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
16761         like CSC 8.0 (C# v2) supports.
16762         * Makefile: Added CryptoConvert.cs to mcs sources.
16763         * rootcontext.cs: Added new options for strongnames.
16764
16765 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
16766
16767         * driver.cs: For --expect-error, report error code `2'
16768         if the program compiled with no errors, error code `1' if
16769         it compiled with an error other than the one expected.
16770
16771 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
16772
16773         * compiler.csproj: Updated for Visual Studio .NET 2003.
16774         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
16775         * compiler.sln: Updated for Visual Studio .NET 2003.
16776
16777 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
16778
16779         * expression.cs: Fix bug #47234. We basically need to apply the
16780         rule that we prefer the conversion of null to a reference type
16781         when faced with a conversion to 'object' (csc behaviour).
16782
16783 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16784
16785         * statement.cs: Shorter form for foreach, eliminates
16786         a local variable. r=Martin.
16787
16788 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16789
16790         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
16791         checks if we can use brtrue/brfalse to test for 0.
16792         * expression.cs: use the above in the test for using brtrue/brfalse.
16793         cleanup code a bit.
16794
16795 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16796
16797         * expression.cs: Rewrite string concat stuff. Benefits:
16798
16799         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
16800         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
16801         rather than a concat chain.
16802
16803         * typemanager.cs: Add lookups for more concat overloads.
16804
16805 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16806
16807         * expression.cs: Emit shorter il code for array init.
16808
16809         newarr
16810         dup
16811         // set 1
16812
16813         // set 2
16814
16815         newarr
16816         stloc.x
16817
16818         ldloc.x
16819         // set 1
16820
16821         ldloc.x
16822         // set 2
16823
16824 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
16825
16826         * statement.cs: Before, two switch blocks would be merged if the
16827         total size of the blocks (end_item - begin_item + 1) was less than
16828         two times the combined sizes of the blocks.
16829
16830         Now, it will only merge if after the merge at least half of the
16831         slots are filled.
16832
16833         fixes 55885.
16834
16835 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
16836
16837         * class.cs : csc build fix for GetMethods(). See bug #52503.
16838
16839 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
16840
16841         * expression.cs: Make sure fp comparisons work with NaN.
16842         This fixes bug #54303. Mig approved this patch a long
16843         time ago, but we were not able to test b/c the runtime
16844         had a related bug.
16845
16846 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
16847
16848         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
16849
16850 2004-03-19  Martin Baulig  <martin@ximian.com>
16851
16852         * class.cs (MemberCore.IsDuplicateImplementation): Report the
16853         error here and not in our caller.
16854
16855 2004-03-19  Martin Baulig  <martin@ximian.com>
16856
16857         * interface.cs: Completely killed this file.
16858         (Interface): We're now a TypeContainer and live in class.cs.
16859
16860         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
16861         argument; we're now also called for interfaces.
16862         (TypeContainer.DefineMembers): Allow this method being called
16863         multiple times.
16864         (TypeContainer.GetMethods): New public method; formerly known as
16865         Interface.GetMethod().  This is used by PendingImplementation.
16866         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
16867         it's now private and non-static.
16868         (Interface): Moved this here; it's now implemented similar to
16869         Class and Struct.
16870         (Method, Property, Event, Indexer): Added `bool is_interface'
16871         argument to their .ctor's.
16872         (MemberBase.IsInterface): New public field.
16873
16874         * cs-parser.jay: Create normal Method, Property, Event, Indexer
16875         instances instead of InterfaceMethod, InterfaceProperty, etc.
16876         (opt_interface_base): Removed; we now use `opt_class_base' instead.
16877         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
16878
16879 2004-03-19  Martin Baulig  <martin@ximian.com>
16880
16881         * class.cs (MethodCore.IsDuplicateImplementation): New private
16882         method which does the CS0111 checking.
16883         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
16884         Use IsDuplicateImplementation().
16885
16886 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
16887
16888         * decl.cs (FindMemberToOverride): New method to find the correct
16889         method or property to override in the base class.
16890         * class.cs
16891             - Make Method/Property use the above method to find the
16892               version in the base class.
16893             - Remove the InheritableMemberSignatureCompare as it is now
16894               dead code.
16895
16896         This patch makes large code bases much faster to compile, as it is
16897         O(n) rather than O(n^2) to do this validation.
16898
16899         Also, it fixes bug 52458 which is that nested classes are not
16900         taken into account when finding the base class member.
16901
16902         Reviewed/Approved by Martin.
16903
16904 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
16905
16906         * interface.cs: In all interface classes removed redundant
16907         member initialization.
16908
16909 2004-03-16  Martin Baulig  <martin@ximian.com>
16910
16911         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
16912
16913 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
16914
16915         * decl.cs (DefineTypeAndParents): New helper method to define a
16916         type's containers before the type itself is defined;  This is a
16917         bug exposed by the recent changes to Windows.Forms when an
16918         implemented interface was defined inside a class that had not been
16919         built yet.   
16920
16921         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
16922
16923         (Check): Loop correctly to report errors modifiers
16924         (UNSAFE was not in the loop, since it was the same as TOP).
16925
16926         * interface.cs: Every interface member now takes a ModFlags,
16927         instead of a "is_new" bool, which we set on the base MemberCore. 
16928
16929         Every place where we called "UnsafeOk" in the interface, now we
16930         call the proper member (InterfaceMethod.UnsafeOK) instead to get
16931         the unsafe settings from the member declaration instead of the
16932         container interface. 
16933
16934         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
16935
16936         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
16937         `set_indexer_name' to the pending bits (one per type).
16938
16939         We fixed a bug today that was picking the wrong method to
16940         override, since for properties the existing InterfaceMethod code
16941         basically ignored the method name.  Now we make sure that the
16942         method name is one of the valid indexer names.
16943
16944 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
16945  
16946         * support.cs (SeekableStreamReader): Keep track of stream byte
16947         positions and don't mix them with character offsets to the buffer.
16948
16949         Patch from Gustavo Giráldez
16950
16951 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
16952
16953         * interface.cs (InterfaceSetGetBase): Removed double member
16954         initialization, base class does it as well.
16955
16956 2004-03-13  Martin Baulig  <martin@ximian.com>
16957
16958         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
16959         when compiling corlib.
16960
16961 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
16962
16963         * convert.cs (ExplicitConversion): We were reporting an error on
16964         certain conversions (object_type source to a value type, when the
16965         expression was `null') before we had a chance to pass it through
16966         the user defined conversions.
16967
16968         * driver.cs: Replace / and \ in resource specifications to dots.
16969         Fixes 50752
16970
16971         * class.cs: Add check for duplicate operators.  Fixes 52477
16972
16973 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
16974
16975         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
16976         that are in the middle of the statements, not only at the end.
16977         Fixes #54987
16978
16979         * class.cs (TypeContainer.AddField): No longer set the
16980         `HaveStaticConstructor' flag, now we call it
16981         `UserDefineStaticConstructor' to diferentiate the slightly
16982         semantic difference.
16983
16984         The situation is that we were not adding BeforeFieldInit (from
16985         Modifiers.TypeAttr) to classes that could have it.
16986         BeforeFieldInit should be set to classes that have no static
16987         constructor. 
16988
16989         See:
16990
16991         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
16992
16993         And most importantly Zoltan's comment:
16994
16995         http://bugzilla.ximian.com/show_bug.cgi?id=44229
16996
16997         "I think beforefieldinit means 'it's ok to initialize the type sometime 
16998          before its static fields are used', i.e. initialization does not need
16999          to be triggered by the first access to the type. Setting this flag
17000          helps the JIT to compile better code, since it can run the static
17001          constructor at JIT time, and does not need to generate code to call it
17002          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17003          this flag for lots of classes like String. 
17004          
17005          csc sets this flag if the type does not have an explicit static 
17006          constructor. The reasoning seems to be that if there are only static
17007          initalizers for a type, and no static constructor, then the programmer
17008          does not care when this initialization happens, so beforefieldinit
17009          can be used.
17010          
17011          This bug prevents the AOT compiler from being usable, since it 
17012          generates so many calls to mono_runtime_class_init that the AOT code
17013          is much slower than the JITted code. The JITted code is faster, 
17014          because it does not generate these calls if the vtable is type is
17015          already initialized, which is true in the majority of cases. But the
17016          AOT compiler can't do this."
17017
17018 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17019
17020         * class.cs (MethodData.Emit): Refactor the code so symbolic
17021         information is generated for destructors;  For some reasons we
17022         were taking a code path that did not generate symbolic information
17023         before. 
17024
17025 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17026
17027         * class.cs: Create a Constructor.CheckBase method that
17028         takes care of all validation type code. The method
17029         contains some code that was moved from Define.
17030
17031         It also includes new code that checks for duplicate ctors.
17032         This fixes bug #55148.
17033
17034 2004-03-09  Joshua Tauberer <tauberer@for.net>
17035
17036         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17037         a { ... }-style array creation invokes EmitStaticInitializers
17038         which is not good for reference-type arrays.  String, decimal
17039         and now null constants (NullCast) are not counted toward
17040         static initializers.
17041
17042 2004-03-05  Martin Baulig  <martin@ximian.com>
17043
17044         * location.cs (SourceFile.HasLineDirective): New public field;
17045         specifies whether the file contains or is referenced by a "#line"
17046         directive.
17047         (Location.DefineSymbolDocuments): Ignore source files which
17048         either contain or are referenced by a "#line" directive.        
17049
17050 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17051
17052         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17053         direct access to our parent, so check the method inline there.
17054
17055 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17056
17057         * expression.cs (Invocation.EmitCall): Miguel's last commit
17058         caused a regression. If you had:
17059
17060             T t = null;
17061             t.Foo ();
17062
17063         In Foo the implict this would be null.
17064
17065 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17066
17067         * expression.cs (Invocation.EmitCall): If the method is not
17068         virtual, do not emit a CallVirt to it, use Call.
17069
17070         * typemanager.cs (GetFullNameSignature): Improve the method to
17071         cope with ".ctor" and replace it with the type name.
17072
17073         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17074         as an argument the ConstructorBuilder where it is being defined,
17075         to catch the recursive constructor invocations.
17076
17077 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17078
17079         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17080         routines to check if a type is an enumerable/enumerator allow
17081         classes that implement the IEnumerable or IEnumerator interfaces.
17082
17083         * class.cs (Property, Operator): Implement IIteratorContainer, and
17084         implement SetYields.
17085
17086         (Property.Define): Do the block swapping for get_methods in the
17087         context of iterators.   We need to check if Properties also
17088         include indexers or not.
17089
17090         (Operator): Assign the Block before invoking the
17091         OperatorMethod.Define, so we can trigger the Iterator code
17092         replacement. 
17093
17094         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17095         Property and Operator classes are not created when we parse the
17096         declarator but until we have the block completed, so we use a
17097         singleton SimpleIteratorContainer.Simple to flag whether the
17098         SetYields has been invoked.
17099
17100         We propagate this setting then to the Property or the Operator to
17101         allow the `yield' to function.
17102
17103 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17104
17105         * codegen.cs: Implemented attribute support for modules.
17106         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17107         Assembly/Module functionality.
17108
17109         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17110         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17111         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17112
17113 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17114
17115         * interface.cs (FindMembers): The operation is performed on all base
17116         interfaces and not only on the first. It is required for future CLS Compliance patch.
17117
17118 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17119
17120         * statement.cs, codegen.cs:
17121         This patch deals with patterns such as:
17122
17123         public class List : IEnumerable {
17124
17125                 public MyEnumerator GetEnumerator () {
17126                         return new MyEnumerator(this);
17127                 }
17128
17129                 IEnumerator IEnumerable.GetEnumerator () {
17130                         ...
17131                 }
17132                 
17133                 public struct MyEnumerator : IEnumerator {
17134                         ...
17135                 }
17136         }
17137
17138         Before, there were a few things we did wrong:
17139         1) we would emit callvirt on a struct, which is illegal
17140         2) we emited ldarg when we needed to emit ldarga
17141         3) we would mistakenly call the interface methods on an enumerator
17142         type that derived from IEnumerator and was in another assembly. For example:
17143
17144         public class MyEnumerator : IEnumerator
17145
17146         Would have the interface methods called, even if there were public impls of the
17147         method. In a struct, this lead to invalid IL code.
17148
17149 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17150
17151         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17152           renamed to Emit.
17153
17154         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17155
17156 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17157
17158         * cs-parser.jay: Fix small regression: we were not testing V2
17159         compiler features correctly.
17160
17161         * interface.cs: If the emit context is null, then create one
17162
17163 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17164
17165         * decl.cs (GetSignatureForError): New virtual method to get full name
17166           for error messages.
17167
17168         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17169           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17170
17171         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17172           Duplicated members and code in these classes has been removed.
17173           Better encapsulation in these classes.
17174
17175 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17176
17177         * assign.cs (Assign.DoResolve): When dealing with compound
17178         assignments, there is a new rule in ECMA C# 2.4 (might have been
17179         there before, but it is documented here) that states that in:
17180
17181         a op= b;
17182
17183         If b is of type int, and the `op' is a shift-operator, then the
17184         above is evaluated as:
17185
17186         a = (int) a op b 
17187
17188         * expression.cs (Binary.ResolveOperator): Instead of testing for
17189         int/uint/long/ulong, try to implicitly convert to any of those
17190         types and use that in pointer arithmetic.
17191
17192         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17193         method to print information for from the type, not from the
17194         null-method we were given.
17195
17196 2004-02-01  Duncan Mak  <duncan@ximian.com>
17197
17198         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17199         parsing for cmd, fixes bug #53694.
17200
17201 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17202
17203         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17204         in the member name duplication tests. Property and operator name duplication
17205         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17206
17207 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17208
17209         * interface.cs (PopulateMethod): Fixed crash when interface method
17210         returns not existing type (error test cs0246-3.cs).
17211
17212 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17213
17214         * cs-parser.jay (interface_accessors): Re-write actions to also
17215         store attributes attached to get and set methods. Fix spelling
17216         while at it.
17217
17218         (inteface_property_declaration): Modify accordingly.
17219
17220         (InterfaceAccessorInfo): New helper class to store information to pass
17221         around between rules that use interface_accessors.
17222
17223         * interface.cs (Emit): Apply attributes on the get and set
17224         accessors of properties and indexers too.
17225
17226         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17227         right MethodBuilder when applying attributes to the get and set accessors.
17228
17229 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17230
17231         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17232
17233 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17234
17235         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17236
17237 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17238
17239         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17240         changes that treat `yield' specially when present before `break'
17241         or `return' tokens.
17242
17243         * cs-tokenizer.cs: yield is no longer a keyword.
17244
17245 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17246
17247         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17248         setting for default constructors.
17249         For default constructors are almost every time set wrong Modifier. The
17250         generated IL code has been alright. But inside mcs this values was
17251         wrong and this was reason why several of my CLS Compliance tests
17252         failed.
17253
17254 2004-01-22  Martin Baulig  <martin@ximian.com>
17255
17256         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17257         not a QualifiedIdentifier.  This is what `type_name_expression'
17258         was previously doing.
17259         (type_name_expression): Removed; the code is now in
17260         `namespace_or_type_name'.
17261         (qualified_identifier): Removed, use `namespace_or_type_name'
17262         instead.
17263         (QualifiedIdentifier): Removed this class.      
17264
17265 2004-01-22  Martin Baulig  <martin@ximian.com>
17266
17267         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17268         not a string as alias name.
17269
17270 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17271
17272         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17273         #52730 bug, and instead compute correctly the need to use a
17274         temporary variable when requesting an address based on the
17275         static/instace modified of the field and the constructor.
17276  
17277 2004-01-21  Martin Baulig  <martin@ximian.com>
17278
17279         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17280         class and namespace before looking up aliases.  Fixes #52517.
17281
17282 2004-01-21  Martin Baulig  <martin@ximian.com>
17283
17284         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17285         assinged in a 'try'; fixes exception4.cs.
17286
17287 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17288         * class.cs : Implemented parameter-less constructor for TypeContainer
17289
17290         * decl.cs: Attributes are now stored here. New property OptAttributes
17291
17292         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17293
17294         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17295
17296 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17297
17298         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17299           (CSharpSignature): New method for indexer and property signature.
17300
17301 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17302
17303         * pending.cs (IsVirtualFilter): Faster implementation.
17304
17305 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17306
17307         * typemanager.cs: Avoid inclusion of same assembly more than once.
17308
17309 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17310
17311         * cs-parser.jay: Fixed problem where the last assembly attribute
17312           has been applied also to following declaration (class, struct, etc.)
17313           
17314 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17315
17316         * class.cs: Added error CS0538, CS0539 reporting.
17317         Fixed crash on Microsoft runtime when field type is void.
17318
17319         * cs-parser.jay: Added error CS0537 reporting.
17320
17321         * pending.cs: Added error CS0535 reporting.
17322         Improved error report for errors CS0536, CS0534.
17323
17324 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
17325
17326         Merge a few bits from the Anonymous Method MCS tree.
17327
17328         * statement.cs (ToplevelBlock): New class for toplevel methods,
17329         will hold anonymous methods, lifted variables.
17330
17331         * cs-parser.jay: Create toplevel blocks for delegates and for
17332         regular blocks of code. 
17333
17334 2004-01-20  Martin Baulig  <martin@ximian.com>
17335
17336         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17337         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17338         and `NeedExplicitReturn'; added `IsLastStatement'.
17339         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17340         have a `ReturnLabel' or we're not unreachable.
17341
17342         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17343         child's reachability; don't just override ours with it.  Fixes
17344         #58058 (lluis's example).
17345         (FlowBranching): Added public InTryOrCatch(), InCatch(),
17346         InFinally(), InLoop(), InSwitch() and
17347         BreakCrossesTryCatchBoundary() methods.
17348
17349         * statement.cs (Return): Do all error checking in Resolve().
17350         Unless we are the last statement in a top-level block, always
17351         create a return label and jump to it.
17352         (Break, Continue): Do all error checking in Resolve(); also make
17353         sure we aren't leaving a `finally'.
17354         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17355         statement in a top-level block.
17356         (Block.Flags): Added `IsDestructor'.
17357         (Block.IsDestructor): New public property.
17358
17359 2004-01-20  Martin Baulig  <martin@ximian.com>
17360
17361         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17362
17363 2004-01-20  Martin Baulig  <martin@ximian.com>
17364
17365         * statement.cs (Statement.ResolveUnreachable): New public method.
17366         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17367         (Block.Resolve): Resolve unreachable statements.
17368
17369 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17370
17371         * expression.cs: We need to fix the case where we do
17372         not have a temp variable here.
17373
17374         * assign.cs: Only expression compound assignments need
17375         temporary variables.
17376
17377 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17378
17379         * flowanalysis.cs: Reduce memory allocation in a few ways:
17380           - A block with no variables should not allocate a bit
17381             vector for itself.
17382           - A method with no out parameters does not need any tracking
17383             for assignment of the parameters, so we need not allocate
17384             any data for it.
17385           - The arrays:
17386                 public readonly Type[] VariableTypes;
17387                 public readonly string[] VariableNames;
17388             Are redundant. The data is already stored in the variable
17389             map, so we need not allocate another array for it.
17390           - We need to add alot of checks for if (params | locals) == null
17391             due to the first two changes.
17392
17393 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
17394
17395         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17396         implement IMemoryLocation, we store a copy on a local variable and
17397         take the address of it.  Patch from Benjamin Jemlich
17398
17399         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17400         to use a special "type_name_expression" rule which reduces the
17401         number of "QualifiedIdentifier" classes created, and instead
17402         directly creates MemberAccess expressions.
17403
17404 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
17405
17406         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17407         that fixes #52853.  Null literal assignment to ValueType
17408
17409         * class.cs (MethodData.Emit): Instead of checking the name of the
17410         method to determine if its a destructor, create a new derived
17411         class from Method called Destructor, and test for that.  
17412
17413         * cs-parser.jay: Create a Destructor object instead of a Method.  
17414
17415         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17416
17417         Fixes: 52933
17418
17419 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * expression.cs (Binary.ResolveOperator): Perform an implicit
17422         conversion from MethodGroups to their delegate types on the
17423         Addition operation.
17424
17425         * delegate.cs: Introduce a new class DelegateCreation that is the
17426         base class for `NewDelegate' and `ImplicitDelegateCreation',
17427         factor some code in here.
17428
17429         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17430         conversion from MethodGroups to compatible delegate types. 
17431
17432         * ecore.cs (Expression.Resolve): Do not flag error 654
17433         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17434         we allow conversions from MethodGroups to delegate types now.
17435
17436         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17437         assignments in v2 either.
17438
17439 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17442         static read-only fields in ctors.
17443
17444         Applied patch from Benjamin Jemlich 
17445
17446         * expression.cs (UnaryMutator): Avoid leaking local variables. 
17447
17448 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
17449
17450         * cs-tokenizer.cs (IsCastToken): Allow the various native types
17451         here to return true, as they can be used like this:
17452
17453                 (XXX) int.MEMBER ()
17454
17455         Fixed 49836 and all the other dups
17456
17457 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
17458
17459         * driver.cs: Implement /win32res and /win32icon.
17460
17461 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
17462
17463         * cs-parser.jay: Add a rule to improve error handling for the
17464         common mistake of placing modifiers after the type.
17465
17466 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
17467
17468         * cs-parser.jay (interface_event_declaration): Catch
17469         initialization of events on interfaces, and report cs0068
17470
17471         * cs-parser.jay (interface_event_declaration): Catch
17472         initialization of events. 
17473
17474         * ecore.cs: Better report missing constructors.
17475
17476         * expression.cs (Binary.ResolveOperator): My previous bug fix had
17477         the error reporting done in the wrong place.  Fix.
17478
17479         * expression.cs (Binary.ResolveOperator): Catch the 
17480         operator + (E x, E y) error earlier, and later allow for implicit
17481         conversions in operator +/- (E e, U x) from U to the underlying
17482         type of E.
17483
17484         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17485         52596, if the container class is abstract, the default constructor
17486         is protected otherwise its public (before, we were always public).
17487
17488         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17489         fixed statement.
17490
17491         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17492         Jemlich that fixes bug #52597, MCS was generating invalid code for
17493         idisposable structs.   Thanks to Ben for following up with this
17494         bug as well.
17495
17496 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
17497
17498         * driver.cs: Allow assemblies without code to be generated, fixes
17499         52230.
17500
17501 2004-01-07  Nick Drochak <ndrochak@gol.com>
17502
17503         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17504
17505 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
17506
17507         * cs-parser.jay: Add rules to improve error reporting if fields or
17508         methods are declared at the namespace level (error 116)
17509
17510         * Add rules to catch event add/remove
17511
17512 2004-01-04  David Sheldon <dave-mono@earth.li>
17513
17514   * expression.cs: Added matching ")" to error message for 
17515   CS0077
17516
17517 2004-01-03 Todd Berman <tberman@gentoo.org>
17518
17519         * ecore.cs, attribute.cs:
17520         Applying fix from #52429.
17521
17522 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17523
17524         * ecore.cs, expression.cs, statement.cs:
17525         Total rewrite of how we handle branching. We
17526         now handle complex boolean expressions with fewer
17527         jumps. As well if (x == 0) no longer emits a ceq.
17528
17529         if (x is Foo) is much faster now, because we generate
17530         better code.
17531
17532         Overall, we get a pretty big improvement on our benchmark
17533         tests. The code we generate is smaller and more readable.
17534
17535         I did a full two-stage bootstrap. The patch was reviewed
17536         by Martin and Miguel.
17537
17538 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17539
17540         * cs-parser.jay: Make primary_expression not take a QI.
17541         we dont need this because the member_access rule covers
17542         us here. So we replace the rule with just IDENTIFIER.
17543
17544         This has two good effects. First, we remove a s/r conflict.
17545         Second, we allocate many fewer QualifiedIdentifier objects.
17546
17547 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17548
17549         * attribute.cs: Handle MarshalAs attributes as pseudo, and
17550         set the correct information via SRE. This prevents
17551         hanging on the MS runtime. Fixes #29374.
17552
17553 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17554
17555         * convert.cs: correctly handle conversions to value types
17556         from Enum and ValueType as unboxing conversions.
17557
17558         Fixes bug #52569. Patch by Benjamin Jemlich.
17559
17560 2004-01-02  Ravi Pratap  <ravi@ximian.com>
17561
17562         * expression.cs (BetterConversion): Prefer int -> uint
17563         over int -> ulong (csc's behaviour). This fixed bug #52046.
17564
17565 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17566
17567         * decl.cs (MemberCache.FindMembers): now returns a
17568         MemberInfo [].
17569
17570         * typemanager.cs: In general, go with with ^^.
17571         (CopyNewMethods): take an IList.
17572         (RealMemberLookup): Only allocate an arraylist
17573         if we copy from two sets of methods.
17574
17575         This change basically does two things:
17576         1) Fewer array lists allocated due to CopyNewMethods.
17577         2) the explicit cast in MemberList costed ALOT.
17578
17579 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
17580
17581         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17582         a hashtable to avoid needless string allocations when an identifier is
17583         used more than once (the common case).
17584
17585 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17586
17587         * pending.cs: MS's TypeBuilder.GetInterfaces ()
17588         is broken, it will not return anything. So, we
17589         have to use the information we have in mcs to
17590         do the task.
17591
17592         * typemanager.cs: Add a cache for GetInterfaces,
17593         since this will now be used more often (due to ^^)
17594
17595         (GetExplicitInterfaces) New method that gets the
17596         declared, not effective, interfaces on a type
17597         builder (eg, if you have interface IFoo, interface
17598         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17599         { IBar }.
17600
17601         This patch makes MCS able to bootstrap itself on
17602         Windows again.
17603
17604 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17605
17606         * expression.cs: Remove the Nop's that Miguel put
17607         in by mistake.
17608
17609 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17610
17611         * report.cs, codegen.cs: Give the real stack trace to
17612         the error when an exception is thrown.
17613
17614 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17615
17616         * decl.cs: only allocate hashtables for ifaces if 
17617         it is an iface!
17618
17619 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17620
17621         * expression.cs: fix the error from cs0121-2.cs
17622         (a parent interface has two child interfaces that
17623         have a function with the same name and 0 params
17624         and the function is called through the parent).
17625
17626 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17627
17628         * class.cs, rootcontext.cs, typmanager.cs: do not
17629         leak pointers.
17630
17631 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17632
17633         * codegen.cs: remove stack for the ec flow branching.
17634         It is already a linked list, so no need.
17635
17636 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17637
17638         * Makefile: Allow custom profiler here.
17639
17640 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17641
17642         * typemanager.cs (LookupType):
17643           - Use a static char [], because split takes
17644             a param array for args, so it was allocating
17645             every time.
17646           - Do not store true in a hashtable, it boxes.
17647
17648 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17649
17650         * flowanalysis.cs: bytify common enums.
17651
17652 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17653
17654         * modifiers.cs: Add a new set of flags for the
17655         flags allowed on explicit interface impls.
17656         * cs-parser.jay: catch the use of modifiers in
17657         interfaces correctly.
17658         * class.cs: catch private void IFoo.Blah ().
17659
17660         All related to bug #50572.
17661
17662 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17663
17664         * decl.cs: Rewrite the consistant accessability checking.
17665         Accessability is not linear, it must be implemented in
17666         a tableish way. Fixes #49704.
17667
17668 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17669
17670         * expression.cs: Handle negation in a checked context.
17671         We must use subtraction from zero. Fixes #38674.
17672
17673 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17674
17675         * class.cs: Ignore static void main in DLLs.
17676         * rootcontext.cs: Handle the target type here,
17677         since we are have to access it from class.cs
17678         * driver.cs: account for the above.
17679
17680 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17681
17682         * report.cs: Give line numbers and files if available.
17683
17684 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
17685
17686         * driver.cs: Implement /addmodule.
17687
17688         * typemanager.cs:  Change 'modules' field so it now contains Modules not
17689         ModuleBuilders.
17690
17691 2003-12-20  Martin Baulig  <martin@ximian.com>
17692
17693         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
17694         (FieldBase.IsAssigned): Removed this field.
17695         (FieldBase.SetAssigned): New public method.
17696         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
17697
17698 2003-12-20  Martin Baulig  <martin@ximian.com>
17699
17700         * expression.cs (LocalVariableReference.DoResolve): Don't set
17701         `vi.Used' if we're called from DoResolveLValue().
17702
17703         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
17704         returns the usage vector it just merged into the current one -
17705         pass this one to UsageWarning().
17706         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
17707         of the `EmitContext', don't call this recursively on our children.
17708
17709 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
17710
17711         * driver.cs: Implement /target:module.
17712
17713 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
17714
17715         * support.cs (CharArrayHashtable): New helper class.
17716
17717         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
17718         char arrays, not strings, so we can avoid creating a string in
17719         consume_identifier if the identifier is a keyword.
17720
17721 2003-12-16  Martin Baulig  <martin@ximian.com>
17722
17723         * statement.cs (LocalInfo.Assigned): Removed this property.
17724         (LocalInfo.Flags): Removed `Assigned'.
17725         (LocalInfo.IsAssigned): New public method; takes the EmitContext
17726         and uses flow analysis.
17727         (Block.UsageWarning): Made this method private.
17728         (Block.Resolve): Call UsageWarning() if appropriate.
17729
17730         * expression.cs (LocalVariableReference.DoResolve): Always set
17731         LocalInfo.Used here.
17732
17733 2003-12-13  Martin Baulig  <martin@ximian.com>
17734
17735         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
17736         any value here; we're now using flow analysis to figure out
17737         whether a statement/block returns a value.
17738
17739 2003-12-13  Martin Baulig  <martin@ximian.com>
17740
17741         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
17742         working again.
17743         (FlowBranching.MergeFinally): Don't call
17744         `branching.CheckOutParameters()' here, this is called in
17745         MergeTopBlock().
17746         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
17747         when adding the `finally' vector.       
17748
17749 2003-12-13  Martin Baulig  <martin@ximian.com>
17750
17751         * flowanalysis.cs
17752         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
17753         actually work and also fix #48962.
17754
17755 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17756
17757         * decl.cs: Do not check System.Object for nested types,
17758         since we know it does not have any. Big bang for buck:
17759
17760         BEFORE:
17761            Run 1:   8.35 seconds
17762            Run 2:   8.32 seconds
17763            corlib:  17.99 seconds
17764         AFTER:
17765            Run 1:   8.17 seconds
17766            Run 2:   8.17 seconds
17767            corlib:  17.39 seconds
17768
17769 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17770
17771         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
17772         time we are returning 0 members, so we save alot here.
17773
17774 2003-12-11  Martin Baulig  <martin@ximian.com>
17775
17776         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
17777         `MergeChild()', also just take the `FlowBranching' as argument;
17778         call Merge() on it and return the result.
17779         (FlowBranching.Merge): We don't need to do anything if we just
17780         have one sibling.
17781
17782 2003-12-11  Martin Baulig  <martin@ximian.com>
17783
17784         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
17785         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
17786         Maurer for this idea.
17787
17788 2003-12-11  Martin Baulig  <martin@ximian.com>
17789
17790         * flowanalysis.cs (MergeResult): This class is now gone; we now
17791         use the `UsageVector' for this.  The reason for this is that if a
17792         branching just has one sibling, we don't need to "merge" them at
17793         all - that's the next step to do.
17794         (FlowBranching.Merge): We now return a `UsageVector' instead of a
17795         `MergeResult'.
17796
17797 2003-12-11  Martin Baulig  <martin@ximian.com>
17798
17799         Reworked flow analyis and made it more precise and bug-free.  The
17800         most important change is that we're now using a special `Reachability'
17801         class instead of having "magic" meanings of `FlowReturns'.  I'll
17802         do some more cleanups and optimizations and also add some more
17803         documentation this week.
17804
17805         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
17806         largely reworked this class.
17807         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
17808         the new `Reachability' class instead of having "magic" values here.
17809         (FlowBranching): We're now using an instance of `Reachability'
17810         instead of having separate `Returns', `Breaks' etc. fields.
17811
17812         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
17813         based on flow analysis; ignore the return value of block.Emit ().
17814
17815 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
17816
17817         * driver.cs typemanager.cs: Find the mono extensions to corlib even
17818         if they are private.
17819
17820 2003-12-09  Martin Baulig  <martin@ximian.com>
17821
17822         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
17823         call them directly on the UsageVector.
17824
17825 2003-12-09  Martin Baulig  <martin@ximian.com>
17826
17827         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
17828         Changed return type from `FlowReturns' to `Reachability'.
17829
17830 2003-12-09  Martin Baulig  <martin@ximian.com>
17831
17832         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
17833         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
17834         `Reachable' fields with a single `Reachability' one.
17835
17836 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17837
17838         * class.cs (FindMembers): Remove foreach's.
17839
17840         Bootstrap times:
17841
17842         BEFORE
17843                 Run 1:   8.74 seconds
17844                 Run 2:   8.71 seconds
17845
17846         AFTER
17847                 Run 1:   8.64 seconds
17848                 Run 2:   8.58 seconds
17849
17850
17851 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17852
17853         * cs-parser.jay:
17854         * gen-treedump.cs:
17855         * statement.cs:
17856         This patch does a few things:
17857                 1. EmptyStatement is now a singleton, so it is never reallocated.
17858                 2. All blah is EmptyStatement constructs have been changed to
17859                    blah == EmptyStatement.Value, which is much faster and valid
17860                    now that EmptyStatement is a singleton.
17861                 3. When resolving a block, rather than allocating a new array for
17862                    the non-empty statements, empty statements are replaced with
17863                    EmptyStatement.Value
17864                 4. Some recursive functions have been made non-recursive.
17865         Mainly the performance impact is from (3), however (1) and (2) are needed for
17866         this to work. (4) does not make a big difference in normal situations, however
17867         it makes the profile look saner.
17868
17869         Bootstrap times:
17870
17871         BEFORE
17872         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17873         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17874         Total memory allocated: 56397 KB
17875
17876         AFTER
17877         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
17878         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
17879         Total memory allocated: 55666 KB
17880
17881 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17882
17883         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
17884         than the hashtable in a hashtable version
17885
17886         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
17887         we always end up concating a string. This results in a huge perf
17888         loss, because many strings have to be tracked by the GC. In this
17889         patch, we first use a hashtable that works with two keys, so that
17890         the strings do not need to be concat'ed.
17891
17892         Bootstrap times:
17893         BEFORE
17894                 Run 1:   8.74 seconds
17895                 Run 2:   8.71 seconds
17896
17897         AFTER
17898                 Run 1:   8.65 seconds
17899                 Run 2:   8.56 seconds
17900
17901 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17902
17903         * Makefile: Add a new target `do-time' that does a quick and simple
17904         profile, leaving easy to parse output.
17905
17906 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
17907
17908         * codegen.cs (Init): Create the dynamic assembly with 
17909         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
17910
17911 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17912
17913         * support.cs: Make the PtrHashtable use only one
17914         instance of its comparer.
17915
17916 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
17917
17918         * typemanager.cs: Fix lookup of GetNamespaces.
17919
17920 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * expression.cs: Removed redundant line.
17923
17924         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
17925         ArrayLists, use for loops with bounds.  
17926
17927         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
17928         arraylist.
17929
17930         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
17931         arraylists, use for loop with bounds.
17932
17933         The above three changes give us a 0.071 second performance
17934         improvement out of 3.294 seconds down to 3.223.  On my machine
17935         the above changes reduced the memory usage by 1,387 KB during
17936         compiler bootstrap.
17937
17938         * cs-parser.jay (QualifiedIdentifier): New class used to represent
17939         QualifiedIdentifiers.  Before we created a new string through
17940         concatenation, and mostly later on, the result would be
17941         manipulated by DecomposeQI through string manipulation.
17942
17943         This reduced the compiler memory usage for bootstrapping from
17944         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
17945         compile times in 0.05 seconds.
17946
17947 2003-11-28  Dick Porter  <dick@ximian.com>
17948
17949         * support.cs: Do string compares with the Invariant culture.
17950
17951         * rootcontext.cs: 
17952         * gen-treedump.cs: 
17953         * expression.cs: 
17954         * driver.cs: 
17955         * decl.cs: 
17956         * codegen.cs: 
17957         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
17958         the comparison is done with the Invariant culture.
17959
17960 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
17963         GetEnumerator method.
17964
17965         (ProbeCollectionType): Iterate starting at the most specific type
17966         upwards looking for a GetEnumerator
17967
17968         * expression.cs: Shift count can be up to 31 for int/uint and 63
17969         for long/ulong.
17970
17971 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * statement.cs (Block.LookupLabel): Also look for the label on the
17974         children blocks.  Use a hash table to keep track of visited
17975         nodes. 
17976
17977         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
17978         we actually did transform the other operand, otherwise fall back
17979         to the common codepath that casts to long.
17980
17981         * cs-tokenizer.cs: Use the same code pattern as the int case.
17982         Maybe I should do the parsing myself, and avoid depending on the
17983         Parse routines to get this done.
17984
17985 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
17986
17987         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
17988         which fixes bug 51347.  This time test it.
17989
17990         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
17991         attributes for example can not tell the difference between these.
17992         The difference was only a syntax feature of the language. 
17993
17994         * attribute.cs: Apply attributes to delegates.
17995
17996         * delegate.cs: Call the apply attributes method.
17997
17998 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
17999
18000         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18001         comparing 0 vs Byte.MinValue, not the value
18002
18003         (ImplicitConversionRequired): When reporting a conversion error,
18004         use error 31 to print out the constant error instead of the
18005         simpler 29.
18006
18007         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18008         which fixes bug 51347.
18009
18010 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18011
18012         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18013         which fixes the -warnaserror command line option.
18014
18015 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18016
18017         * cfold.cs (DoNumericPromotions): During constant folding of
18018         additions on UIntConstant, special case intconstants with
18019         IntConstants like we do on the expression binary operator. 
18020
18021 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * convert.cs (ImplicitReferenceConversion): We were missing a case
18024         (System.Enum are not value types or class types, so we need to
18025         classify them separatedly).
18026
18027         * driver.cs: We do not support error 2007.
18028
18029 2003-11-12 Jackson Harper <jackson@ximian.com>
18030
18031         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18032         system directory. Also use the full file name so users can
18033         libraries names mscorlib-o-tron.dll in a non system dir.
18034
18035 2003-11-10  Martin Baulig  <martin@ximian.com>
18036
18037         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18038         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18039         calling `ResolveType()' on them, directly assign their `Type'.
18040
18041 2003-11-08  Martin Baulig  <martin@ximian.com>
18042
18043         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18044         return value and the `out parent' parameter.
18045         (TypeContainer.DefineType): Moved the CS0644 check into
18046         GetClassBases().  Don't pass the interface types to the
18047         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18048         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18049
18050         * ecore.cs (TypeExpr.IsAttribute): New property.
18051         (TypeExpr.GetInterfaces): New method.
18052
18053         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18054         TypeExpr instead of a Type.
18055         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18056         (Interface.DefineType): Don't pass the interface types to the
18057         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18058         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18059
18060         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18061         instead of a `Type[]'.
18062         (TypeManager.RegisterBuilder): Likewise.
18063         (TypeManager.AddUserInterface): Likewise.
18064         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18065         `Type[]' and also return a `TypeExpr[]'.
18066         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18067
18068 2003-11-08  Martin Baulig  <martin@ximian.com>
18069
18070         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18071         Expression.     
18072
18073 2003-11-08  Martin Baulig  <martin@ximian.com>
18074
18075         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18076         TypeManager.ResolveExpressionTypes().
18077
18078         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18079         instead of an Expression.
18080         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18081         (TypeExpression): New public class; formerly known as `TypeExpr'.
18082
18083         * expression.cs (ComposedCast): Derive from TypeExpr.
18084
18085         * typemanager.cs (TypeManager.system_*_expr): These are now
18086         TypExpr's instead of Expression's.
18087         (TypeManager.ResolveExpressionTypes): New public static function;
18088         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18089         of them.        
18090
18091 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18092
18093         * expression.cs (New.DoResolve): Do not dereference value that
18094         might be a null return.
18095
18096         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18097         sure that the constant value has the right type.  Fixes an
18098         unreported bug, similar to 50425.
18099
18100         * const.cs (Const.LookupConstantValue): Call
18101         ImplicitStandardConversionExists before doing a conversion to
18102         avoid havng the TypeManager.ChangeType do conversions.
18103
18104         Reduced the number of casts used
18105
18106         (Const.ChangeType): New routine to enable reuse of the constant
18107         type changing code from statement.
18108
18109         * typemanager.cs (ChangeType): Move common initialization to
18110         static global variables.
18111
18112         Fixes #50425.
18113
18114         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18115         every value type to go through, even if it was void.  Fix that. 
18116
18117         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18118         character of the define, and the is_identifier_part_character for
18119         the rest of the string.
18120
18121 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18122
18123         * expression.cs (UnaryMutator.EmitCode): When I updated
18124         LocalVariableReference.DoResolve, I overdid it, and dropped an
18125         optimization done on local variable references.
18126
18127 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18128
18129         * ecore.cs: Convert the return from Ldlen into an int.
18130
18131 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18132
18133         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18134         the accessibility, this is a special case for toplevel non-public
18135         classes (internal for instance).
18136
18137 2003-10-20  Nick Drochak <ndrochak@gol.com>
18138
18139         * ecore.cs: Fix typo and build.  Needed another right paren.
18140
18141 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18142
18143         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18144         `internal' case regular and protected, but not allowing protected
18145         to be evaluated later.  Bug 49840
18146
18147 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18148
18149         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18150         to kb.Nlast, and not the kb.nFirst to isolate the switch
18151         statement.
18152
18153         Extract the underlying type, so enumerations of long/ulong are
18154         treated like long/ulong.
18155
18156 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18157
18158         * expression.cs (New): Overload the meaning of RequestedType to
18159         track the possible creation of the NewDelegate type, since
18160         DoResolve is invoked more than once for new constructors on field
18161         initialization.
18162
18163         See bugs: #48800 and #37014
18164
18165         * cs-parser.jay (declare_local_constants): Take an arraylist
18166         instead of a single constant.
18167
18168         (local_constant_declaration): It should take a
18169         constant_declarators, not a constant_declarator.  Fixes 49487
18170
18171         * convert.cs: Fix error report.
18172
18173 2003-10-13 Jackson Harper <jackson@ximian.com>
18174
18175         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18176         bug #49611
18177
18178 2003-10-09  Martin Baulig  <martin@ximian.com>
18179
18180         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18181         to the .ctor.
18182         (MethodCore.DoDefineParameters): Removed the TypeContainer
18183         argument; use the DeclSpace which was passed to the .ctor instead.
18184         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18185         TypeContainer; we only need a DeclSpace here.
18186
18187 2003-10-09  Martin Baulig  <martin@ximian.com>
18188
18189         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18190         to the .ctor.
18191         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18192         EmitContext's .ctor.    
18193
18194 2003-10-09  Martin Baulig  <martin@ximian.com>
18195
18196         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18197         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18198         AsAccessible(), moved them as well.
18199
18200         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18201
18202 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18203
18204         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18205
18206 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18207
18208         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18209         generation for >=, as spotted by Paolo, bug 48679.  
18210         Patch from David Waite.
18211
18212         * cs-tokenizer.cs: Add handling for #pragma.
18213
18214         * cs-parser.jay: Allow for both yield and yield return in the
18215         syntax.  The anti-cobolization of C# fight will go on!
18216
18217         * class.cs (TypeBuilder.DefineType): Catch error condition here
18218         (Parent.DefineType erroring out and returning null).
18219
18220         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18221         coping with enumerations variables, we were mistakenly processing
18222         them as a regular value type instead of built-in types.  Fixes the
18223         bug #48063
18224
18225         * typemanager.cs (IsBuiltinOrEnum): New method.
18226
18227 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18228
18229         * cs-parser.jay: Upgrade: yield now needs the return clause.
18230
18231 2003-09-19  Martin Baulig  <martin@ximian.com>
18232
18233         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18234         `MemberCache parent' argument.  Normally, an interface doesn't
18235         have a parent type except System.Object, but we use this in gmcs
18236         for generic type parameters.
18237
18238 2003-09-18  Martin Baulig  <martin@ximian.com>
18239
18240         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18241         on `type.IsInterface'; don't check whether the type has a parent
18242         to determine whether it's an interface.
18243
18244 2003-09-15  Martin Baulig  <martin@ximian.com>
18245
18246         * class.cs (TypeContainer.DefineType): Added an error flag to
18247         avoid reporting duplicate CS0146's ("class definition is
18248         circular.").
18249
18250         * driver.cs (Driver.MainDriver): Abort if
18251         RootContext.ResolveTree() reported any errors.
18252
18253 2003-09-07  Martin Baulig  <martin@ximian.com>
18254
18255         * report.cs (Error, Warning): Added overloaded versions which take
18256         a `params object[] args' and call String.Format().
18257
18258 2003-09-07  Martin Baulig  <martin@ximian.com>
18259
18260         * decl.cs (DeclSpace..ctor): Don't call
18261         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18262         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18263         (DeclSpace.RecordDecl): New method.
18264
18265         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18266
18267 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18268
18269         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18270         value attributes to be applied to ParameterBuilders.
18271
18272         * class.cs (MethodCore.LabelParameters): Make static and more
18273         generic so that it can be used from other places - like interface
18274         methods, for instance.
18275
18276         * interface.cs (Interface.Emit): Call LabelParameters before
18277         emitting attributes on the InterfaceMethod.
18278
18279 2003-08-26  Martin Baulig  <martin@ximian.com>
18280
18281         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18282         resolving aliases; fixes #47927.
18283
18284 2003-08-26  Martin Baulig  <martin@ximian.com>
18285
18286         * statement.cs (Using.DoResolve): This is internally emitting a
18287         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18288         do not always return.  Fixes #47681.
18289
18290 2003-08-26  Martin Baulig  <martin@ximian.com>
18291
18292         * decl.cs (MemberCore): Moved WarningNotHiding(),
18293         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18294         into MemberBase.
18295         (AdditionResult): Make this nested in DeclSpace.
18296         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18297         argument; call NamespaceEntry.Define() unless we're nested in a
18298         class or struct.
18299
18300         * namespace.cs (Namespace.DefineName): New public function.  This
18301         is called from DeclSpace's .ctor to add 
18302         (Namespace.Lookup): Include DeclSpaces in the lookup.
18303
18304         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18305
18306         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18307
18308 2003-08-25  Martin Baulig  <martin@ximian.com>
18309
18310         * convert.cs (Convert.ExplicitReferenceConversion): When
18311         converting from an interface type to a class, unbox if the target
18312         type is a struct type.  Fixes #47822.
18313
18314 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18315
18316         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18317         #47854.
18318
18319 2003-08-22  Martin Baulig  <martin@ximian.com>
18320
18321         * class.cs (TypeManager.DefineType): When defining a nested type,
18322         call DefineType() on our parent; fixes #47801.
18323
18324 2003-08-22  Martin Baulig  <martin@ximian.com>
18325
18326         * class.cs (MethodData.Define): While checking if a method is an
18327         interface implementation, improve the test a bit more to fix #47654.
18328
18329 2003-08-22  Martin Baulig  <martin@ximian.com>
18330
18331         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18332         correctly; fixes #47722.
18333
18334 2003-08-22  Martin Baulig  <martin@ximian.com>
18335
18336         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18337         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
18338
18339         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
18340
18341 2003-08-22  Martin Baulig  <martin@ximian.com>
18342
18343         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18344         can only be assigned in static constructors.  Fixes #47161.
18345
18346 2003-08-22  Martin Baulig  <martin@ximian.com>
18347
18348         Rewrote and improved the flow analysis code.
18349
18350         * flowbranching.cs (FlowBranching): Make this class abstract.
18351         (FlowBranching.CreateBranching): New static function to create a
18352         new flow branching.
18353         (FlowBranchingBlock, FlowBranchingException): New classes.
18354         (FlowBranching.UsageVector.Type): New public readonly field.
18355         (FlowBranching.UsageVector.Breaks): Removed the setter.
18356         (FlowBranching.UsageVector.Returns): Removed the setter.
18357         (FlowBranching.UsageVector): Added Break(), Return(),
18358         NeverReachable() and Throw() methods to modify the reachability.
18359         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18360         done by FlowBranching.Merge().
18361         (FlowBranching.UsageVector.MergeChild): New method; merges the
18362         merge result into the current vector.
18363         (FlowBranching.Merge): New abstract method to merge a branching.
18364
18365 2003-08-12  Martin Baulig  <martin@ximian.com>
18366
18367         * expression.cs (Indirection.CacheTemporaries): Create the
18368         LocalTemporary with the pointer type, not its element type.
18369
18370 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
18371
18372         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18373         token was a keyword or not.
18374
18375         Add `error' options where an IDENTIFIER was expected;  Provide
18376         CheckToken and CheckIdentifierToken convenience error reporting
18377         functions. 
18378
18379         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18380
18381         * decl.cs: Rename `NamespaceEntry Namespace' public field into
18382         NameSpaceEntry NameSpaceEntry.
18383
18384         (LookupInterfaceOrClass): Avoid creating a full qualified name
18385         from namespace and name: avoid doing lookups when we know the
18386         namespace is non-existant.   Use new Tree.LookupByNamespace which
18387         looks up DeclSpaces based on their namespace, name pair.
18388
18389         * driver.cs: Provide a new `parser verbose' to display the
18390         exception thrown during parsing.  This is turned off by default
18391         now, so the output of a failure from mcs is more graceful.
18392
18393         * namespace.cs: Track all the namespaces defined in a hashtable
18394         for quick lookup.
18395
18396         (IsNamespace): New method
18397
18398 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
18399
18400         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
18401         we know that we need to concatenate (full typename can never be
18402         null). 
18403
18404         * class.cs: ditto.
18405
18406         * statement.cs: Use a bitfield;  Do not initialize to null things
18407         which are done by the constructor by default.
18408
18409         * cs-parser.jay: bug fix, parameter was 4, not 3.
18410
18411         * expression.cs: Just use the property;
18412
18413         * statement.cs: No need for GetVariableInfo method.
18414
18415 2003-08-08  Martin Baulig  <martin@ximian.com>
18416
18417         * flowanalysis.cs (FlowReturns): This is now nested in the
18418         `FlowBranching' class.
18419         (MyBitVector): Moved this here from statement.cs.
18420         (FlowBranching.SiblingType): New enum type.
18421         (FlowBranching.CreateSibling): Added `SiblingType' argument.
18422
18423 2003-08-07  Martin Baulig  <martin@ximian.com>
18424
18425         * flowanalysis.cs (FlowBranchingType): This is now nested in the
18426         `FlowBranching' class and called `BranchingType'.
18427
18428 2003-08-07  Martin Baulig  <martin@ximian.com>
18429
18430         * flowanalysis.cs: Moved all the control flow analysis code into
18431         its own file.
18432
18433 2003-08-07  Martin Baulig  <martin@ximian.com>
18434
18435         * assign.cs (Assign.DoResolve): `target' must either be an
18436         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
18437         #37319.
18438
18439 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
18440
18441         * expression.cs (BinaryMethod): This kind of expression is created by the
18442         Binary class if it determines that the operator has to be handled
18443         by a method.
18444
18445         (BinaryDelegate): This kind of expression is created if we are
18446         dealing with a + or - operator on delegates.
18447
18448         (Binary): remove method, argumetns, and DelegateOperator: when
18449         dealing with methods, 
18450
18451         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18452
18453         * statement.cs (Block): use bitfields for the three extra booleans
18454         we had in use.   Remove unused topblock parameter.
18455
18456         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18457
18458         * assign.cs: Drop extra unneeded tests.
18459
18460 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
18461
18462         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18463
18464         * statement.cs (Foreach): Use VariableStorage instead of
18465         LocalBuilders.   
18466
18467         * codegen.cs (VariableStorage): New class used by clients that
18468         require a variable stored: locals or fields for variables that
18469         need to live across yield.
18470
18471         Maybe provide a convenience api for EmitThis+EmitLoad?
18472
18473         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18474         these bad boys.
18475
18476 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
18477
18478         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18479         RemapParameterLValue): New methods that are used to turn a
18480         precomputed FieldInfo into an expression like this:
18481
18482                 instance.FieldInfo
18483
18484         The idea is to use this instead of making LocalVariableReference
18485         have more than one meaning.
18486
18487         * cs-parser.jay: Add error production to BASE.
18488
18489         * ecore.cs: Deal with TypeManager.GetField returning null, which
18490         is now a valid return value.
18491
18492         (FieldExprNoAddress): New expression for Fields whose address can
18493         not be taken.
18494
18495         * expression.cs (LocalVariableReference): During the resolve
18496         phases, create new expressions if we are in a remapping context.
18497         Remove code that dealt with remapping here.
18498
18499         (ParameterReference): same.
18500
18501         (ProxyInstance): New expression, like the `This' expression, but
18502         it is born fully resolved.  We know what we are doing, so remove
18503         the errors that are targeted to user-provided uses of `this'.
18504
18505         * statement.cs (Foreach): our variable is now stored as an
18506         Expression;  During resolution, follow the protocol, dont just
18507         assume it will return this.
18508
18509 2003-08-06  Martin Baulig  <martin@ximian.com>
18510
18511         * support.cs (SeekableStreamReader.cs): New public class.
18512
18513         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18514         SeekableStreamReader instead of the normal StreamReader.
18515
18516 2003-08-04  Martin Baulig  <martin@ximian.com>
18517
18518         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18519         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18520         deambiguate casts and delegate invocations.
18521         (parenthesized_expression): Use the new tokens to ensure this is
18522         not a cast of method invocation.
18523
18524         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18525         when reading a `)' and Deambiguate_CloseParens () was previously
18526         called.
18527
18528         * expression.cs (ParenthesizedExpression): New class.  This is
18529         just used for the CS0075 test.
18530         (Binary.DoResolve): Check for CS0075.   
18531
18532 2003-07-29  Ravi Pratap  <ravi@ximian.com>
18533
18534         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18535         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18536         reference comparison.
18537
18538         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18539         examine the ReturnType for equality - this is necessary in the
18540         cases of implicit and explicit operators whose signature also
18541         includes the return type.
18542
18543 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
18544
18545         * namespace.cs: Cache the result of the namespace computation,
18546         instead of computing it every time.
18547
18548 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
18549
18550         * decl.cs: Use a global arraylist that we reuse over invocations
18551         to avoid excesive memory consumption.  Reduces memory usage on an
18552         mcs compile by one meg (45 average).
18553
18554         * typemanager.cs (LookupTypeReflection): In .NET pointers are
18555         private, work around that.
18556
18557 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
18558
18559         * literal.cs (IntLiteral): Define Zero and One static literals. 
18560
18561         * cs-parser.jay (integer_literal): use static literals to reduce
18562         memory usage for the most used literals (0, 1 and -1).  211kb
18563         reduced in memory usage.
18564
18565         Replace all calls to `new ArrayList' with `new
18566         ArrayList(4)' which is a good average number for most allocations,
18567         and also requires only 16 bytes of memory for its buffer by
18568         default. 
18569
18570         This reduced MCS memory usage in seven megabytes for the RSS after
18571         bootstrapping.
18572
18573 2003-07-28  Ravi Pratap  <ravi@ximian.com>
18574
18575         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18576         handle params methods the correct way by forming only one
18577         applicable set with params and normal methods in them. Earlier we
18578         were looking at params methods only if we found no normal methods
18579         which was not the correct thing to do.
18580
18581         (Invocation.BetterFunction): Take separate arguments indicating
18582         when candidate and the best method are params methods in their
18583         expanded form.
18584
18585         This fixes bugs #43367 and #46199.
18586
18587         * attribute.cs: Documentation updates.
18588
18589         (CheckAttribute): Rename to CheckAttributeTarget.
18590         (GetValidPlaces): Rename to GetValidTargets.
18591
18592         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18593         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18594
18595         Fixes bug #44468.
18596
18597 2003-07-28  Martin Baulig  <martin@ximian.com>
18598
18599         * class.cs (TypeContainer.DefineMembers): Use the base type's full
18600         name when looking up the base class of a nested class.  Fixes #46977.
18601
18602 2003-07-26  Martin Baulig  <martin@ximian.com>
18603
18604         * expression.cs (Indexers.Indexer): New nested struct; contains
18605         getter, setter and the indexer's type.
18606         (Indexers.Properties): This is now an ArrayList of
18607         Indexers.Indexer's.
18608         (IndexerAccess.DoResolveLValue): Correctly set the type if the
18609         indexer doesn't have any getters.
18610
18611         * assign.cs (Assign.DoResolve): Also do the implicit conversions
18612         for embedded property and indexer assignments.
18613
18614 2003-07-26  Martin Baulig  <martin@ximian.com>
18615
18616         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18617         preprocessor directive is not the first non-whitespace character
18618         on a line.
18619
18620 2003-07-26  Martin Baulig  <martin@ximian.com>
18621
18622         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18623         namespace parsing, follow the spec more closely.
18624
18625         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18626         NamespaceEntry.Lookup().
18627
18628 2003-07-25  Martin Baulig  <martin@ximian.com>
18629
18630         * MethodCore.cs (OverridesSomething): New public field; it's set
18631         from TypeContainer.DefineMembers if this method overrides
18632         something (which doesn't need to be a method).  Fix #39462.
18633
18634 2003-07-25  Ravi Pratap  <ravi@ximian.com>
18635
18636         * typemanager.cs (GetMembers): Ensure that the list of members is
18637         reversed. This keeps things in sync.
18638
18639         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18640         find an AttributeUsage attribute.
18641
18642         * expression.cs (Invocation.OverloadResolve): Perform the check
18643         which disallows Invoke to be directly called on a Delegate.
18644
18645         (Error_InvokeOnDelegate): Report error cs1533.
18646
18647 2003-07-25  Martin Baulig  <martin@ximian.com>
18648
18649         * expression.cs (Indexers.GetIndexersForType): Only look in the
18650         interface hierarchy if the requested type is already an
18651         interface.  Fixes #46788 while keeping #46502 fixed.
18652
18653 2003-07-25  Martin Baulig  <martin@ximian.com>
18654
18655         * class.cs (TypeContainer.DefineMembers): Check whether all
18656         readonly fields have been assigned and report warning CS0649 if
18657         not.
18658
18659         * statement.cs (LocalInfo.IsFixed): Always return true if this is
18660         a valuetype.
18661
18662 2003-07-24  Ravi Pratap  <ravi@ximian.com>
18663
18664         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18665         returned from GetMethods to make things consistent with the
18666         assumptions MCS makes about ordering of methods.
18667
18668         This should comprehensively fix bug #45127 and it does :-)
18669
18670         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18671         ordering is actually reverse.
18672
18673         * Clean up some debug messages I left lying around.
18674
18675         * interface.cs (Populate*): Get rid of code which emits attributes
18676         since the stage in which we emit attributes is the 'Emit' stage,
18677         not the define stage.
18678
18679         (Emit): Move attribute emission for interface members here.
18680
18681 2003-07-22  Ravi Pratap  <ravi@ximian.com>
18682
18683         * expression.cs (Invocation.OverloadResolve): Follow the spec more
18684         closely: we eliminate methods in base types when we have an
18685         applicable method in a top-level type.
18686
18687         Please see section 14.5.5.1 for an exact description of what goes
18688         on. 
18689
18690         This fixes bug #45127 and a host of other related to corlib compilation.
18691
18692         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
18693         array is the method corresponding to the top-level type (this is
18694         because of the changes made to icall.c) so we change this
18695         accordingly.
18696
18697         (MethodGroupExpr.Name): This too.
18698
18699         * typemanager.cs (GetElementType): New method which does the right
18700         thing when compiling corlib. 
18701
18702         * everywhere: Make use of the above in the relevant places.
18703
18704 2003-07-22  Martin Baulig  <martin@ximian.com>
18705
18706         * cs-parser.jay (invocation_expression): Moved
18707         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
18708         `cast_expression', but create a InvocationOrCast which later
18709         resolves to either an Invocation or a Cast.
18710
18711         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
18712         method; call this before EmitStatement() to make sure that this
18713         expression can be used as a statement.
18714
18715         * expression.cs (InvocationOrCast): New class; resolves to either
18716         an Invocation or a Cast.
18717
18718         * statement.cs (StatementExpression): Call ResolveStatement() on
18719         the ExpressionStatement before emitting it.
18720
18721 2003-07-21  Martin Baulig  <martin@ximian.com>
18722
18723         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
18724         `ref' and `out' attributes match; fixes #46220.
18725         (MemberAccess.ResolveMemberAccess): You can't reference a type
18726         through an expression; fixes #33180.
18727         (Indexers.GetIndexersForType): Don't return the indexers from
18728         interfaces the class implements; fixes #46502.
18729
18730 2003-07-21  Martin Baulig  <martin@ximian.com>
18731
18732         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
18733         CS0661 checks; fixes bug #30442.
18734
18735 2003-07-21  Martin Baulig  <martin@ximian.com>
18736
18737         * decl.cs (AdditionResult): Added `Error'.
18738
18739         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
18740
18741         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
18742         makes cs0031.cs actually work.
18743
18744 2003-07-20  Martin Baulig  <martin@ximian.com>
18745
18746         * namespace.cs: Fixed that bug which caused a crash when compiling
18747         the debugger's GUI.
18748
18749 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * typemanager.cs (LookupTypeReflection): Never expose types which
18752         are NotPublic, NestedPrivate, NestedAssembly, or
18753         NestedFamANDAssem.  We used to return these, and later do a check
18754         that would report a meaningful error, but the problem is that we
18755         would not get the real match, if there was a name override.
18756
18757 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
18758
18759         * namespace.cs (Namespace, Name): Do not compute the namespace
18760         name dynamically, compute it in the constructor.  This reduced
18761         memory usage by 1697 KB.
18762
18763         * driver.cs: Use --pause to pause at the end.
18764
18765 2003-07-17  Peter Williams  <peter@newton.cx>
18766
18767         * Makefile: Change the name of the test target so that it doesn't
18768         conflict with the recursive test target.
18769
18770 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
18771
18772         * expression.cs (LocalVariableReference.Emit, EmitAssign,
18773         AddressOf): Do not use EmitThis, that was wrong, use the actual
18774         this pointer.
18775
18776 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * class.cs (MethodData.Define): While checking if a method is an
18779         interface implementation, improve the test: If we are not public
18780         (use new test here: use the computed MethodAttributes directly,
18781         instead of the parsed modifier flags) check if the `implementing'
18782         method comes from an interface or not.
18783
18784         * pending.cs (VerifyPendingMethods): Slightly better error
18785         message.
18786
18787         * makefile: add test target that does the mcs bootstrap.
18788
18789 2003-07-16  Ravi Pratap  <ravi@ximian.com>
18790
18791         * interface.cs (Define): Do nothing here since there are no
18792         members to populate etc. Move the attribute emission out of here
18793         since this was just totally the wrong place to put it. Attribute
18794         application happens during the 'Emit' phase, not in the 'Define'
18795         phase.
18796
18797         (Emit): Add this method and move the attribute emission here
18798
18799         * rootcontext.cs (EmitCode): Call the Emit method on interface
18800         types too.
18801
18802 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
18803
18804         * expression.cs (OverloadResolve): Report error only if Location
18805         is not 'Null' which means that there was a probe going on.
18806
18807 2003-07-14  Martin Baulig  <martin@ximian.com>
18808
18809         * expression.cs (ConditionalLogicalOperator): New public class to
18810         implement user defined conditional logical operators.
18811         This is section 14.11.2 in the spec and bug #40505.
18812
18813 2003-07-14  Martin Baulig  <martin@ximian.com>
18814
18815         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
18816
18817 2003-07-14  Martin Baulig  <martin@ximian.com>
18818
18819         * codegen.cs (EmitContext.InFixedInitializer): New public field.
18820
18821         * ecore.cs (IVariable.VerifyFixed): New interface method.
18822
18823         * expression.cs (Unary.ResolveOperator): When resolving the `&'
18824         operator, check whether the variable is actually fixed.  Fixes bug
18825         #36055.  Set a variable definitely assigned when taking its
18826         address as required by the spec.
18827
18828         * statement.cs (LocalInfo.IsFixed): New field.
18829         (LocalInfo.MakePinned): Set `IsFixed' to true.
18830
18831 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
18832
18833         * attribute.cs (Attribute.Resolve): While doing a Member lookup
18834         for .ctors, ensure that we only ask for members declared in the
18835         attribute type (BindingFlags.DeclaredOnly).
18836
18837         Fixes bug #43632.
18838
18839         * expression.cs (Error_WrongNumArguments): Report error 1501
18840         correctly the way CSC does.
18841
18842 2003-07-13  Martin Baulig  <martin@ximian.com>
18843
18844         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
18845         lookup on the fully qualified name, to make things like "X.X" work
18846         where "X.X" is a fully qualified type name, but we also have a
18847         namespace "X" in the using list.  Fixes #41975.
18848
18849 2003-07-13  Martin Baulig  <martin@ximian.com>
18850
18851         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
18852         function. If we're a CompoundAssign, we need to create an embedded
18853         CompoundAssign, not an embedded Assign.
18854         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
18855         Fixes #45854.
18856
18857 2003-07-13  Martin Baulig  <martin@ximian.com>
18858
18859         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
18860         work to fix bug #46088.
18861
18862 2003-07-13  Ravi Pratap <ravi@ximian.com>
18863
18864         * class.cs (Operator.Emit): Do not emit attributes here - it is
18865         taken care of by the Method class that we delegate too. This takes
18866         care of bug #45876.
18867
18868 2003-07-10  Martin Baulig  <martin@ximian.com>
18869
18870         * expression.cs (TypeOfVoid): New class.
18871         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
18872
18873 2003-07-10  Martin Baulig  <martin@ximian.com>
18874
18875         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
18876         bug #35957.
18877
18878 2003-07-10  Martin Baulig  <martin@ximian.com>
18879
18880         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
18881         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
18882
18883         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
18884
18885         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
18886
18887 2003-07-10  Martin Baulig  <martin@ximian.com>
18888
18889         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
18890         of decimal.  Fixes #42850.
18891
18892         NOTE: I also fixed the created byte blob, but this doesn't work on
18893         the MS runtime and csc never produces any byte blobs for decimal
18894         arrays.
18895
18896 2003-07-10  Martin Baulig  <martin@ximian.com>
18897
18898         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
18899         structs; fixes #32068.
18900         (Block.AddChildVariableNames): Fixed #44302.
18901
18902 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18903
18904         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
18905
18906 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * attribute.cs: And this test is onger needed.
18909
18910 2003-07-08  Martin Baulig  <martin@ximian.com>
18911
18912         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
18913         inaccessible types.  Fixes #36313.
18914
18915         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
18916
18917         * namespace.cs (NamespaceEntry): Create implicit entries for all
18918         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
18919         implicit entries for N1.N2 and N1.
18920
18921 2003-07-08  Martin Baulig  <martin@ximian.com>
18922
18923         Rewrote the handling of namespaces to fix a lot of the issues
18924         wrt. `using' aliases etc.
18925
18926         * namespace.cs (Namespace): Splitted this class into a
18927         per-assembly `Namespace' and a per-file `NamespaceEntry'.
18928
18929         * typemanager.cs (TypeManager.IsNamespace): Removed.
18930         (TypeManager.ComputeNamespaces): Only compute namespaces from
18931         loaded assemblies here, not the namespaces from the assembly we're
18932         currently compiling.
18933
18934 2003-07-08  Martin Baulig  <martin@ximian.com>
18935
18936         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
18937
18938 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18939
18940         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
18941         already fixed it.  
18942
18943         I thought about the memory savings here, but LookupTypeReflection
18944         is used under already very constrained scenarios.  Compiling
18945         corlib or mcs only exposes one hit, so it would not really reduce
18946         any memory consumption.
18947
18948 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18949
18950         * typemanager.cs: fixes bug #45889 by only adding public types from
18951         other assemblies to the list of known types.
18952
18953 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18954
18955         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
18956         on the type we resolved.
18957
18958 2003-07-05  Martin Baulig  <martin@ximian.com>
18959
18960         * pending.cs (PendingImplementation.ParentImplements): Don't
18961         create the proxy if the parent is abstract.
18962
18963         * class.cs (TypeContainer.DefineIndexers): Process explicit
18964         interface implementations first.  Fixes #37714.
18965
18966 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
18967
18968         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
18969         defined recursively;  but since we modify the input parameters
18970         (left is set to `this' temporarily), we reset this value if the
18971         left_is_explicit is false, which gives the original semantics to
18972         the code.  
18973
18974         * literal.cs (NullPointer): new class used to represent a null
18975         literal in a pointer context.
18976
18977         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
18978         type is a pointer, use a NullPointer object instead of a
18979         NullLiteral.   Closes 43687
18980
18981         (ExplicitConversion): Convert pointer values using
18982         the conv opcode to the proper type.
18983
18984         * ecore.cs (New): change ValueTypeVariable property into a method,
18985         that returns whether the valuetype is suitable for being used.
18986
18987         * expression.cs (Binary.DoNumericPromotions): Only return if we
18988         the int constant was a valid uint, and we can return both left and
18989         right as uints.  If not, we continue processing, to trigger the
18990         type conversion.  This fixes 39018.
18991
18992         * statement.cs (Block.EmitMeta): During constant resolution, set
18993         the CurrentBlock property on the emitcontext, so that we resolve
18994         constants propertly.
18995
18996 2003-07-02  Martin Baulig  <martin@ximian.com>
18997
18998         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
18999         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19000
19001         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19002         than emitting it here.
19003
19004         * statement.cs: Fixed some more flow analysis bugs.
19005
19006 2003-07-02  Martin Baulig  <martin@ximian.com>
19007
19008         * class.cs (MethodData.Define): When implementing interface
19009         methods, set Final unless we're Virtual.
19010
19011         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19012         check work for interface methods.
19013
19014 2003-07-01  Martin Baulig  <martin@ximian.com>
19015
19016         * ecore.cs (EmitContext.This): Replaced this property with a
19017         GetThis() method which takes a Location argument.  This ensures
19018         that we get the correct error location for a CS0188.
19019
19020 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19021
19022         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19023         ImplicitStandardConversion.
19024
19025         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19026
19027 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19028
19029         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19030         optimization.
19031
19032 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19033
19034         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19035         constructors.
19036
19037         (MethodData.Define): Turn off initlocals for unsafe methods.
19038
19039 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19042         complete;  Fixes #37521.
19043
19044         * delegate.cs: Use Modifiers.TypeAttr to compute the
19045         TypeAttributes, instead of rolling our own.  This makes the flags
19046         correct for the delegates.
19047
19048 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19049
19050         * class.cs (Constructor.Define): Set the private flag for static
19051         constructors as well.
19052
19053         * cs-parser.jay (statement_expression): Set the return value to
19054         null, to avoid a crash when we catch an error.
19055
19056 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19057
19058         * cs-parser.jay: Applied patch from Jackson that adds support for
19059         extern and unsafe modifiers to destructor declarations.
19060
19061         * expression.cs: Report error 21 if the user is trying to index a
19062         System.Array.
19063
19064         * driver.cs: Add an error message, suggested by the bug report.
19065
19066         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19067         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19068
19069 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * namespace.cs: Add some information to reduce FAQs.
19072
19073 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19074
19075         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19076         underlying enumeration types.  Fixes #43915.
19077
19078         * expression.cs: Treat ushort/short as legal values to be used in
19079         bitwise operations.
19080
19081 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19082
19083         * delegate.cs: transfer custom attributes for paramenters from
19084         the delegate declaration to Invoke and BeginInvoke.
19085
19086 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19087
19088         * attribute.cs: handle custom marshalers and emit marshal info
19089         for fields, too.
19090
19091 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19092
19093         * makefile.gnu: Added anonymous.cs to the compiler sources.
19094
19095 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19096
19097         * iterators.cs: Change the name of the proxy class to include two
19098         underscores.
19099
19100         * cs-parser.jay: Update grammar to include anonymous methods.
19101
19102         * anonymous.cs: new file.
19103
19104 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19105
19106         * class.cs (Field.Define): Add missing test for pointers and
19107         safety. 
19108
19109 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19110
19111         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19112         we use the stobj opcode.
19113
19114         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19115         since it wasn't the correct fix. 
19116
19117         It still is puzzling that we are required to use stobj for IntPtr
19118         which seems to be a ValueType.
19119
19120 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19123         during regular simple name resolution.   Now, the trick is that
19124         instead of returning for processing the simplename, we do a
19125         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19126         contextual lookup type).   If a match is found, return that, if
19127         not, return for further composition.
19128
19129         This fixes long-standing 30485.
19130
19131         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19132         using the address to initialize an object, do an Stobj instead of
19133         using the regular Stelem.
19134
19135         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19136         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19137         Because if we are a BaseIndexerAccess that value will be true.
19138         Fixes 43643.
19139
19140         * statement.cs (GotoCase.Resolve): Return after reporting an
19141         error, do not attempt to continue. 
19142
19143         * expression.cs (PointerArithmetic.Emit): If our operand is a
19144         long, convert our constants to match the operand before
19145         multiplying.  Convert to I type before adding.   Fixes 43670.
19146
19147 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19148
19149         * enum.cs (ImplicitConversionExists) : Rename to
19150         ImplicitEnumConversionExists to remove ambiguity. 
19151
19152         * ecore.cs (NullCast): New type of cast expression class which
19153         basically is very similar to EmptyCast with the difference being
19154         it still is a constant since it is used only to cast a null to
19155         something else
19156         (eg. (string) null)
19157
19158         * convert.cs (ImplicitReferenceConversion): When casting a null
19159         literal, we return a NullCast.
19160
19161         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19162         should be around anymore.
19163
19164         The renaming (reported was slightly wrong). Corrections:
19165
19166         ConvertImplicitStandard -> ImplicitConversionStandard
19167         ConvertExplicitStandard -> ExplicitConversionStandard
19168
19169         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19170         before passing them in !
19171
19172         * convert.cs (ImplicitConversionStandard): When comparing for
19173         equal expr and target types, ensure that expr is not a
19174         NullLiteral.
19175
19176         In general, we must not be checking (expr_type ==
19177         target_type) in the top level conversion methods
19178         (ImplicitConversion, ExplicitConversion etc). This checking is
19179         done in the methods that they delegate to.
19180
19181 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19182
19183         * convert.cs: Move Error_CannotConvertType,
19184         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19185         ImplicitNumericConversion, ImplicitConversionExists,
19186         ImplicitUserConversionExists, StandardConversionExists,
19187         FindMostEncompassedType, FindMostSpecificSource,
19188         FindMostSpecificTarget, ImplicitUserConversion,
19189         ExplicitUserConversion, GetConversionOperators,
19190         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19191         TryImplicitIntConversion, Error_CannotConvertImplicit,
19192         ConvertImplicitRequired, ConvertNumericExplicit,
19193         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19194         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19195         its own file.
19196
19197         Perform the following renames:
19198
19199         StandardConversionExists -> ImplicitStandardConversionExists
19200         ConvertImplicit -> ImplicitConversion
19201         ConvertImplicitStandard -> ImplicitStandardConversion
19202         TryImplicitIntConversion -> ImplicitIntConversion
19203         ConvertImplicitRequired -> ImplicitConversionRequired
19204         ConvertNumericExplicit -> ExplicitNumericConversion
19205         ConvertReferenceExplicit -> ExplicitReferenceConversion
19206         ConvertExplicit -> ExplicitConversion
19207         ConvertExplicitStandard -> ExplicitStandardConversion
19208
19209 2003-05-19  Martin Baulig  <martin@ximian.com>
19210
19211         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19212         (TypeInfo): Added support for structs having structs as fields.
19213
19214         * ecore.cs (FieldExpr): Implement IVariable.
19215         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19216         VariableInfo for the field.
19217
19218 2003-05-18  Martin Baulig  <martin@ximian.com>
19219
19220         * expression.cs (This.DoResolve): Report a CS0027 if we're
19221         emitting a field initializer.
19222
19223 2003-05-18  Martin Baulig  <martin@ximian.com>
19224
19225         * expression.cs (This.ResolveBase): New public function.
19226         (This.DoResolve): Check for CS0188.
19227
19228         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19229         This.Resolve().
19230
19231         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19232         `instance_expression' to null if we don't have any non-static
19233         methods.
19234
19235 2003-05-18  Martin Baulig  <martin@ximian.com>
19236
19237         Reworked the way how local variables and parameters are handled by
19238         the flow analysis code.
19239
19240         * statement.cs (TypeInfo, VariableMap): New public classes.
19241         (VariableInfo): New public class.  This is now responsible for
19242         checking whether a variable has been assigned.  It is used for
19243         parameters and local variables.
19244         (Block.EmitMeta): Take the InternalParameters as argument; compute
19245         the layout of the flow vectors here.
19246         (Block.LocalMap, Block.ParameterMap): New public properties.
19247         (FlowBranching): The .ctor doesn't get the InternalParameters
19248         anymore since Block.EmitMeta() now computes the layout of the flow
19249         vector.
19250         (MyStructInfo): This class is now known as `StructInfo' and nested
19251         in `TypeInfo'; we don't access this directly anymore.
19252
19253         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19254         property and removed IsAssigned(), IsFieldAssigned(),
19255         SetAssigned() and SetFieldAssigned(); we now call them on the
19256         VariableInfo so we don't need to duplicate this code everywhere.
19257
19258         * expression.cs (ParameterReference): Added `Block block' argument
19259         to the .ctor.
19260         (LocalVariableReference, ParameterReference, This): The new
19261         VariableInfo class is now responsible for all the definite
19262         assignment stuff.
19263
19264         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19265         IsParameterAssigned, SetParameterAssigned): Removed.
19266
19267 2003-05-18  Martin Baulig  <martin@ximian.com>
19268
19269         * typemanager.cs (InitCoreTypes): Try calling
19270         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19271         the 3-args-version.  Corlib now also needs our `void_type'.
19272         (GetMethod): Added overloaded version which takes an optional
19273         `bool report_errors' to allow lookups of optional methods.
19274
19275 2003-05-12  Martin Baulig  <martin@ximian.com>
19276
19277         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19278         only used for locals and not for parameters.
19279
19280 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19281
19282         * support.cs (InternalParameters.ParameterType): Return the
19283         ExternalType of the parameter.
19284
19285         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19286         they were unused.
19287
19288 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19289
19290         * class.cs (MethodData.Define): Do not set the `newslot' on
19291         interface members, if they are also flagged as "override".
19292
19293         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19294         better code for ++i and i++.  This only works for static fields
19295         and local variables.
19296
19297         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19298         want to pull the DeclSpace out of the builder_to_declspace instead
19299         of the TypeBuilder (like in TypeContainer.FindMembers).
19300
19301         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19302         instead of LookupTypeContainer.  Fixes the crash on .NET for
19303         looking up interface members.
19304
19305         * const.cs: Create our own emit context during the Definition
19306         stage, so that constants are evaluated in the proper context, when
19307         a recursive definition happens.
19308
19309 2003-05-11  Martin Baulig  <martin@ximian.com>
19310
19311         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19312         new block for a switch section.
19313         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19314         the adding/lookup in the switch block.  Fixes #39828.
19315
19316 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19317
19318         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19319         functionality: I needed to convert the data after I had performed
19320         the add/sub operation into the operands type size.
19321
19322         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19323         pass the type for the box operation, otherwise the resulting
19324         object would have been of type object.
19325
19326         (BoxedCast): Add constructor to specify the type to box as.
19327
19328 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
19329
19330         * iterators.cs: I was reusing the `count' variable inadvertently,
19331         take steps to not allow this to happen.
19332
19333 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
19334
19335         * attribute.cs (Attribute.Resolve): Params attributes are encoded
19336         by creating an array at the point where the params starts and
19337         putting all those arguments there, then adjusting the size of the
19338         array.
19339
19340 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
19341
19342         * expression.cs (New.AddressOf): Implement interface
19343         IMemoryLocation.  This is used when the `new' operator is used in
19344         the context of an invocation to a method on a value type.
19345
19346         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19347         example. 
19348
19349         * namespace.cs: Also check the using aliases here.
19350
19351         * driver.cs: Move the test for using validity after the types have
19352         been entered, so we do a single pass that also includes the using
19353         aliases. 
19354
19355         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19356         in the regular case.   CreateSiblingForFinally is doing extra
19357         error checking.
19358
19359         * attribute.cs (GetAttributeArgumentExpression): Store the result
19360         on an out value, and use the return value to indicate failure
19361         instead of using null (which is a valid return for Constant.GetValue).
19362
19363         * statement.cs: Perform the analysis flow for the increment
19364         portion after the statement, because this will be the real flow of
19365         execution.  Fixes #42385
19366
19367         * codegen.cs (EmitContext.EmitArgument,
19368         EmitContext.EmitStoreArgument): New helper functions when the
19369         RemapToProxy flag is set.
19370
19371         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19372         function.
19373
19374         Add support for remapping parameters. 
19375
19376         * iterators.cs: Propagate parameter values;  Store parameter
19377         values in the proxy classes.
19378
19379 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
19382         need a proxy reference;  I do not know what I was thinking
19383
19384         * cs-parser.jay (constructor_initializer): catch another error,
19385         and display nice message.
19386
19387         (field_declaration): catch void field declaration
19388         to flag a better error. 
19389
19390         * class.cs (MemberBase.CheckBase): Report an error instead of a
19391         warning if a new protected member is declared in a struct. 
19392         (Field.Define): catch the error of readonly/volatile.
19393
19394         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19395
19396         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
19397         volatile variable is taken
19398
19399 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
19400
19401         * statement.cs (Fixed.Resolve): Report an error if we are not in
19402         an unsafe context.
19403
19404 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
19405
19406         * typemanager.cs: reuse the code that handles type clashes for
19407         delegates and enumerations.
19408
19409         * class.cs (Report28): Always report.
19410
19411         * expression.cs (EncodeAsAttribute): Allow nulls here.
19412
19413 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
19414
19415         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19416         the functionality for testing whether an expression is valid for
19417         an attribute here.  Also handle the case of arrays of elements
19418         being stored. 
19419
19420         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19421         encoding a linear array into an array of objects that are suitable
19422         to be passed to an CustomAttributeBuilder.
19423
19424         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19425
19426         * ecore.cs: (FieldExpr): Handle field remapping here.
19427
19428         * iteratators.cs: Pass the instance variable (if the method is an
19429         instance method) to the constructors, so we can access the field
19430         variables on the class.
19431
19432         TODO: Test this with structs.  I think the THIS variable on
19433         structs might have to be a pointer, and not a refenrece
19434
19435 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
19436
19437         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19438         local variables to fields in a proxy class.
19439
19440         * iterators.cs (PopulateProxy): Rename our internal fields to
19441         <XXX>.  
19442         Create a <THIS> field if we are an instance method, so we can
19443         reference our parent container variables.
19444         (MapVariable): Called back from the EmitContext code to enter a
19445         new variable to field mapping into the proxy class (we just create
19446         a FieldBuilder).
19447
19448         * expression.cs
19449         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19450         for using the remapped locals to fields.
19451
19452         I placed the code here, because that gives the same semantics to
19453         local variables, and only changes the Emit code.
19454
19455         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19456         statements inside iterators.
19457         (VariableInfo): Add a FieldBuilder for the cases when we are
19458         remapping local variables to fields in a proxy class
19459
19460         * ecore.cs (SimpleNameResolve): Avoid testing two times for
19461         current_block != null.
19462
19463         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19464         not cope with strings, as it has been moved to the
19465         TableSwitchEmit.  Fixed bug in switch generation.
19466
19467         * expression.cs (New.DoResolve): Provide more context for the user
19468         when reporting an error.
19469
19470         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19471         pointers. 
19472
19473         * expression.cs (MemberAccess.DoResolve): When we get a type back,
19474         check the permissions for it.  Note than in a type-resolution
19475         context the check was already present in DeclSpace.ResolveType,
19476         but was missing from the MemberAccess.
19477
19478         (ArrayCreation.CheckIndices): warn if the user has
19479         more nested levels of expressions, but there are no more
19480         dimensions specified.  Avoids crash on bug 41906.
19481
19482 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
19483
19484         * statement.cs (Block): replace Implicit bool, for a generic
19485         flags.   
19486         New flag: `Unchecked'.  This is used during the EmitMeta phase
19487         (which is out-of-line with the regular Resolve/Emit process for a
19488         statement, as this is done ahead of time, but still gets a chance
19489         to call constant resolve).
19490
19491         (Block.Flags): new enum for adding a new flag.
19492
19493         (Block.EmitMeta): track the state of unchecked.
19494
19495         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19496         to enable constant resolution to work there as well.
19497
19498 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
19499
19500         * typemanager.cs (ienumerable_type): Also look up
19501         System.Collections.IEnumerable. 
19502
19503 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
19504
19505         TODO: Test more than one conditional per method.
19506
19507         * class.cs (Indexer.Define): Report the location where the user is
19508         referencing the unsupported feature.
19509
19510         (MethodData): Overload the use of `conditionals' to
19511         minimize the creation of needless ArrayLists.   This saves roughly
19512         212kb on my machine.
19513
19514         (Method): Implement the new IIteratorContainer interface.
19515         (Method.SetYields): Implement the method by setting the ModFlags
19516         to contain METHOD_YIELDS.
19517
19518         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19519         which just got set to null.
19520
19521         * iterators.cs: New file.
19522
19523         (Yield, YieldBreak): New statements.
19524
19525         * statement.cs (Return.Resolve): Flag an error if we are used in
19526         an iterator method.
19527
19528         * codegen.cs (InIterator): New flag set if the code is being
19529         compiled in an iterator method.
19530
19531         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
19532         internal modifier, and we just use it to avoid adding extra
19533         fields, as this is seldom used.  
19534
19535         * cs-parser.jay: Add yield_statement (yield and yield break).
19536
19537         * driver.cs: New flag -v2 to turn on version 2 features. 
19538
19539         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19540         hashtable when v2 is enabled.
19541
19542 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19545         there is already a namespace defined with this name.
19546
19547         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19548         people upgraded their corlibs.
19549
19550         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19551         always use fully qualified types, no need to use the compiler
19552         front end.
19553
19554         (TypeManager.IsNamespace): Use binarysearch.
19555
19556         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19557         AddDelegate): I did not quite use the new IsValid API properly: I
19558         have to pass the short-name and the fullname.  I was passing only
19559         the basename instead of the fullname sometimes. 
19560
19561         (TypeContainer.DefineType): call NamespaceClash.
19562
19563         * interface.cs (Interface.DefineType): use NamespaceClash before
19564         defining the type.
19565
19566         * delegate.cs (Delegate.DefineType): use NamespaceClash before
19567         defining the type.
19568
19569         * enum.cs: (Enum.DefineType): use NamespaceClash before
19570         defining the type.
19571
19572         * typemanager.cs (: 3-line patch that gives us some tasty 11%
19573         speed increase.  First, use the negative_hits cache when we get a
19574         negative.  Second, add the type with its full original name
19575         instead of the new . and + encoded name (reflection uses + to
19576         separate type from a nested type).  Use LookupTypeReflection
19577         directly which bypasses the type->name hashtable (that we already
19578         know does not contain the type.
19579
19580         * decl.cs (DeclSpace.ResolveTypeExpr): track the
19581         location/container type. 
19582
19583         * driver.cs: When passing utf8, use directly the UTF8Encoding.
19584
19585 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
19586
19587         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19588
19589         * delegate.cs (NewDelegate.Resolve): Test whether an instance
19590         method is being referenced in the method group from a static
19591         context, and report error 120 if so.
19592
19593         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19594         Error118. 
19595
19596         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19597         is created, we create the A namespace).
19598
19599         * cs-parser.jay: A namespace also introduces a DeclarationFound.
19600         Fixes #41591
19601
19602 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19605         invocation to ModuleBuilder.GetType with the same values will
19606         return a new type instance, so we need to cache its return
19607         values. 
19608
19609         * expression.cs (Binary.ResolveOperator): Only allow the compare
19610         operators on enums if they are of the same type.
19611
19612         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19613         types of ValueType on their own case.  Before we were giving them
19614         the same treatment as objects.
19615
19616         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19617         fullname.  Short name is used to compare against container name.
19618         Fullname is used to check against defined namespace names.
19619
19620         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19621         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19622
19623         (Method.CheckBase): Call parent.
19624         (MemberBase.CheckBase): Check for protected members on sealed
19625         classes.
19626         (PropertyBase.CheckBase): Call parent.
19627         (Field.Define): Call parent.
19628
19629         * report.cs: Negative error codes are now mapped to 8000 - code,
19630         so that the display is render more nicely.
19631
19632         * typemanager.cs: Do not use try/catch, instead report a regular
19633         error. 
19634
19635         (GetPointerType, GetReferenceType): These methods provide
19636         mechanisms to obtain the T* and T& from a T.  We had the code
19637         previously scattered around the code base, and it also used
19638         TypeManager.LookupType that would go through plenty of caches.
19639         This one goes directly to the type source.
19640
19641         In some places we did the Type.GetType followed by
19642         ModuleBuilder.GetType, but not in others, so this unifies the
19643         processing as well.
19644
19645         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19646         statements now that we have namespace information.
19647
19648         * typemanager.cs (IsNamespace): New method, returns whether the
19649         string presented is a namespace or not.
19650
19651         (ComputeNamespaces): New public entry point, computes the list of
19652         available namespaces, using the GetNamespaces API call in Mono, or
19653         the slower version in MS.NET.   
19654
19655         Now before we start the semantic analysis phase, we have a
19656         complete list of namespaces including everything that the user has
19657         provided.
19658
19659         Deleted old code to cache namespaces in .nsc files.
19660
19661 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
19662
19663         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19664         class/struct location definition Location for the implicit
19665         constructor location.
19666
19667         (Operator.Define): Use the location of the operator for the
19668         implicit Method definition.
19669
19670         (Constructor.Emit): use the constructor location for the implicit
19671         base initializer constructor.
19672
19673         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
19674         and the Expression class now contains two new methods:
19675
19676         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
19677         isolate type lookup from the rest of the resolution process.
19678
19679         Since we use Expressions to hold type definitions due to the way
19680         we parse the input we have historically overloaded Resolve to
19681         perform the Type lookups if a special flag is passed.  Now this is
19682         eliminated and two methods take their place. 
19683
19684         The differences in the two methods between xStep and xTerminal is
19685         that xStep is involved in our current lookup system that uses
19686         SimpleNames to compose a name, while xTerminal is used just to
19687         catch the case where the simplename lookup failed.
19688
19689 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
19690
19691         * expression.cs (ResolveMemberAccess): Remove redundant code.
19692         TypeExpr expressions are always born fully resolved.
19693
19694         * interface.cs (PopulateMethod): Do not lookup the types twice.
19695         We were doing it once during SemanticAnalysis and once during
19696         PopulateMethod.
19697
19698         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
19699         in local variable type definitions, were being returned as a
19700         SimpleName (we decomposed everything into a string), that is
19701         because primary_expression was being used instead of a type in the
19702         grammar (reduce/reduce conflicts).
19703
19704         The part that was wrong is that we converted the expression into a
19705         string (an oversimplification in one hand, compounded with primary
19706         expressions doing string concatenation).
19707
19708         So things like:
19709
19710         A.B.C [] x;
19711
19712         Would return "A.B.C[]" as a SimpleName.  This stopped things like
19713         using clauses from working on this particular context.  And a type
19714         was being matched directly against "A.B.C[]".
19715
19716         We now use the correct approach, and allow for ComposedCast to be
19717         part of the unary expression.  So the "A.B.C []" become a composed
19718         cast of "A.B.C" (as a nested group of MemberAccess with a
19719         SimpleName at the end) plus the rank composition "[]". 
19720
19721         Also fixes 35567
19722
19723 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
19724
19725         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
19726         for the access level checking.
19727
19728         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
19729         `TypeContainer container', because I kept getting confused when I
19730         was debugging this code.
19731
19732         * expression.cs (Indexers): Instead of tracking getters/setters,
19733         we now track them in parallel.  We create one arraylist less, but
19734         most importantly it is possible now for the LValue code to find a
19735         matching get for a set.
19736
19737         (IndexerAccess.DoResolveLValue): Update the code.
19738         GetIndexersForType has been modified already to extract all the
19739         indexers from a type.  The code assumed it did not.
19740
19741         Also make the code set the correct return type for the indexer.
19742         This was fixed a long time ago for properties, but was missing for
19743         indexers.  It used to be void_type.
19744
19745         (Binary.Emit): Test first for doubles instead of
19746         floats, as they are more common.
19747
19748         (Binary.EmitBranchable): Use the .un version of the branch opcodes
19749         when dealing with floats and the <=, >= operators.  This fixes bug
19750         #39314 
19751
19752         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
19753         to load the array value by emitting a load on the foreach variable
19754         type.  This was incorrect.  
19755
19756         We now emit the code to load an element using the the array
19757         variable type, and then we emit the conversion operator.
19758
19759         Fixed #40176
19760
19761 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
19762
19763         * attribute.cs: Avoid allocation of ArrayLists in the common case.
19764
19765 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
19766
19767         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
19768         test for protection before we test for signatures. 
19769
19770         (MethodSignature.ToString): implement.
19771
19772         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
19773         to the case where we reduced into a LongConstant.
19774
19775         * decl.cs (CheckAccessLevel): If the type is an array, we can not
19776         depend on whether the information is acurrate, because the
19777         Microsoft runtime will always claim that the array type is public,
19778         regardless of the real state.
19779
19780         If the type is a pointer, another problem happens: the type is
19781         reported as non-public in Microsoft.  
19782
19783         In both cases we have to call CheckAccessLevel recursively with
19784         the underlying type as the argument to be tested.
19785
19786 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
19787
19788         * assign.cs (Assign.Emit): If we are dealing with a compound
19789         assignment expression, we should use the code path that stores the
19790         intermediate result in a temporary value.  This fixes #40903.
19791
19792         *expression.cs (Indirection.ToString): Provide ToString method for
19793         debugging. 
19794
19795 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
19796
19797         * class.cs: Null out fields holding references to Block objects so
19798         they can be garbage collected.
19799
19800         * expression.cs (OverloadResolve): Remove unused local.
19801
19802 2003-04-07  Martin Baulig  <martin@ximian.com>
19803
19804         * codegen.cs (EmitContext.CurrentFile): New public field.
19805         (EmitContext.Mark): Use the CurrentFile to check whether the
19806         location is in the correct file.
19807         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
19808
19809 2003-04-07  Martin Baulig  <martin@ximian.com>
19810
19811         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
19812
19813         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
19814         location.  [FIXME: The location argument which gets passed to this
19815         method is sometimes wrong!]
19816
19817 2003-04-07  Nick Drochak <ndrochak@gol.com>
19818
19819         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
19820
19821 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
19822
19823         * expression.cs (Indirection.EmitAssign): We were using the
19824         temporary, but returning immediately instead of continuing the
19825         EmitAssing flow.
19826
19827 2003-04-06  Martin Baulig  <martin@ximian.com>
19828
19829         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
19830         if it's a nested child, but also deriving from the outer class.
19831         See test 190.cs.
19832
19833         * typemanager.cs (IsNestedChildOf): Make this work if it's a
19834         nested child, but also deriving from the outer class.  See
19835         test-190.cs.
19836         (FilterWithClosure): We may access private members of the outer
19837         class if we're a nested child and deriving from the outer class.
19838         (RealMemberLookup): Only set `closure_private_ok' if the
19839         `original_bf' contained BindingFlags.NonPublic.
19840
19841 2003-04-05  Martin Baulig  <martin@ximian.com>
19842
19843         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
19844
19845 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
19846
19847         * class.cs (Event.Define): Do not allow abstract events to have
19848         initializers. 
19849
19850 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
19853         block in event declarations.
19854
19855         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
19856         value type, get its address.
19857
19858         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
19859         leaving a class on the stack instead of a boolean value (int
19860         0/1).  Change the code so we compare against null, and then the
19861         result against zero.
19862
19863         * class.cs (TypeContainer.GetClassBases): We were checking for the
19864         parent class being sealed too late.
19865
19866         * expression.cs (Binary.Emit): For <= and >= when dealing with
19867         floating point values, use cgt.un and clt.un instead of cgt and
19868         clt alone.
19869
19870 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
19871
19872         * statement.cs: Apply the same optimization as MS: skip the 
19873         GetEnumerator returning an IEnumerator, and use the one returning a 
19874         CharEnumerator instead. This allows us to avoid the try-finally block 
19875         and the boxing.
19876
19877 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
19878
19879         * cs-parser.jay: Attributes cannot be applied to
19880                          namespaces. Fixes #40473
19881
19882 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19883
19884         * class.cs:
19885         (Add*): check if the name is valid using the full name for constants,
19886         fields, properties and events.
19887
19888 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
19889
19890         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
19891         char constants to be part of the enumeration.
19892
19893         * expression.cs (Conditional.DoResolve): Add support for operator
19894         true. Implements the missing functionality from 14.12
19895
19896         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
19897         operator true/false as required by the spec.
19898
19899         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
19900         implicit conversion to boolean.
19901
19902         * statement.cs (Statement.ResolveBoolean): A boolean expression is
19903         also one where the type implements `operator true'. 
19904
19905         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
19906         get an expression that will invoke operator true based on an
19907         expression.  
19908
19909         (GetConversionOperators): Removed the hack that called op_True
19910         here.  
19911
19912         (Expression.ResolveBoolean): Move this from Statement.
19913
19914 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
19915
19916         * ecore.cs (FieldExpr): do not allow initialization of initonly
19917         fields on derived classes
19918
19919 2003-03-13  Martin Baulig  <martin@ximian.com>
19920
19921         * statement.cs (Block.Emit): Call ig.BeginScope() and
19922         ig.EndScope() when compiling with debugging info; call
19923         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
19924
19925 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * expression.cs (Indexers): Do not construct immediately, allow
19928         for new members to be appended as we go.  Fixes 38143
19929
19930 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19931
19932         * expression.cs: save/restore context when resolving an unchecked
19933         expression.
19934
19935 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
19936
19937         * cfold.cs: Catch division by zero in modulus operator during
19938         constant folding.
19939
19940 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * interface.cs (Interface.DefineMembers): Avoid defining members
19943         twice. 
19944
19945 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
19946
19947         * driver.cs: handle the +/- options for -noconfig
19948
19949         * statement.cs (Unckeched.Resolve): Also track the state of
19950         unchecked in the Resolve phase.
19951
19952 2003-02-27  Martin Baulig  <martin@ximian.com>
19953
19954         * ecore.cs (Expression.MemberLookup): Don't create a
19955         MethodGroupExpr for something which is not a method.  Fixes #38291.
19956
19957 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * class.cs (MemberBase.CheckParameters): Also check that the type
19960         is unmanaged if it is a pointer.
19961
19962         * expression.cs (SizeOf.Resolve): Add location information.
19963
19964         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
19965         a managed type is declared.
19966
19967         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
19968         parameter modifiers as well.  Fixes bug 38606
19969
19970         * class.cs: Very sad.  Am backing out the speed up changes
19971         introduced by the ArrayList -> Array in the TypeContainer, as they
19972         were not actually that much faster, and introduced a bug (no error
19973         reports on duplicated methods).
19974
19975         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
19976         source first, this will guarantee that we have a valid expression
19977         before calling in lower levels functions that will require a
19978         resolved object.  Then use this original_source in the
19979         target.ResolveLValue instead of the original source that was
19980         passed to us.
19981
19982         Another change.  Use target.Resolve instead of LValueResolve.
19983         Although we are resolving for LValues, we will let the Assign code
19984         take care of that (it will be called again from Resolve).  This
19985         basically allows code like this:
19986
19987         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
19988         class Y { void A (X x) { x [0] += o; }
19989
19990         The problem was that the indexer was trying to resolve for
19991         set_Item (idx, object o) and never finding one.  The real set_Item
19992         was set_Item (idx, X).  By delaying the process we get the right
19993         semantics. 
19994
19995         Fixes bug 36505
19996
19997 2003-02-23  Martin Baulig  <martin@ximian.com>
19998
19999         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20000         while calling DoEmit ().
20001
20002         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20003         source files; if you use the #line directive inside a method, the
20004         compiler stops emitting line numbers for the debugger until it
20005         reaches the end of the method or another #line directive which
20006         restores the original file.
20007
20008 2003-02-23  Martin Baulig  <martin@ximian.com>
20009
20010         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20011
20012 2003-02-23  Martin Baulig  <martin@ximian.com>
20013
20014         * statement.cs (Block.AddChildVariableNames): We need to call this
20015         recursively, not just for our immediate children.
20016
20017 2003-02-23  Martin Baulig  <martin@ximian.com>
20018
20019         * class.cs (Event.Define): Always make the field private, like csc does.
20020
20021         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20022         actually work, fixes bug #37521.
20023
20024 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20025
20026         * delegate.cs: When creating the various temporary "Parameters"
20027         classes, make sure that we call the ComputeAndDefineParameterTypes
20028         on those new parameters (just like we do with the formal ones), to
20029         allow them to be resolved in the context of the DeclSpace.
20030
20031         This fixes the bug that Dick observed in Bugzilla #38530.
20032
20033 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20034
20035         * expression.cs (ResolveMemberAccess): When resolving a constant,
20036         do not attempt to pull a constant if the value was not able to
20037         generate a valid constant.
20038
20039         * const.cs (LookupConstantValue): Do not report more errors than required.
20040
20041 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20042
20043         * expression.cs: fixes bug #38328.
20044
20045 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20046
20047         * class.cs: Changed all the various members that can be part of a
20048         class from being an ArrayList to be an Array of the right type.
20049         During the DefineType type_list, interface_list, delegate_list and
20050         enum_list are turned into types, interfaces, delegates and enums
20051         arrays.  
20052
20053         And during the member population, indexer_list, event_list,
20054         constant_list, field_list, instance_constructor_list, method_list,
20055         operator_list and property_list are turned into their real arrays.
20056
20057         Although we could probably perform this operation earlier, for
20058         good error reporting we need to keep the lists and remove the
20059         lists for longer than required.
20060
20061         This optimization was triggered by Paolo profiling the compiler
20062         speed on the output of `gen-sample-program.pl' perl script. 
20063
20064         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20065         not crash in methods like MemberLookupFailed that use this field.  
20066
20067         This problem arises when the compiler fails to resolve a type
20068         during interface type definition for example.
20069
20070 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20071
20072         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20073         inherit from System.Object, so we have to stop at null, not only
20074         when reaching System.Object.
20075
20076 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20077
20078         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20079         DeclaredOnly because the parent indexer might have had a different
20080         name, but did not loop until the top of the hierarchy was reached.
20081
20082         The problem this one fixes is 35492: when a class implemented an
20083         indexer from an interface, we were getting the interface method
20084         (which was abstract) and we were flagging an error (can not invoke
20085         abstract method).
20086
20087         This also keeps bug 33089 functioning, and test-148 functioning.
20088
20089         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20090         out if a method is special is to see if it is declared in a
20091         property or event, or whether it is one of the predefined operator
20092         names.   This should fix correctly #36804.
20093
20094 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20095
20096         The goal here is to remove the dependency on EmptyCast.Peel ().
20097         Killing it completely.
20098
20099         The problem is that currently in a number of places where
20100         constants are expected, we have to "probe" for an EmptyCast, and
20101         Peel, which is not the correct thing to do, as this will be
20102         repetitive and will likely lead to errors. 
20103
20104         The idea is to remove any EmptyCasts that are used in casts that
20105         can be reduced to constants, so we only have to cope with
20106         constants. 
20107
20108         This bug hunt was triggered by Bug 37363 and the desire to remove
20109         the duplicate pattern where we were "peeling" emptycasts to check
20110         whether they were constants.  Now constants will always be
20111         constants.
20112
20113         * ecore.cs: Use an enumconstant here instead of wrapping with
20114         EmptyCast.  
20115
20116         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20117         throwing me off.  By handling this we can get rid of a few hacks.
20118
20119         * statement.cs (Switch): Removed Peel() code.
20120
20121 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20122
20123         * class.cs: Location information for error 508
20124
20125         * expression.cs (New.DoResolve): Add a guard against double
20126         resolution of an expression.  
20127
20128         The New DoResolve might be called twice when initializing field
20129         expressions (see EmitFieldInitializers, the call to
20130         GetInitializerExpression will perform a resolve on the expression,
20131         and later the assign will trigger another resolution
20132
20133         This leads to bugs (#37014)
20134
20135         * delegate.cs: The signature for EndInvoke should contain any ref
20136         or out parameters as well.  We were not doing this in the past. 
20137
20138         * class.cs (Field.Define): Do not overwrite the type definition
20139         inside the `volatile' group.  Turns out that volatile enumerations
20140         were changing the type here to perform a validity test, which
20141         broke conversions. 
20142
20143 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20144
20145         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20146         and structs, we do not want to load the instance variable
20147
20148         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20149         enum_type has to be handled like an object reference (implicit
20150         conversions exists from this to object), but the regular IsClass
20151         and IsValueType tests will never return true for this one.
20152
20153         Also we use TypeManager.IsValueType instead of type.IsValueType,
20154         just for consistency with the rest of the code (this is only
20155         needed if we ever use the construct exposed by test-180.cs inside
20156         corlib, which we dont today).
20157
20158 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20159
20160         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20161         just InternalCall.
20162
20163 2003-02-09  Martin Baulig  <martin@ximian.com>
20164
20165         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20166         (Namespace.DefineNamespaces): New static public method; this is
20167         called when we're compiling with debugging to add all namespaces
20168         to the symbol file.
20169
20170         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20171         pass it to the Namespace's .ctor.
20172
20173         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20174         and MethodBase arguments; pass the namespace ID to the symwriter;
20175         pass the MethodBase instead of the token to the symwriter.
20176         (SymbolWriter.DefineNamespace): New method to add a namespace to
20177         the symbol file.
20178
20179 2003-02-09  Martin Baulig  <martin@ximian.com>
20180
20181         * symbolwriter.cs: New file.  This is a wrapper around
20182         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20183         methods here in near future.
20184
20185 2003-02-09  Martin Baulig  <martin@ximian.com>
20186
20187         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20188         ILGenerator.MarkSequencePoint() which are actually used by the
20189         symbol writer.
20190
20191 2003-02-09  Martin Baulig  <martin@ximian.com>
20192
20193         * location.cs (SourceFile): New public sealed class.  This
20194         contains the name and an index which is used in the location's token.
20195         (Location): Reserve an appropriate number of bits in the token for
20196         the source file instead of walking over that list, this gives us a
20197         really huge performance improvement when compiling with debugging.
20198
20199         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20200         `SourceFile' argument instead of a string.
20201         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20202         but don't parse/tokenize here, we need to generate the list of all
20203         source files before we do that.
20204         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20205         the files.
20206
20207         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20208         instead of a string.
20209
20210         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20211         of a string.
20212
20213 2003-02-09  Martin Baulig  <martin@ximian.com>
20214
20215         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20216         filename on `#line default'.
20217
20218 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20219
20220         * statement.cs: don't clear the pinned var when the fixed statement
20221         returns from the method (fixes bug#37752).
20222
20223 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20224
20225         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20226         to IsValueType.
20227
20228 2003-02-07  Martin Baulig  <martin@ximian.com>
20229
20230         * driver.cs: Removed the `--debug-args' command line argument.
20231
20232         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20233         automatically by the AsssemblyBuilder.
20234         (CodeGen.InitializeSymbolWriter): We don't need to call any
20235         initialization function on the symbol writer anymore.  This method
20236         doesn't take any arguments.
20237
20238 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20239
20240         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20241         from referenced assemblies as well.
20242
20243 2003-02-02  Martin Baulig  <martin@ximian.com>
20244
20245         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20246
20247 2003-02-02  Martin Baulig  <martin@ximian.com>
20248
20249         * class.cs (Constructor.Emit): Open the symbol writer before
20250         emitting the constructor initializer.
20251         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20252         single-stepping through constructor initializers.
20253
20254 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20255
20256         * class.cs: Handle error 549: do not allow virtual methods in
20257         sealed classes. 
20258
20259 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20260
20261         * decl.cs: Check access levels when resolving types
20262
20263 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20264
20265         * statement.cs: Add parameters and locals set in catch blocks that might 
20266         return to set vector
20267
20268 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20269
20270         * class.cs (Operator): Set the SpecialName flags for operators.
20271
20272         * expression.cs (Invocation.DoResolve): Only block calls to
20273         accessors and operators on SpecialName methods.
20274
20275         (Cast.TryReduce): Handle conversions from char constants.
20276
20277
20278 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20279
20280         * statement.cs: small memory and time optimization in FlowBranching.
20281
20282 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20283
20284         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20285         problem that the last fix but in the other sid (Set).
20286
20287         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20288         access when there is no indexer in the hierarchy.
20289
20290 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20291
20292         * class.cs: Combine some if statements.
20293
20294 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20295
20296         * driver.cs: fixed bug #37187.
20297
20298 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20299
20300         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20301         any indexer, it's needed to build a list with all the indexers in the
20302         hierarchy (AllGetters), else we have problems. Fixes #35653.
20303
20304 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20305
20306         * class.cs (MethodData.Define): It is wrong for an interface
20307         implementation to be static in both cases: explicit and implicit.
20308         We were only handling this in one case.
20309
20310         Improve the if situation there to not have negations.
20311
20312         * class.cs (Field.Define): Turns out that we do not need to check
20313         the unsafe bit on field definition, only on usage.  Remove the test.
20314
20315 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20316
20317         * driver.cs: use assembly.Location instead of Codebase (the latest
20318         patch made mcs fail when using MS assemblies).
20319
20320 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20321
20322         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20323         get the path to *corlib.dll.
20324
20325 2003-01-21  Nick Drochak <ndrochak@gol.com>
20326
20327         * cs-tokenizer.cs:
20328         * pending.cs:
20329         * typemanager.cs: Remove compiler warnings
20330
20331 2003-01-20  Duncan Mak  <duncan@ximian.com>
20332
20333         * AssemblyInfo.cs: Bump the version number to 0.19.
20334
20335 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20336
20337         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20338
20339 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
20340
20341         * class.cs (Constructor::Emit): Emit debugging info for constructors.
20342
20343 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
20344
20345         * cs-parser.jay: Small fix: we were not comparing the constructor
20346         name correctly.   Thanks to Zoltan for the initial pointer.
20347
20348 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20349
20350         * cs-tokenizer.cs: Set file name when specified with #line
20351
20352 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
20353
20354         * cs-parser.jay: Only perform the constructor checks here if we
20355         are named like the class;  This will help provider a better
20356         error.  The constructor path is taken when a type definition is
20357         not found, but most likely the user forgot to add the type, so
20358         report that rather than the constructor error.
20359
20360 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20361
20362         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20363         allocations.
20364
20365 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20366
20367         * cs-parser.jay: Add cleanup call.
20368
20369 2003-01-13  Duncan Mak  <duncan@ximian.com>
20370
20371         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20372         consistent with other methods.
20373
20374 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20375
20376         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20377
20378 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20379
20380         * attribute.cs: only set GuidAttr to true when we have a
20381         GuidAttribute.
20382
20383 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20384
20385         * ecore.cs:
20386         * expression.cs:
20387         * typemanager.cs: fixes to allow mcs compile corlib with the new
20388         Type.IsSubclassOf fix.
20389
20390 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
20391
20392         * expression.cs (LocalVariableReference.DoResolve): Classify a
20393         constant as a value, not as a variable.   Also, set the type for
20394         the variable.
20395
20396         * cs-parser.jay (fixed_statement): take a type instead of a
20397         pointer_type, so we can produce a better error message later.
20398
20399         * statement.cs (Fixed.Resolve): Flag types that are not pointers
20400         as an error.  
20401
20402         (For.DoEmit): Make inifinite loops have a
20403         non-conditional branch back.
20404
20405         (Fixed.DoEmit): First populate the pinned variables, then emit the
20406         statement, then clear the variables.  Before I was emitting the
20407         code once for each fixed piece.
20408
20409
20410 2003-01-08  Martin Baulig  <martin@ximian.com>
20411
20412         * statement.cs (FlowBranching.MergeChild): A break in a
20413         SWITCH_SECTION does not leave a loop.  Fixes #36155.
20414
20415 2003-01-08  Martin Baulig  <martin@ximian.com>
20416
20417         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20418         lives in the same number space than `param_map'.  Fixes #36154.
20419
20420 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
20421
20422         * cs-parser.jay (constructor_declaration): Set the
20423         Constructor.ModFlags before probing for it.  This makes the
20424         compiler report 514, 515 and 132 (the code was there, but got
20425         broken). 
20426
20427         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20428         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20429         (GotoCase.Resolve): Set `Returns' to ALWAYS.
20430
20431 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20432
20433         * enum.cs: create the enum static fields using the enum type.
20434
20435 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20436
20437         * class.cs: don't try to create the ParamBuilder for the return
20438         type if it's not needed (and handle it breaking for the ms runtime
20439         anyway).
20440
20441 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20442
20443         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20444
20445 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
20446
20447         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20448         the command.   This showed up while compiling the JANET source
20449         code, which used \r as its only newline separator.
20450
20451 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
20452
20453         * class.cs (Method.Define): If we are an operator (because it
20454         reuses our code), then set the SpecialName and HideBySig.  #36128
20455
20456 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
20457
20458         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20459         exception, report error 120 `object reference required'.
20460
20461         * driver.cs: Add --pause option, used during to measure the size
20462         of the process as it goes with --timestamp.
20463
20464         * expression.cs (Invocation.DoResolve): Do not allow methods with
20465         SpecialName to be invoked.
20466
20467 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20470         number before adding it.
20471
20472 2002-12-21  Ravi Pratap  <ravi@ximian.com>
20473
20474         * ecore.cs (StandardImplicitConversion): When in an unsafe
20475         context, we allow conversion between void * to any other pointer
20476         type. This fixes bug #35973.
20477
20478 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20479
20480         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20481         is not thrown when extensionless outputs are used 
20482
20483 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20484
20485         * rootcontext.cs: fixed compilation of corlib.
20486
20487 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
20488
20489         * attribute.cs (Attributes.Contains): Add new method.
20490
20491         * class.cs (MethodCore.LabelParameters): if the parameter is an
20492         `out' parameter, check that no attribute `[In]' has been passed.
20493
20494         * enum.cs: Handle the `value__' name in an enumeration.
20495
20496 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
20497
20498         * decl.cs: Added special case to allow overrides on "protected
20499         internal" methods
20500
20501 2002-12-18  Ravi Pratap  <ravi@ximian.com>
20502
20503         * attribute.cs (Attributes.AddAttributeSection): Rename to this
20504         since it makes much more sense.
20505
20506         (Attributes.ctor): Don't require a Location parameter.
20507
20508         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20509
20510         * attribute.cs (ApplyAttributes): Remove extra Location parameters
20511         since we already have that information per attribute.
20512
20513         * everywhere : make appropriate changes.
20514
20515         * class.cs (LabelParameters): Write the code which actually
20516         applies attributes to the return type. We can't do this on the MS
20517         .NET runtime so we flag a warning in the case an exception is
20518         thrown.
20519
20520 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * const.cs: Handle implicit null conversions here too.
20523
20524 2002-12-17  Ravi Pratap  <ravi@ximian.com>
20525
20526         * class.cs (MethodCore.LabelParameters): Remove the extra
20527         Type [] parameter since it is completely unnecessary. Instead
20528         pass in the method's attributes so that we can extract
20529         the "return" attribute.
20530
20531 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * cs-parser.jay (parse): Use Report.Error to flag errors instead
20534         of ignoring it and letting the compile continue.
20535
20536         * typemanager.cs (ChangeType): use an extra argument to return an
20537         error condition instead of throwing an exception.
20538
20539 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
20540
20541         * expression.cs (Unary.TryReduce): mimic the code for the regular
20542         code path.  Perform an implicit cast in the cases where we can
20543         implicitly convert to one of the integral types, and then reduce
20544         based on that constant.   This fixes bug #35483.
20545
20546 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20547
20548         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20549
20550 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20551
20552         * namespace.cs: fixed bug #35489.
20553
20554 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
20555
20556         * class.cs: Remove some dead code.
20557
20558         * cs-parser.jay: Estimate the number of methods needed
20559         (RootContext.MethodCount);
20560
20561         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20562         numbers instead of StringBuilders.
20563
20564         * support.cs (PtrHashtable): Add constructor with initial size;
20565         We can now reduce reallocations of the method table.
20566
20567 2002-12-10  Ravi Pratap  <ravi@ximian.com>
20568
20569         * attribute.cs (ApplyAttributes): Keep track of the emitted
20570         attributes on a per-target basis. This fixes bug #35413.
20571
20572 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20575         default to the Windows 1252 encoding.
20576
20577         (UnixParseOption): Support version, thanks to Alp for the missing
20578         pointer. 
20579
20580         * AssemblyInfo.cs: Add nice assembly information.
20581
20582         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20583         (bug 35169).
20584
20585         * cs-parser.jay: Allow a trailing comma before the close bracked
20586         in the attribute_section production.
20587
20588         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20589         address of the instance was being taken, I will take this out,
20590         because we take the address of the object immediately here.
20591
20592 2002-12-09  Ravi Pratap  <ravi@ximian.com>
20593
20594         * typemanager.cs (AreMultipleAllowed): Take care of the most
20595         obvious case where attribute type is not in the current assembly -
20596         stupid me ;-)
20597
20598 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
20599
20600         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20601         definitions, instead of doing that afterwards.  
20602
20603         Also we use a nice little hack, depending on the constructor, we
20604         know if we are a "composed" name or a simple name.  Hence, we
20605         avoid the IndexOf test, and we avoid 
20606
20607         * codegen.cs: Add code to assist in a bug reporter to track down
20608         the source of a compiler crash. 
20609
20610 2002-12-07  Ravi Pratap  <ravi@ximian.com>
20611
20612         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20613         types have been emitted for a given element and flag an error
20614         if something which does not have AllowMultiple set is used more
20615         than once.
20616
20617         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20618         attribute types and their corresponding AllowMultiple properties
20619
20620         (AreMultipleAllowed): Check the property for a given type.
20621
20622         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20623         property in the case we have a TypeContainer.
20624
20625         (Attributes.AddAttribute): Detect duplicates and just skip on
20626         adding them. This trivial fix catches a pretty gross error in our
20627         attribute emission - global attributes were being emitted twice!
20628
20629         Bugzilla bug #33187 is now fixed.
20630
20631 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
20632
20633         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20634         instead of pp_and).
20635
20636         * expression.cs (Binary.ResolveOperator): I can only use the
20637         Concat (string, string, string) and Concat (string, string,
20638         string, string) if the child is actually a concatenation of
20639         strings. 
20640
20641 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
20642
20643         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20644         context where we need a 2-character lookahead.
20645
20646         * pending.cs (PendingImplementation): Rework so we can keep track
20647         of interface types all the time, and flag those which were
20648         implemented by parents as optional.
20649
20650 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
20651
20652         * expression.cs (Binary.ResolveOperator): Use
20653         String.Concat(string,string,string) or
20654         String.Concat(string,string,string,string) when possible. 
20655
20656         * typemanager: More helper methods.
20657
20658
20659 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20660
20661         * pending.cs: remove the bogus return from GetMissingInterfaces()
20662         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20663
20664 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20665
20666         * namespace.cs: avoid duplicated 'using xxx' being added to
20667         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20668         when we get more than one 'using' statement for the same namespace.
20669         Report a CS0105 warning for it.
20670
20671 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * cs-tokenizer.cs (consume_identifier): use read directly, instead
20674         of calling getChar/putback, uses internal knowledge of it.    
20675
20676         (xtoken): Reorder tokenizer so most common patterns are checked
20677         first.  This reduces the compilation time in another 5% (from 8.11s
20678         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20679
20680         The parsing time is 22% of the compilation in mcs, and from that
20681         64% is spent on the tokenization process.  
20682
20683         I tried using a binary search for keywords, but this is slower
20684         than the hashtable.  Another option would be to do a couple of
20685         things:
20686
20687                 * Not use a StringBuilder, instead use an array of chars,
20688                   with a set value.  Notice that this way we could catch
20689                   the 645 error without having to do it *afterwards*.
20690
20691                 * We could write a hand-parser to avoid the hashtable
20692                   compares altogether.
20693
20694         The identifier consumption process takes 37% of the tokenization
20695         time.  Another 15% is spent on is_number.  56% of the time spent
20696         on is_number is spent on Int64.Parse:
20697
20698                 * We could probably choose based on the string length to
20699                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
20700                   computations. 
20701
20702         Another 3% is spend on wrapping `xtoken' in the `token' function.
20703
20704         Handle 0xa0 as whitespace (#34752)
20705
20706 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
20707
20708         * typemanager.cs (IsCLRType): New routine to tell whether a type
20709         is one of the builtin types.  
20710
20711         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
20712         typecode in more places instead of doing pointer comparissions.
20713         We could leverage some knowledge about the way the typecodes are
20714         laid out.
20715
20716         New code to cache namespaces in assemblies, it is currently not
20717         invoked, to be used soon.
20718
20719         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
20720
20721         * expression.cs (Binary.ResolveOperator): specially handle
20722         strings, and do not perform user-defined operator overloading for
20723         built-in types.
20724
20725 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
20728         internalcall as it is a pretty simple operation;  Avoid whenever
20729         possible to call Char.IsLetter.
20730
20731         (consume_identifier): Cut by half the number of
20732         hashtable calls by merging the is_keyword and GetKeyword behavior.
20733
20734         Do not short-circuit, because if we do, we
20735         report errors (ie, #if false && true would produce an invalid
20736         directive error);
20737
20738
20739 2002-11-24  Martin Baulig  <martin@ximian.com>
20740
20741         * expression.cs (Cast.TryReduce): If we're in checked syntax,
20742         check constant ranges and report a CS0221.  Fixes #33186.
20743
20744 2002-11-24  Martin Baulig  <martin@ximian.com>
20745
20746         * cs-parser.jay: Make this work for uninitialized variable
20747         declarations in the `for' initializer.  Fixes #32416.
20748
20749 2002-11-24  Martin Baulig  <martin@ximian.com>
20750
20751         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
20752         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
20753
20754 2002-11-24  Martin Baulig  <martin@ximian.com>
20755
20756         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
20757         argument; if true, we also check for user-defined conversions.
20758         This is only needed if both arguments are of a user-defined type.
20759         Fixes #30443, added test-175.cs.
20760         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
20761
20762         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
20763
20764 2002-11-24  Martin Baulig  <martin@ximian.com>
20765
20766         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
20767         function to get the store opcode.
20768         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
20769         only emit the Ldelema if the store opcode is Stobj.  You must run
20770         both test-34 and test-167 to test this.  Fixes #34529.
20771
20772 2002-11-23  Martin Baulig  <martin@ximian.com>
20773
20774         * ecore.cs (Expression.MemberLookup): Added additional
20775         `qualifier_type' argument which is used when we're being called
20776         from MemberAccess.DoResolve() and null if we're called from a
20777         SimpleName lookup.
20778         (Expression.MemberLookupFailed): New method to report errors; this
20779         does the CS1540 check and reports the correct error message.
20780
20781         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
20782         argument for the CS1540 check and redone the way how we're dealing
20783         with private members.  See the comment in the source code for details.
20784         (FilterWithClosure): Reverted this back to revision 1.197; renamed
20785         `closure_start_type' to `closure_qualifier_type' and check whether
20786         it's not null.  It was not this filter being broken, it was just
20787         being called with the wrong arguments.
20788
20789         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
20790         and pass it the correct `qualifier_type'; this also does the error
20791         handling for us.
20792
20793 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
20794
20795         * expression.cs (Invocation.EmitParams): If the we are dealing
20796         with a non-built-in value type, load its address as well.
20797
20798         (ArrayCreation): Use a a pretty constant instead
20799         of the hardcoded value 2.   Use 6 instead of 2 for the number of
20800         static initializers.  
20801
20802         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
20803         because they are not really value types, just glorified integers. 
20804
20805         * driver.cs: Do not append .exe, the CSC compiler does not do it.
20806
20807         * ecore.cs: Remove redundant code for enumerations, make them use
20808         the same code path as everything else, fixes the casting issue
20809         with enumerations in Windows.Forms.
20810
20811         * attribute.cs: Do only cast to string if it is a string, the
20812         validation happens later.
20813
20814         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
20815         people upgrade their corlibs.
20816
20817         * ecore.cs: Oops, enumerations were not following the entire code path
20818
20819 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
20820
20821         * typemanager.cs (FilterWithClosure): Commented out the test for
20822         1540 in typemanager.cs, as it has problems when accessing
20823         protected methods from a parent class (see test-174.cs). 
20824
20825         * attribute.cs (Attribute.ValidateGuid): new method.
20826         (Attribute.Resolve): Use above.
20827
20828 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
20829
20830         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
20831
20832         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
20833         handling for enumerations, as we only needed the TypeContainer
20834         functionality to begin with (this is required for the fix below to
20835         work for enums that reference constants in a container class for
20836         example). 
20837
20838         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
20839
20840         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
20841         a valid TypeBuilder to perform lookups on.o
20842
20843         * class.cs (InheritableMemberSignatureCompare): Use true in the
20844         call to GetGetMethod and GetSetMethod, because we are comparing
20845         the signature, and we need to get the methods *even* if they are
20846         private. 
20847
20848         (PropertyBase.CheckBase): ditto.
20849
20850         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
20851         GotoCase.Resolve): Use Peel on EmpytCasts.
20852
20853         * ecore.cs (EmptyCast): drop child, add Peel method.
20854
20855 2002-11-17  Martin Baulig  <martin@ximian.com>
20856
20857         * ecore.cs (EmptyCast.Child): New public property.
20858
20859         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
20860         label resolved to an EmptyCast.  Fixes #34162.
20861         (GotoCase.Resolve): Likewise.
20862         (Block.EmitMeta): Likewise.
20863
20864 2002-11-17  Martin Baulig  <martin@ximian.com>
20865
20866         * expression.cs (Invocation.BetterConversion): Prefer int over
20867         uint; short over ushort; long over ulong for integer literals.
20868         Use ImplicitConversionExists instead of StandardConversionExists
20869         since we also need to check for user-defined implicit conversions.
20870         Fixes #34165.  Added test-173.cs.
20871
20872 2002-11-16  Martin Baulig  <martin@ximian.com>
20873
20874         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
20875         with the `true' and `false' literals.  Fixes #33151.
20876
20877 2002-11-16  Martin Baulig  <martin@ximian.com>
20878
20879         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
20880         October 22nd; don't do the cs1540 check for static members.
20881
20882         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
20883         now using our own filter here and doing the cs1540 check again.
20884
20885 2002-11-16  Martin Baulig  <martin@ximian.com>
20886
20887         * support.cs (InternalParameters): Don't crash if we don't have
20888         any fixed parameters.  Fixes #33532.
20889
20890 2002-11-16  Martin Baulig  <martin@ximian.com>
20891
20892         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
20893         when looking up static methods to make this work on Windows.
20894         Fixes #33773.
20895
20896 2002-11-16  Martin Baulig  <martin@ximian.com>
20897
20898         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
20899         a setter rather than using PropertyInfo.CanWrite.
20900
20901 2002-11-15  Nick Drochak  <ndrochak@gol.com>
20902
20903         * class.cs: Allow acces to block member by subclasses. Fixes build
20904         breaker.
20905
20906 2002-11-14  Martin Baulig  <martin@ximian.com>
20907
20908         * class.cs (Constructor.Emit): Added the extern/block check.
20909         Fixes bug #33678.
20910
20911 2002-11-14  Martin Baulig  <martin@ximian.com>
20912
20913         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
20914         iteration while looking for indexers, this is needed because the
20915         indexer may have a different name in our base classes.  Fixed the
20916         error reporting (no indexers at all, not get accessor, no
20917         overloaded match).  Fixes bug #33089.
20918         (IndexerAccess.DoResolveLValue): Likewise.
20919
20920 2002-11-14  Martin Baulig  <martin@ximian.com>
20921
20922         * class.cs (PropertyBase.CheckBase): Make this work for multiple
20923         indexers.  Fixes the first part of bug #33089.
20924         (MethodSignature.InheritableMemberSignatureCompare): Added support
20925         for properties.
20926
20927 2002-11-13  Ravi Pratap  <ravi@ximian.com>
20928
20929         * attribute.cs (Attribute.Resolve): Catch the
20930         NullReferenceException and report it since it isn't supposed to
20931         happen. 
20932
20933 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
20934
20935         * expression.cs (Binary.EmitBranchable): Also handle the cases for
20936         LogicalOr and LogicalAnd that can benefit from recursively
20937         handling EmitBranchable.  The code now should be nice for Paolo.
20938
20939 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
20940
20941         * typemanager.cs (LookupType): Added a negative-hit hashtable for
20942         the Type lookups, as we perform quite a number of lookups on
20943         non-Types.  This can be removed once we can deterministically tell
20944         whether we have a type or a namespace in advance.
20945
20946         But this might require special hacks from our corlib.
20947
20948         * TODO: updated.
20949
20950         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
20951         and double which avoids a conversion from an integer to a double.
20952
20953         * expression.cs: tiny optimization, avoid calling IsConstant,
20954         because it effectively performs the lookup twice.
20955
20956 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
20957
20958         But a bogus return here to keep the semantics of the old code
20959         until the Mono runtime is fixed.
20960
20961         * pending.cs (GetMissingInterfaces): New method used to remove all
20962         the interfaces that are already implemented by our parent
20963         classes from the list of pending methods. 
20964
20965         * interface.cs: Add checks for calls after ResolveTypeExpr.
20966
20967 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
20968
20969         * class.cs (Class.Emit): Report warning 67: event not used if the
20970         warning level is beyond 3.
20971
20972         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
20973         being a NullLiteral.
20974
20975         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
20976         specifiers. 
20977
20978         * class.cs (TypeContainer.GetClassBases): Cover a missing code
20979         path that might fail if a type can not be resolved.
20980
20981         * expression.cs (Binary.Emit): Emit unsigned versions of the
20982         operators. 
20983
20984         * driver.cs: use error 5.
20985
20986 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
20987
20988         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
20989
20990 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
20991
20992         * cs-parser.jay (switch_section): A beautiful patch from Martin
20993         Baulig that fixed 33094.
20994
20995 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
20996
20997         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
20998         Check whether the base is abstract and report an error if so.
20999
21000         * expression.cs (IndexerAccess.DoResolveLValue,
21001         IndexerAccess.DoResolve): ditto. 
21002
21003         (Invocation.DoResolve): ditto.
21004
21005         (Invocation.FullMethodDesc): Improve the report string.
21006
21007         * statement.cs (Block): Eliminate IsVariableDefined as it is
21008         basically just a wrapper for GetVariableInfo.
21009
21010         * ecore.cs (SimpleName): Use new 
21011
21012         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21013         type, as we return the actual parameter ref/unref state on a
21014         different call.
21015
21016 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21017
21018         * support.cs: Return proper flags REF/OUT fixing the previous
21019         commit.  
21020
21021         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21022         not used to mean `ref' but `ref or out' in ParameterReference
21023
21024         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21025         full type signature instead of calling TypeManger.CSharpName
21026         ourselves. 
21027
21028         * support.cs (InternalParameters.ParameterDesc): Do not compare
21029         directly to the modflags, because REF/OUT will actually be bitsets
21030         if set. 
21031
21032         * delegate.cs (VerifyMethod): Check also the modifiers.
21033
21034         * cs-tokenizer.cs: Fix bug where floating point values with an
21035         exponent where a sign was missing was ignored.
21036
21037         * driver.cs: Allow multiple assemblies to be specified in a single
21038         /r: argument
21039
21040 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21041
21042         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21043         because identifiers after a parenthesis would end up in this kind
21044         of production, and we needed to desamiguate it for having casts
21045         like:
21046
21047                 (UserDefinedType *) xxx
21048
21049 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21052         we should set on the Bindingflags.NonPublic, but not turn on
21053         private_ok.  private_ok controls whether a Private member is
21054         returned (this is chekced on the filter routine), while the
21055         BindingFlags.NonPublic just controls whether private/protected
21056         will be allowed.   This fixes the problem part of the problem of
21057         private properties being allowed to be used in derived classes.
21058
21059         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21060         so we can call the children DoResolveLValue method (this will
21061         properly signal errors on lvalue assignments to base properties)
21062
21063         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21064         getter are null, and we have a property info, we know that this
21065         happened because the lookup failed, so we report an error 122 for
21066         protection level violation.
21067
21068         We also silently return if setter and getter are null in the
21069         resolve functions, this condition only happens if we have flagged
21070         the error before.  This is the other half of the problem. 
21071
21072         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21073         not have accessibility information, that is why we were returning
21074         true in the filter function in typemanager.cs.
21075
21076         To properly report 122 (property is inaccessible because of its
21077         protection level) correctly, we report this error in ResolveAccess
21078         by failing if both the setter and the getter are lacking (ie, the
21079         lookup failed). 
21080
21081         DoResolve and DoLResolve have been modified to check for both
21082         setter/getter being null and returning silently, the reason being
21083         that I did not want to put the knowledge about this error in upper
21084         layers, like:
21085
21086         int old = Report.Errors;
21087         x = new PropertyExpr (...);
21088         if (old != Report.Errors)
21089                 return null;
21090         else
21091                 return x;
21092
21093         So the property expr is returned, but it is invalid, so the error
21094         will be flagged during the resolve process. 
21095
21096         * class.cs: Remove InheritablePropertySignatureCompare from the
21097         class, as we no longer depend on the property signature to compute
21098         whether it is possible to implement a method or not.
21099
21100         The reason is that calling PropertyInfo.GetGetMethod will return
21101         null (in .NET, in Mono it works, and we should change this), in
21102         cases where the Get Method does not exist in that particular
21103         class.
21104
21105         So this code:
21106
21107         class X { public virtual int A { get { return 1; } } }
21108         class Y : X { }
21109         class Z : Y { public override int A { get { return 2; } } }
21110
21111         Would fail in Z because the parent (Y) would not have the property
21112         defined.  So we avoid this completely now (because the alternative
21113         fix was ugly and slow), and we now depend exclusively on the
21114         method names.
21115
21116         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21117         reference method, instead of using the property.
21118
21119         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21120         routines are gone now.
21121
21122         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21123         names, they were incorrectly named.
21124
21125         * cs-tokenizer.cs: Return are more gentle token on failure. 
21126
21127         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21128         had an out-of-sync index variable, which caused it to remove from
21129         the list of pending methods the wrong method sometimes.
21130
21131 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21134         CanWrite, because those refer to this particular instance of the
21135         property, and do not take into account the fact that we can
21136         override single members of a property.
21137
21138         Constructor requires an EmitContext.  The resolution process does
21139         not happen here, but we need to compute the accessors before,
21140         because the resolution does not always happen for properties.
21141
21142         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21143         subclass, before we did not update this flag, but we did update
21144         bindingflags. 
21145
21146         (GetAccessors): Drop this routine, as it did not work in the
21147         presence of partially overwritten set/get methods. 
21148
21149         Notice that this broke the cs1540 detection, but that will require
21150         more thinking. 
21151
21152 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21153
21154         * class.cs:
21155         * codegen.cs:
21156         * driver.cs: issue a warning instead of an error if we don't support
21157         debugging for the platform. Also ignore a couple of errors that may
21158         arise when trying to write the symbols. Undo my previous patch.
21159
21160 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21161
21162         * driver.cs: ignore /debug switch except for Unix platforms.
21163
21164 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21165
21166         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21167
21168 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21169
21170         * driver.cs: Do not make mcs-debug conditional, so we do not break
21171         builds that use it.
21172
21173         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21174         review this patch.  But basically after all the children variables
21175         have been merged, the value of "Breaks" was not being set to
21176         new_breaks for Switch blocks.  I think that it should be set after
21177         it has executed.  Currently I set this to the value of new_breaks,
21178         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21179         conservative, but I do not understand this code very well.
21180
21181         I did not break anything in the build, so that is good ;-)
21182
21183         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21184
21185 2002-10-20  Mark Crichton  <crichton@gimp.org>
21186
21187         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21188
21189 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21190
21191         * cfold.cs: Fixed compile blocker.
21192
21193 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21194
21195         * driver.cs: I was chekcing the key, not the file.
21196
21197 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21198
21199         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21200         message that we were generating - we just need to silently return
21201         a null.
21202
21203 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21204
21205         * class.cs (Event.Define): Change my previous commit, as this
21206         breaks the debugger.  This is a temporary hack, as it seems like
21207         the compiler is generating events incorrectly to begin with.
21208
21209         * expression.cs (Binary.ResolveOperator): Added support for 
21210         "U operator - (E x, E y)"
21211
21212         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21213         y)".
21214
21215         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21216         init-only variables, but this path did not take into account that
21217         there might be also instance readonly variables.  Correct this
21218         problem. 
21219
21220         This fixes bug 32253
21221
21222         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21223         delegates as well.
21224
21225         * driver.cs: Change the extension for modules to `netmodule'
21226
21227         * cs-parser.jay: Improved slightly the location tracking for
21228         the debugger symbols.
21229
21230         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21231         modifiers that were specified instead of the hardcoded value
21232         (FamAndAssem).  This was basically ignoring the static modifier,
21233         and others.  Fixes 32429.
21234
21235         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21236         fixed a bug in the process (32476)
21237
21238         * expression.cs (ArrayAccess.EmitAssign): Patch from
21239         hwang_rob@yahoo.ca that fixes bug 31834.3
21240
21241 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * driver.cs: Make the module extension .netmodule.
21244
21245 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21246
21247         * driver.cs: Report an error if the resource file is not found
21248         instead of crashing.
21249
21250         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21251         false, like Emit does.
21252
21253 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21254
21255         * typemanager.cs: Remove unused private member.  Also reported mcs
21256         bug to report this as a warning like csc.
21257
21258 2002-10-15  Martin Baulig  <martin@gnome.org>
21259
21260         * statement.cs (Statement.Emit): Made this a virtual method; emits
21261         the line number info and calls DoEmit().
21262         (Statement.DoEmit): New protected abstract method, formerly knows
21263         as Statement.Emit().
21264
21265         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21266
21267 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21270         have fixed a remaining problem: not every AddXXXX was adding a
21271         fully qualified name.  
21272
21273         Now everyone registers a fully qualified name in the DeclSpace as
21274         being defined instead of the partial name.  
21275
21276         Downsides: we are slower than we need to be due to the excess
21277         copies and the names being registered this way.  
21278
21279         The reason for this is that we currently depend (on the corlib
21280         bootstrap for instance) that types are fully qualified, because
21281         we dump all the types in the namespace, and we should really have
21282         types inserted into the proper namespace, so we can only store the
21283         basenames in the defined_names array.
21284
21285 2002-10-10  Martin Baulig  <martin@gnome.org>
21286
21287         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21288         from bug #31834, see the bug report for a testcase which is
21289         miscompiled.
21290
21291 2002-10-10  Martin Baulig  <martin@gnome.org>
21292
21293         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21294         flow analysis code for this.
21295
21296         * statement.cs (Do, While, For): Tell the flow analysis code about
21297         infinite loops.
21298         (FlowBranching.UsageVector): Added support for infinite loops.
21299         (Block.Resolve): Moved the dead code elimination here and use flow
21300         analysis to do it.
21301
21302 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21303
21304         * class.cs (Field.Define): Catch cycles on struct type
21305         definitions. 
21306
21307         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21308         fields if the fields are static.  We only need to check instance
21309         fields. 
21310
21311         * expression.cs (As.DoResolve): Test for reference type.
21312
21313         * statement.cs (Using.ResolveExpression): Use
21314         ConvertImplicitRequired, not ConvertImplicit which reports an
21315         error on failture
21316         (Using.ResolveLocalVariableDecls): ditto.
21317
21318         * expression.cs (Binary.ResolveOperator): Report errors in a few
21319         places where we had to.
21320
21321         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21322
21323 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
21324
21325         * expression.cs: Use StoreFromPtr instead of extracting the type
21326         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
21327
21328         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21329         an enumeration value to a System.Enum, but System.Enum is not a
21330         value type, but an class type, so we need to box.
21331
21332         (Expression.ConvertExplicit): One codepath could return
21333         errors but not flag them.  Fix this.  Fixes #31853
21334
21335         * parameter.cs (Resolve): Do not allow void as a parameter type.
21336
21337 2002-10-06  Martin Baulig  <martin@gnome.org>
21338
21339         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21340         if it's a class type and not a struct.  Fixes #31815.
21341
21342 2002-10-06  Martin Baulig  <martin@gnome.org>
21343
21344         * statement.cs: Reworked the flow analysis code a bit to make it
21345         usable for dead code elimination.
21346
21347 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21348
21349         * cs-parser.jay: allow empty source files. Fixes bug #31781.
21350
21351 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21352
21353         * expression.cs (ComposedCast.DoResolveType): A quick workaround
21354         to fix the test 165, will investigate deeper.
21355
21356 2002-10-04  Martin Baulig  <martin@gnome.org>
21357
21358         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21359         finally blocks actually work.
21360         (Try.Resolve): We don't need to create a sibling for `finally' if
21361         there is no finally block.
21362
21363 2002-10-04  Martin Baulig  <martin@gnome.org>
21364
21365         * class.cs (Constructor.Define): The default accessibility for a
21366         non-default constructor is private, not public.
21367
21368 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21369
21370         * class.cs (Constructor): Make AllowedModifiers public, add
21371         EXTERN.
21372
21373         * cs-parser.jay: Perform the modifiers test here, as the
21374         constructor for the Constructor class usually receives a zero
21375         because of the way we create it (first we create, later we
21376         customize, and we were never checking the modifiers).
21377
21378         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21379         is a version of LookupTypeReflection that includes the type-name
21380         cache.  This can be used as a fast path for functions that know
21381         the fully qualified name and are only calling into *.GetType() to
21382         obtain a composed type.
21383
21384         This is also used by TypeManager.LookupType during its type
21385         composition.
21386
21387         (LookupType): We now also track the real type name, as sometimes
21388         we can get a quey for the real type name from things like
21389         ComposedCast.  This fixes bug 31422.
21390
21391         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21392         complete type fullname, it does not have to go through the type
21393         resolution system to obtain the composed version of the type (for
21394         obtaining arrays or pointers).
21395
21396         (Conditional.Emit): Use the EmitBoolExpression to
21397         generate nicer code, as requested by Paolo.
21398
21399         (ArrayCreation.CheckIndices): Use the patch from
21400         hwang_rob@yahoo.ca to validate the array initializers. 
21401
21402 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
21403
21404         * class.cs (ConstructorInitializer.Emit): simplify code by using
21405         Invocation.EmitCall, and at the same time, fix the bugs in calling
21406         parent constructors that took variable arguments. 
21407
21408         * ecore.cs (Expression.ConvertNumericExplicit,
21409         Expression.ImplicitNumericConversion): Remove the code that
21410         manually wrapped decimal (InternalTypeConstructor call is now gone
21411         as well).
21412
21413         * expression.cs (Cast.TryReduce): Also handle decimal types when
21414         trying to perform a constant fold on the type.
21415
21416         * typemanager.cs (IsUnmanagedtype): Partially implemented.
21417
21418         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21419         that only turned off an error report, and did nothing else. 
21420
21421 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
21422
21423         * driver.cs: Handle and ignore /fullpaths
21424
21425 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
21426
21427         * expression.cs (Binary.ResolveOperator): Catch the case where
21428         DoNumericPromotions returns true, 
21429
21430         (Binary.DoNumericPromotions): Simplify the code, and the tests.
21431
21432 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
21433
21434         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21435         report error 70.
21436
21437 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
21438
21439         * ecore.cs (ConvertNumericExplicit): It is not enough that the
21440         conversion exists, but it is also required that the conversion be
21441         performed.  This manifested in "(Type64Enum) 2".  
21442
21443         * class.cs (TypeManager.AddMethod): The fix is not to change
21444         AddEnum, because that one was using a fully qualified name (every
21445         DeclSpace derivative does), but to change the AddMethod routine
21446         that was using an un-namespaced name.  This now correctly reports
21447         the duplicated name.
21448
21449         Revert patch until I can properly fix it.  The issue
21450         is that we have a shared Type space across all namespaces
21451         currently, which is wrong.
21452
21453         Options include making the Namespace a DeclSpace, and merge
21454         current_namespace/current_container in the parser.
21455
21456 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
21457
21458         * cs-parser.jay: Improve error reporting when we get a different
21459         kind of expression in local_variable_type and
21460         local_variable_pointer_type. 
21461
21462         Propagate this to avoid missleading errors being reported.
21463
21464         * ecore.cs (ImplicitReferenceConversion): treat
21465         TypeManager.value_type as a target just like object_type.   As
21466         code like this:
21467
21468         ValueType v = 1;
21469
21470         Is valid, and needs to result in the int 1 being boxed before it
21471         is assigned to the value type v.
21472
21473         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21474         to validate the enumeration name.
21475
21476         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21477         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
21478         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21479
21480         * ecore.cs (TryImplicitIntConversion): When doing an
21481         implicit-enumeration-conversion, check if the type is 64-bits and
21482         perform a conversion before passing to EnumConstant.
21483
21484 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
21485
21486         * decl.cs (Error_AmbiguousTypeReference); New routine used to
21487         report ambiguous type references.  Unlike the MS version, we
21488         report what the ambiguity is.   Innovation at work ;-)
21489
21490         (DeclSpace.FindType): Require a location argument to
21491         display when we display an ambiguous error.
21492
21493         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21494
21495         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21496
21497         * expression.cs (EmitDynamicInitializers): Apply patch from
21498         hwang_rob@yahoo.ca that fixes the order in which we emit our
21499         initializers. 
21500
21501 2002-09-21  Martin Baulig  <martin@gnome.org>
21502
21503         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21504         delegate takes no arguments.
21505
21506 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
21507
21508         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21509         from integers.
21510
21511         * expression.cs: Extract the underlying type.
21512
21513         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21514
21515         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21516
21517 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
21518
21519         * class.cs (TypeContainer.DefineType): We can not use the nice
21520         PackingSize with the size set to 1 DefineType method, because it
21521         will not allow us to define the interfaces that the struct
21522         implements.
21523
21524         This completes the fixing of bug 27287
21525
21526         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21527         means also structs.  This fixes part of the problem. 
21528         (Expresion.ImplicitReferenceConversionExists): ditto.
21529
21530         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21531         error if there were no errors reported during the type lookup
21532         process, to avoid duplicates or redundant errors.  Without this
21533         you would get an ambiguous errors plus a type not found.  We have
21534         beaten the user enough with the first error.  
21535
21536         (DeclSparce.FindType): Emit a warning if we have an ambiguous
21537         reference. 
21538
21539         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21540         during the resolution process, stop the lookup, this avoids
21541         repeated error reports (same error twice).
21542
21543         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21544
21545         * typemanager.cs (LookupType): Redo the type lookup code to match
21546         the needs of System.Reflection.  
21547
21548         The issue is that System.Reflection requires references to nested
21549         types to begin with a "+" sign instead of a dot.  So toplevel
21550         types look like: "NameSpace.TopLevelClass", and nested ones look
21551         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21552         levels. 
21553
21554 2002-09-19  Martin Baulig  <martin@gnome.org>
21555
21556         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21557         says that a method always returns or always throws an exception,
21558         don't report the CS0161.
21559
21560         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21561         set `Returns = new_returns'.
21562
21563 2002-09-19  Martin Baulig  <martin@gnome.org>
21564
21565         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21566         to an enum constant, check for a CS0176.
21567
21568 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
21569
21570         * class.cs (TypeContainer.CheckPairedOperators): Now we check
21571         for operators that must be in pairs and report errors.
21572
21573         * ecore.cs (SimpleName.DoResolveType): During the initial type
21574         resolution process, when we define types recursively, we must
21575         check first for types in our current scope before we perform
21576         lookups in the enclosing scopes.
21577
21578         * expression.cs (MakeByteBlob): Handle Decimal blobs.
21579
21580         (Invocation.VerifyArgumentsCompat): Call
21581         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21582         I thought we were supposed to always call this, but there are a
21583         few places in the code where we dont do it.
21584
21585 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
21586
21587         * driver.cs: Add support in -linkres and -resource to specify the
21588         name of the identifier.
21589
21590 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21591
21592         * ecore.cs (StandardConversionExists): Sync with the conversion
21593         code: allow anything-* to void* conversions.
21594
21595         (FindMostSpecificSource): Use an Expression argument
21596         instead of a Type, because we might be handed over a Literal which
21597         gets a few more implicit conversions that plain types do not.  So
21598         this information was being lost.
21599
21600         Also, we drop the temporary type-holder expression when not
21601         required.
21602
21603 2002-09-17  Martin Baulig  <martin@gnome.org>
21604
21605         * class.cs (PropertyBase.CheckBase): Don't check the base class if
21606         this is an explicit interface implementation.
21607
21608 2002-09-17  Martin Baulig  <martin@gnome.org>
21609
21610         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21611         different `IndexerName' attributes.
21612
21613         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21614         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21615         virtual CommonResolve().
21616
21617 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21618
21619         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21620         and convert that to the UnderlyingType.
21621
21622         * statement.cs (Foreach.Resolve): Indexers are just like variables
21623         or PropertyAccesses.
21624
21625         * cs-tokenizer.cs (consume_string): Track line numbers and columns
21626         inside quoted strings, we were not doing this before.
21627
21628 2002-09-16  Martin Baulig  <martin@gnome.org>
21629
21630         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21631         resolve it.  This is needed for the definite assignment check of the
21632         instance expression, fixes bug #29846.
21633         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21634
21635 2002-09-16  Nick Drochak  <ndrochak@gol.com>
21636
21637         * parameter.cs: Fix compile error.  Cannot reference static member
21638         from an instance object.  Is this an mcs bug?
21639
21640 2002-09-14  Martin Baulig  <martin@gnome.org>
21641
21642         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21643         multiple times.  Fixes bug #30295, added test-166.cs.
21644
21645 2002-09-14  Martin Baulig  <martin@gnome.org>
21646
21647         * statement.cs (Block.Emit): Don't emit unreachable code.
21648         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21649         `break' statements.
21650         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21651
21652 2002-09-14  Martin Baulig  <martin@gnome.org>
21653
21654         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21655         is set.
21656
21657 2002-09-14  Martin Baulig  <martin@gnome.org>
21658
21659         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21660         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21661         be false on the ms runtime.
21662
21663 2002-09-13  Martin Baulig  <martin@gnome.org>
21664
21665         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21666         the CS0038 error message.
21667
21668 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
21669
21670         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21671         constant inside, return it.
21672
21673 2002-09-12  Martin Baulig  <martin@gnome.org>
21674
21675         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21676         implicit conversion can be done between enum types.
21677
21678         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21679         check whether an implicit conversion to the current enum's UnderlyingType
21680         exists and report an error if not.
21681
21682         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
21683         without debugging support.
21684
21685         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
21686         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
21687
21688 2002-09-12  Martin Baulig  <martin@gnome.org>
21689
21690         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
21691
21692         * ecore.cs (IMemberExpr.DeclaringType): New property.
21693         (SimpleName.SimpleNameResolve): Check whether we're accessing a
21694         nonstatic member of an outer type (CS0038).
21695
21696 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
21697
21698         * driver.cs: Activate the using-error detector at warning level
21699         4 (at least for MS-compatible APIs).
21700
21701         * namespace.cs (VerifyUsing): Small buglett fix.
21702
21703         * pending.cs (PendingImplementation): pass the container pointer. 
21704
21705         * interface.cs (GetMethods): Allow for recursive definition.  Long
21706         term, I would like to move every type to support recursive
21707         definitions, not the current ordering mechanism that we have right
21708         now.
21709
21710         The situation is this: Attributes are handled before interfaces,
21711         so we can apply attributes to interfaces.  But some attributes
21712         implement interfaces, we will now handle the simple cases
21713         (recursive definitions will just get an error).  
21714
21715         * parameter.cs: Only invalidate types at the end if we fail to
21716         lookup all types.  
21717
21718 2002-09-09  Martin Baulig  <martin@gnome.org>
21719
21720         * ecore.cs (PropertyExpr.Emit): Also check for
21721         TypeManager.system_int_array_get_length so this'll also work when
21722         compiling corlib.  Fixes #30003.
21723
21724 2002-09-09  Martin Baulig  <martin@gnome.org>
21725
21726         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
21727         and throw an exception if we can't get the type's size.  Fixed #30040,
21728         added test-165.cs.
21729
21730 2002-09-09  Martin Baulig  <martin@gnome.org>
21731
21732         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
21733
21734         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
21735         context.  Fixes bug #30027.
21736
21737         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
21738         virtual functions.  Fixes bug #30043, added test-164.cs.
21739
21740 2002-09-08  Ravi Pratap  <ravi@ximian.com>
21741
21742         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
21743
21744 2002-09-08  Nick Drochak  <ndrochak@gol.com>
21745
21746         * driver.cs: Use an object to get the windows codepage since it's not a
21747         static property.
21748
21749 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
21750
21751         * statement.cs (For.Emit): for infinite loops (test == null)
21752         return whether there is a break inside, not always "true".
21753
21754         * namespace.cs (UsingEntry): New struct to hold the name of the
21755         using definition, the location where it is defined, and whether it
21756         has been used in a successful type lookup.
21757
21758         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
21759         strings.
21760
21761         * decl.cs: ditto.
21762
21763 2002-09-06  Ravi Pratap  <ravi@ximian.com>
21764
21765         * attribute.cs : Fix incorrect code which relied on catching
21766         a NullReferenceException to detect a null being passed in
21767         where an object was expected.
21768
21769 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
21770
21771         * statement.cs (Try): flag the catch variable as assigned
21772
21773         * expression.cs (Cast): Simplified by using ResolveType instead of
21774         manually resolving.
21775
21776         * statement.cs (Catch): Fix bug by using ResolveType.
21777
21778 2002-09-06  Ravi Pratap  <ravi@ximian.com>
21779
21780         * expression.cs (BetterConversion): Special case for when we have
21781         a NullLiteral as the argument and we have to choose between string
21782         and object types - we choose string the way csc does.
21783
21784         * attribute.cs (Attribute.Resolve): Catch the
21785         NullReferenceException and report error #182 since the Mono
21786         runtime no more has the bug and having this exception raised means
21787         we tried to select a constructor which takes an object and is
21788         passed a null.
21789
21790 2002-09-05  Ravi Pratap  <ravi@ximian.com>
21791
21792         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
21793         message (1502, 1503) when we can't locate a method after overload
21794         resolution. This is much more informative and closes the bug
21795         Miguel reported.
21796
21797         * interface.cs (PopulateMethod): Return if there are no argument
21798         types. Fixes a NullReferenceException bug.
21799
21800         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
21801         expressions too. Previously we were checking only in one place for
21802         positional arguments leaving out named arguments.
21803
21804         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
21805         type to the enum type is not allowed. Remove code corresponding to
21806         that.
21807
21808         (ConvertNumericExplicit): Allow explicit conversions from
21809         the underlying type to enum type. This precisely follows the spec
21810         and closes a bug filed by Gonzalo.
21811
21812 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21813
21814         * compiler.csproj:
21815         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
21816
21817 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
21818
21819         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
21820         it was important that we stored the right value after the
21821         reduction in `converted'.
21822
21823 2002-09-04  Martin Baulig  <martin@gnome.org>
21824
21825         * location.cs (Location.SymbolDocument): Use full pathnames for the
21826         source files.
21827
21828 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
21829
21830         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
21831         of the expression resolve mechanism, because that will catch the
21832         SimpleName error failures.
21833
21834         (Conditional): If we can not resolve the
21835         expression, return, do not crash.
21836
21837 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21838
21839         * cs-tokenizer.cs:
21840         (location): display token name instead of its number.
21841
21842 2002-08-28  Martin Baulig  <martin@gnome.org>
21843
21844         * expression.cs (Binary.ResolveOperator): Don't silently return
21845         but return an error if an operator cannot be applied between two
21846         enum types.
21847
21848 2002-08-28  Martin Baulig  <martin@gnome.org>
21849
21850         * class.cs (Constructor.Define): Set the permission attributes
21851         correctly instead of making all constructors public.
21852
21853 2002-08-28  Martin Baulig  <martin@gnome.org>
21854
21855         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
21856         for private members before reporting a CS0103; if we find anything,
21857         it's a CS0122.
21858
21859 2002-08-28  Martin Baulig  <martin@gnome.org>
21860
21861         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
21862         to check whether `closure_start_type == closure_invocation_type',
21863         we also need to check whether `m.DeclaringType == closure_invocation_type'
21864         before bypassing the permission checks.  We might be accessing
21865         protected/private members from the base class.
21866         (TypeManager.RealMemberLookup): Only set private_ok if private
21867         members were requested via BindingFlags.NonPublic.
21868
21869         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
21870
21871         * expression.cs (MemberAccess.ResolveMemberAccess): Set
21872         MethodGroupExpr.IsExplicitImpl if appropriate.
21873         (Invocation.DoResolve): Don't report the CS0120 for explicit
21874         interface implementations.
21875
21876 2002-08-27  Martin Baulig  <martin@gnome.org>
21877
21878         * expression.cs (Invocation.DoResolve): If this is a static
21879         method and we don't have an InstanceExpression, we must report
21880         a CS0120.
21881
21882 2002-08-25  Martin Baulig  <martin@gnome.org>
21883
21884         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
21885         `==' between a valuetype and an object.
21886
21887 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * ecore.cs (TypeExpr): Provide a ToString method.
21890
21891 2002-08-24  Martin Baulig  <martin@gnome.org>
21892
21893         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
21894         now called proggie.dbg and it's a binary file.
21895
21896 2002-08-23  Martin Baulig  <martin@gnome.org>
21897
21898         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
21899
21900 2002-08-23  Martin Baulig  <martin@gnome.org>
21901
21902         * struct.cs (MyStructInfo.ctor): Make this work with empty
21903         structs; it's not allowed to use foreach() on null.
21904
21905 2002-08-23  Martin Baulig  <martin@gnome.org>
21906
21907         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
21908         writer the full pathname of the generated assembly.
21909
21910 2002-08-23  Martin Baulig  <martin@gnome.org>
21911
21912         * statements.cs (FlowBranching.UsageVector.MergeChildren):
21913         A `finally' block never returns or breaks; improved handling of
21914         unreachable code.
21915
21916 2002-08-23  Martin Baulig  <martin@gnome.org>
21917
21918         * statement.cs (Throw.Resolve): Allow `throw null'.
21919
21920 2002-08-23  Martin Baulig  <martin@gnome.org>
21921
21922         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
21923         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
21924         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
21925         MemberLookup would return a wrong event if this is an explicit
21926         interface implementation and the class has an event with the same
21927         name.
21928
21929 2002-08-23  Martin Baulig  <martin@gnome.org>
21930
21931         * statement.cs (Block.AddChildVariableNames): New public method.
21932         (Block.AddChildVariableName): Likewise.
21933         (Block.IsVariableNameUsedInChildBlock): Likewise.
21934         (Block.AddVariable): Check whether a variable name has already
21935         been used in a child block.
21936
21937         * cs-parser.jay (declare_local_variables): Mark all variable names
21938         from the current block as being used in a child block in the
21939         implicit block.
21940
21941 2002-08-23  Martin Baulig  <martin@gnome.org>
21942
21943         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
21944         find the symbol writer.
21945
21946         * driver.cs: csc also allows the arguments to /define being
21947         separated by commas, not only by semicolons.
21948
21949 2002-08-23  Martin Baulig  <martin@gnome.org>
21950
21951         * interface.cs (Interface.GetMembers): Added static check for events.
21952
21953 2002-08-15  Martin Baulig  <martin@gnome.org>
21954
21955         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
21956         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
21957
21958         * ecore.cs (Expression.MemberLookup): Added documentation and explained
21959         why the MethodData.EmitDestructor() change was necessary.
21960
21961 2002-08-20  Martin Baulig  <martin@gnome.org>
21962
21963         * class.cs (TypeContainer.FindMembers): Added static check for events.
21964
21965         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
21966
21967         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
21968         use Type.GetEvents(), not Type.FindMembers().
21969
21970 2002-08-20  Martin Baulig  <martin@gnome.org>
21971
21972         * decl.cs (MemberCache): Added a special method cache which will
21973         be used for method-only searched.  This ensures that a method
21974         search will return a MethodInfo with the correct ReflectedType for
21975         inherited methods.      
21976
21977 2002-08-20  Martin Baulig  <martin@gnome.org>
21978
21979         * decl.cs (DeclSpace.FindMembers): Made this public.
21980
21981 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21982
21983         * delegate.cs: fixed build on windows.
21984         [FIXME:  Filed as bug #29150: MCS must report these errors.]
21985
21986 2002-08-19  Ravi Pratap  <ravi@ximian.com>
21987
21988         * ecore.cs (StandardConversionExists): Return a false
21989         if we are trying to convert the void type to anything else
21990         since that is not allowed.
21991
21992         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
21993         we flag error 70 in the event an event is trying to be accessed
21994         directly from outside the declaring type.
21995
21996 2002-08-20  Martin Baulig  <martin@gnome.org>
21997
21998         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
21999         MemberCache from typemanager.cs to decl.cs.
22000
22001 2002-08-19  Martin Baulig  <martin@gnome.org>
22002
22003         * class.cs (TypeContainer): Implement IMemberContainer.
22004         (TypeContainer.DefineMembers): Create the MemberCache.
22005         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22006         return public members if BindingFlags.Public was given, check
22007         whether members are static.
22008
22009 2002-08-16  Martin Baulig  <martin@gnome.org>
22010
22011         * decl.cs (DeclSpace.Define): Splitted this in Define and
22012         DefineMembers.  DefineMembers is called first and initializes the
22013         MemberCache.
22014
22015         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22016         DefineMembers() on all our DeclSpaces.
22017
22018         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22019         but call DefineMembers() on all nested interfaces.  We call their
22020         Define() in our new Define() function.
22021
22022         * interface.cs (Interface): Implement IMemberContainer.
22023         (Interface.Define): Moved all code except the attribute stuf to
22024         DefineMembers().
22025         (Interface.DefineMembers): Initialize the member cache.
22026
22027         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22028         need this anymore since we can use MemberCache.FindMembers directly.
22029
22030 2002-08-19  Martin Baulig  <martin@gnome.org>
22031
22032         * typemanager.cs (MemberCache): When creating the cache for an
22033         interface type, add all inherited members.
22034         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22035         to `out bool used_cache' and documented it.
22036         (TypeManager.MemberLookup): If we already used the cache in the first
22037         iteration, we don't need to do the interfaces check.
22038
22039 2002-08-19  Martin Baulig  <martin@gnome.org>
22040
22041         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22042         here from IMemberFinder and don't implement this interface anymore.
22043         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22044
22045         * typemanager.cs (IMemberFinder): This interface is now only used by
22046         classes which actually support the member cache.
22047         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22048         since we only put DeclSpaces into this Hashtable.
22049         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22050         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22051
22052 2002-08-16  Martin Baulig  <martin@gnome.org>
22053
22054         * typemanager.cs (ICachingMemberFinder): Removed.
22055         (IMemberFinder.MemberCache): New property.
22056         (TypeManager.FindMembers): Merged this with RealFindMembers().
22057         This function will never be called from TypeManager.MemberLookup()
22058         so we can't use the cache here, just the IMemberFinder.
22059         (TypeManager.MemberLookup_FindMembers): Check whether the
22060         IMemberFinder has a MemberCache and call the cache's FindMembers
22061         function.
22062         (MemberCache): Rewrote larger parts of this yet another time and
22063         cleaned it up a bit.
22064
22065 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22066
22067         * driver.cs (LoadArgs): Support quoting.
22068
22069         (Usage): Show the CSC-like command line arguments.
22070
22071         Improved a few error messages.
22072
22073 2002-08-15  Martin Baulig  <martin@gnome.org>
22074
22075         * typemanager.cs (IMemberContainer.Type): New property.
22076         (IMemberContainer.IsInterface): New property.
22077
22078         The following changes are conditional to BROKEN_RUNTIME, which is
22079         defined at the top of the file.
22080
22081         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22082         class'es members, but add all members from TypeHandle.ObjectType
22083         if we're an interface.
22084         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22085         is the current type.
22086         (MemberCache.CacheEntry.Container): Removed this field.
22087         (TypeHandle.GetMembers): Include inherited members.
22088
22089 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22090
22091         * typemanager.cs: fixed compilation and added a comment on a field that
22092         is never used.
22093
22094 2002-08-15  Martin Baulig  <martin@gnome.org>
22095
22096         * class.cs (ConstructorInitializer.Resolve): In the
22097         Expression.MemberLookup call, use the queried_type as
22098         invocation_type.
22099
22100         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22101         declared' attribute, it's always true.
22102         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22103         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22104         temporary wrapper for FindMembers which tells MemberLookup whether
22105         members from the base classes are included in the return value.
22106         This will go away soon.
22107         (TypeManager.MemberLookup): Use this temporary hack here; once the
22108         new MemberCache is completed, we don't need to do the DeclaredOnly
22109         looping here anymore since the MemberCache will take care of this.
22110         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22111         (MemberCache): When creating the MemberCache for a class, get
22112         members from the current class and all its base classes.
22113         (MemberCache.CacheEntry.Container): New field.  This is a
22114         temporary hack until the Mono runtime is fixed to distinguish
22115         between ReflectedType and DeclaringType.  It allows us to use MCS
22116         with both the MS runtime and the unfixed Mono runtime without
22117         problems and without accecting performance.
22118         (MemberCache.SearchMembers): The DeclaredOnly looping from
22119         TypeManager.MemberLookup is now done here.      
22120
22121 2002-08-14  Martin Baulig  <martin@gnome.org>
22122
22123         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22124         Type.GetFields on dynamic types but get the fields from the
22125         corresponding TypeContainer.
22126         (MyStructInfo.GetStructInfo): Added check for enum types.
22127
22128         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22129         (MemberList.SyncRoot): Implemented.
22130         (TypeManager.FilterWithClosure): No need to check permissions if
22131         closure_start_type == closure_invocation_type, don't crash if
22132         closure_invocation_type is null.
22133
22134 2002-08-13  Martin Baulig  <martin@gnome.org>
22135
22136         Rewrote TypeContainer.FindMembers to use a member cache.  This
22137         gives us a speed increase of about 35% for the self-hosting MCS
22138         build and of about 15-20% for the class libs (both on GNU/Linux).
22139
22140         * report.cs (Timer): New class to get enhanced profiling.  This
22141         whole class is "TIMER" conditional since it remarkably slows down
22142         compilation speed.
22143
22144         * class.cs (MemberList): New class.  This is an IList wrapper
22145         which we're now using instead of passing MemberInfo[]'s around to
22146         avoid copying this array unnecessarily.
22147         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22148         (ICachingMemberFinder, IMemberContainer): New interface.
22149         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22150         has already been checked, otherwise use it for the name comparision.
22151         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22152         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22153         if possible.  Returns a MemberList, not a MemberInfo [].
22154         (TypeHandle): New class, implements IMemberContainer.  We create
22155         one instance of this class per type, it contains a MemberCache
22156         which is used to do the member lookups.
22157         (MemberCache): New class.  Each instance of this class contains
22158         all members of a type and a name-based hash table.
22159         (MemberCache.FindMembers): This is our new member lookup
22160         function.  First, it looks up all members of the requested name in
22161         the hash table.  Then, it walks this list and sorts out all
22162         applicable members and returns them.
22163
22164 2002-08-13  Martin Baulig  <martin@gnome.org>
22165
22166         In addition to a nice code cleanup, this gives us a performance
22167         increase of about 1.4% on GNU/Linux - not much, but it's already
22168         half a second for the self-hosting MCS compilation.
22169
22170         * typemanager.cs (IMemberFinder): New interface.  It is used by
22171         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22172         Enum, Delegate or Interface.
22173         (TypeManager.finder_to_member_finder): New PtrHashtable.
22174         (TypeManager.finder_to_container): Removed.
22175         (TypeManager.finder_to_delegate): Removed.
22176         (TypeManager.finder_to_interface): Removed.
22177         (TypeManager.finder_to_enum): Removed.
22178
22179         * interface.cs (Interface): Implement IMemberFinder.
22180
22181         * delegate.cs (Delegate): Implement IMemberFinder.
22182
22183         * enum.cs (Enum): Implement IMemberFinder.
22184
22185         * class.cs (TypeContainer): Implement IMemberFinder.
22186
22187 2002-08-12  Martin Baulig  <martin@gnome.org>
22188
22189         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22190
22191 2002-08-12  Martin Baulig  <martin@gnome.org>
22192
22193         * ecore.cs (ITypeExpression): New interface for expressions which
22194         resolve to a type.
22195         (TypeExpression): Renamed to TypeLookupExpression.
22196         (Expression.DoResolve): If we're doing a types-only lookup, the
22197         expression must implement the ITypeExpression interface and we
22198         call DoResolveType() on it.
22199         (SimpleName): Implement the new ITypeExpression interface.
22200         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22201         hack, the situation that we're only looking up types can't happen
22202         anymore when this method is called.  Moved the type lookup code to
22203         DoResolveType() and call it.
22204         (SimpleName.DoResolveType): This ITypeExpression interface method
22205         is now doing the types-only lookup.
22206         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22207         (ResolveFlags): Added MaskExprClass.
22208
22209         * expression.cs (MemberAccess): Implement the ITypeExpression
22210         interface.
22211         (MemberAccess.DoResolve): Added support for a types-only lookup
22212         when we're called via ITypeExpression.DoResolveType().
22213         (ComposedCast): Implement the ITypeExpression interface.
22214
22215         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22216         Expression.Resolve() with ResolveFlags.Type instead.
22217
22218 2002-08-12  Martin Baulig  <martin@gnome.org>
22219
22220         * interface.cs (Interface.Define): Apply attributes.
22221
22222         * attribute.cs (Attribute.ApplyAttributes): Added support for
22223         interface attributes.
22224
22225 2002-08-11  Martin Baulig  <martin@gnome.org>
22226
22227         * statement.cs (Block.Emit): Only check the "this" variable if we
22228         do not always throw an exception.
22229
22230         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22231         whether the property has a set accessor.
22232
22233 2002-08-11  Martin Baulig  <martin@gnome.org>
22234
22235         Added control flow analysis support for structs.
22236
22237         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22238         with control flow analysis turned off.
22239         (IVariable): New interface.
22240         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22241         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22242         (FieldExpr.DoResolve): Resolve the instance expression with flow
22243         analysis turned off and do the definite assignment check after the
22244         resolving when we know what the expression will resolve to.
22245
22246         * expression.cs (LocalVariableReference, ParameterReference):
22247         Implement the new IVariable interface, only call the flow analysis
22248         code if ec.DoFlowAnalysis is true.
22249         (This): Added constructor which takes a Block argument.  Implement
22250         the new IVariable interface.
22251         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22252         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22253         This does the definite assignment checks for struct members.
22254
22255         * class.cs (Constructor.Emit): If this is a non-static `struct'
22256         constructor which doesn't have any initializer, call
22257         Block.AddThisVariable() to tell the flow analysis code that all
22258         struct elements must be initialized before control returns from
22259         the constructor.
22260
22261         * statement.cs (MyStructInfo): New public class.
22262         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22263         argument to this indexer.  If non-zero, check an individual struct
22264         member, not the whole struct.
22265         (FlowBranching.CheckOutParameters): Check struct members.
22266         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22267         overloaded versions of these methods which take an additional
22268         `int field_idx' argument to check struct members.
22269         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22270         overloaded versions of these methods which take an additional
22271         `string field_name' argument to check struct member.s
22272         (VariableInfo): Implement the IVariable interface.
22273         (VariableInfo.StructInfo): New public property.  Returns the
22274         MyStructInfo instance of the variable if it's a struct or null.
22275         (Block.AddThisVariable): New public method.  This is called from
22276         Constructor.Emit() for non-static `struct' constructor which do
22277         not have any initializer.  It creates a special variable for the
22278         "this" instance variable which will be checked by the flow
22279         analysis code to ensure that all of the struct's fields are
22280         initialized before control returns from the constructor.
22281         (UsageVector): Added support for struct members.  If a
22282         variable/parameter is a struct with N members, we reserve a slot
22283         in the usage vector for each member.  A struct is considered fully
22284         initialized if either the struct itself (slot 0) or all its
22285         members are initialized.
22286
22287 2002-08-08  Martin Baulig  <martin@gnome.org>
22288
22289         * driver.cs (Driver.MainDriver): Only report an error CS5001
22290         if there were no compilation errors.
22291
22292         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22293         `UnsafeContext' property to determine whether the parent is in
22294         unsafe context rather than checking the parent's ModFlags:
22295         classes nested in an unsafe class are unsafe as well.
22296
22297 2002-08-08  Martin Baulig  <martin@gnome.org>
22298
22299         * statement.cs (UsageVector.MergeChildren): Distinguish between
22300         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22301         we return.  Added test17() and test18() to test-154.cs.
22302
22303 2002-08-08  Martin Baulig  <martin@gnome.org>
22304
22305         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22306         Family access, make sure the invoking type isn't a subclass of the
22307         queried type (that'd be a CS1540).
22308
22309         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22310         this method which takes an additional `Type invocation_type'.
22311
22312         * expression.cs (BaseAccess.DoResolve): Use the base type as
22313         invocation and query type.
22314         (MemberAccess.DoResolve): If the lookup failed and we're about to
22315         report a CS0122, try a lookup with the ec.ContainerType - if this
22316         succeeds, we must report a CS1540.
22317
22318 2002-08-08  Martin Baulig  <martin@gnome.org>
22319
22320         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22321         (MethodGroupExpr): Implement the IMemberExpr interface.
22322
22323         * expression (MemberAccess.ResolveMemberAccess): No need to have
22324         any special code for MethodGroupExprs anymore, they're now
22325         IMemberExprs.   
22326
22327 2002-08-08  Martin Baulig  <martin@gnome.org>
22328
22329         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22330         Family, FamANDAssem and FamORAssem permissions.
22331         (TypeManager.IsSubclassOrNestedChildOf): New public method.
22332
22333 2002-08-08  Martin Baulig  <martin@gnome.org>
22334
22335         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22336         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22337         or loop block.
22338
22339 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22340
22341         * driver.cs: implemented /resource option to embed managed resources.
22342
22343 2002-08-07  Martin Baulig  <martin@gnome.org>
22344
22345         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22346         (FieldBase.HasFieldInitializer): New public property.
22347         (FieldBase.GetInitializerExpression): New public method.  Resolves and
22348         returns the field initializer and makes sure it is only resolved once.
22349         (TypeContainer.EmitFieldInitializers): Call
22350         FieldBase.GetInitializerExpression to get the initializer, this ensures
22351         that it isn't resolved multiple times.
22352
22353         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
22354         the resolving process (SimpleName/MemberLookup) that we're currently
22355         emitting a field initializer (which must not access any instance members,
22356         this is an error CS0236).
22357
22358         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22359         argument, if the `IsFieldInitializer' flag is set, we must report and
22360         error CS0236 and not an error CS0120.   
22361
22362 2002-08-07  Martin Baulig  <martin@gnome.org>
22363
22364         * ecore.cs (IMemberExpr): New public interface.
22365         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22366         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22367         if the expression is an IMemberExpr.
22368
22369         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22370         to be null, implicitly default to `this' if we're non-static in
22371         this case.  Simplified the code a lot by using the new IMemberExpr
22372         interface.  Also fixed bug #28176 here.
22373
22374 2002-08-06  Martin Baulig  <martin@gnome.org>
22375
22376         * cs-parser.jay (SimpleLookup): Removed.  We need to create
22377         ParameterReferences during semantic analysis so that we can do a
22378         type-only search when resolving Cast, TypeOf and SizeOf.
22379         (block): Pass the `current_local_parameters' to the Block's
22380         constructor.
22381
22382         * class.cs (ConstructorInitializer): Added `Parameters parameters'
22383         argument to the constructor.
22384         (ConstructorInitializer.Resolve): Create a temporary implicit
22385         block with the parameters.
22386
22387         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22388         references here if we aren't doing a type-only search.
22389
22390         * statement.cs (Block): Added constructor which takes a
22391         `Parameters parameters' argument.
22392         (Block.Parameters): New public property.
22393
22394         * support.cs (InternalParameters.Parameters): Renamed `parameters'
22395         to `Parameters' and made it public readonly.
22396
22397 2002-08-06  Martin Baulig  <martin@gnome.org>
22398
22399         * ecore.cs (Expression.Warning): Made this public as well.
22400
22401         * report.cs (Report.Debug): Print the contents of collections.
22402
22403 2002-08-06  Martin Baulig  <martin@gnome.org>
22404
22405         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
22406         used to tell Resolve() which kinds of expressions it may return.
22407         (Expression.Resolve): Added overloaded version of this method which
22408         takes a `ResolveFlags flags' argument.  This can be used to tell
22409         Resolve() which kinds of expressions it may return.  Reports a
22410         CS0118 on error.
22411         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22412         ResolveFlags.SimpleName.
22413         (Expression.Error118): Added overloaded version of this method which
22414         takes a `ResolveFlags flags' argument.  It uses the flags to determine
22415         which kinds of expressions are allowed.
22416
22417         * expression.cs (Argument.ResolveMethodGroup): New public method.
22418         Resolves an argument, but allows a MethodGroup to be returned.
22419         This is used when invoking a delegate.
22420
22421         * TODO: Updated a bit.
22422
22423 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22424
22425         Fixed compilation with csc.
22426
22427         * ecore.cs: Expression.Error made public. Is this correct? Should
22428         Warning be made public too?
22429
22430         * expression.cs: use ea.Location instead of ea.loc.
22431         [FIXME:  Filed as bug #28607: MCS must report these errors.]
22432
22433 2002-08-06  Martin Baulig  <martin@gnome.org>
22434
22435         * ecore.cs (Expression.loc): Moved the location here instead of
22436         duplicating it in all derived classes.
22437         (Expression.Location): New public property.
22438         (Expression.Error, Expression.Warning): Made them non-static and
22439         removed the location argument.
22440         (Expression.Warning): Added overloaded version which takes an
22441         `int level' argument.
22442         (Expression.Error118): Make this non-static and removed the
22443         expression and location arguments.
22444         (TypeExpr): Added location argument to the constructor.
22445
22446         * expression.cs (StaticCallExpr): Added location argument to
22447         the constructor.
22448         (Indirection, PointerArithmetic): Likewise.
22449         (CheckedExpr, UnCheckedExpr): Likewise.
22450         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22451         (StringPtr): Likewise.
22452
22453
22454 2002-08-05  Martin Baulig  <martin@gnome.org>
22455
22456         * expression.cs (BaseAccess.DoResolve): Actually report errors.
22457
22458         * assign.cs (Assign.DoResolve): Check whether the source
22459         expression is a value or variable.
22460
22461         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22462         while resolving the corresponding blocks.
22463
22464         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22465         an error, don't silently return null.
22466
22467         * statement.cs (Block.AddVariable): Do the error reporting here
22468         and distinguish between CS0128 and CS0136.
22469         (Block.DoResolve): Report all unused labels (warning CS0164).
22470         (LabeledStatement): Pass the location to the constructor.
22471         (LabeledStatement.HasBeenReferenced): New property.
22472         (LabeledStatement.Resolve): Set it to true here.
22473
22474         * statement.cs (Return.Emit): Return success even after reporting
22475         a type mismatch error (CS0126 or CS0127), this is what csc does and
22476         it avoids confusing the users with any consecutive errors.
22477
22478 2002-08-05  Martin Baulig  <martin@gnome.org>
22479
22480         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22481
22482         * const.cs (Const.LookupConstantValue): Catch circular definitions.
22483
22484         * expression.cs (MemberAccess.DoResolve): Silently return if an
22485         error has already been reported.
22486
22487         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22488         error has already been reported.
22489
22490 2002-08-05  Martin Baulig  <martin@gnome.org>
22491
22492         * statement.cs (UsageVector): Only initialize the `parameters'
22493         vector if we actually have any "out" parameters.
22494
22495 2002-08-05  Martin Baulig  <martin@gnome.org>
22496
22497         * expression.cs (Binary.ResolveOperator): When combining delegates,
22498         they must have the same type.
22499
22500 2002-08-05  Martin Baulig  <martin@gnome.org>
22501
22502         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22503         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22504         work with the ms runtime and we also don't need it: if we're a
22505         PropertyBuilder and not in the `indexer_arguments' hash, then we
22506         are a property and not an indexer.
22507
22508         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22509         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22510         since the latter one doesn't work with the ms runtime.
22511
22512 2002-08-03  Martin Baulig  <martin@gnome.org>
22513
22514         Fixed bugs #27998 and #22735.
22515
22516         * class.cs (Method.IsOperator): New public field.
22517         (Method.CheckBase): Report CS0111 if there's already a method
22518         with the same parameters in the current class.  Report CS0508 when
22519         attempting to change the return type of an inherited method.
22520         (MethodData.Emit): Report CS0179 if a method doesn't have a body
22521         and it's not marked abstract or extern.
22522         (PropertyBase): New abstract base class for Property and Indexer.
22523         (PropertyBase.CheckBase): Moved here from Property and made it work
22524         for indexers.
22525         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22526         the same so we can reuse it there.
22527         (Property, Indexer): Derive from PropertyBase.
22528         (MethodSignature.inheritable_property_signature_filter): New delegate
22529         to find properties and indexers.
22530
22531         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22532         argument and improved error reporting.
22533
22534         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22535         EmptyReadOnlyParameters and made it a property.
22536
22537         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22538         version of this method which takes a `PropertyInfo indexer'.
22539         (TypeManager.RegisterIndexer): New method.
22540
22541         * class.cs: Added myself as author of this file :-)
22542
22543 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22544
22545         * class.cs: fixed compilation on windoze.
22546
22547 2002-08-03  Martin Baulig  <martin@gnome.org>
22548
22549         * interface.cs (Interface.GetInterfaceBases): Check whether all
22550         base interfaces are at least as accessible than the current one.
22551
22552         * class.cs (TypeContainer.GetClassBases): Check whether base types
22553         are at least as accessible than the current type.
22554         (TypeContainer.AsAccessible): Implemented and made non-static.
22555         (MemberBase.CheckParameters): Report errors if the accessibility
22556         checks fail.
22557
22558         * delegate.cs (Delegate.Delegate): The default visibility is
22559         internal for top-level types and private for nested types.
22560         (Delegate.Define): Report errors if the accessibility checks fail.
22561
22562         * enum.cs (Enum.Enum): The default visibility is internal for
22563         top-level types and private for nested types.
22564         (Enum.DefineType): Compute the correct visibility.
22565
22566         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22567         function which takes a `bool is_toplevel' instead of a TypeContainer.
22568
22569         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22570         builtin type.
22571
22572 2002-08-02  Martin Baulig  <martin@gnome.org>
22573
22574         * expression.cs (LocalVariableReferenc): Added constructor which
22575         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22576         (LocalVariableReference.IsReadOnly): New property.
22577         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22578         variable is readonly, use our own readonly flag to do this; you can
22579         use the new constructor to get a writable reference to a read-only
22580         variable.
22581
22582         * cs-parser.jay (foreach_statement, using_statement): Get a writable
22583         reference to the local variable.
22584
22585 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
22586
22587         * rootcontext.cs (ResolveCore): Also include System.Exception
22588
22589         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22590         we reach an EmptyStatement.
22591
22592         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22593         is also fine.
22594
22595         * expression.cs (Binary.ResolveOperator): Check error result in
22596         two places.
22597
22598         use brtrue/brfalse directly and avoid compares to null.
22599
22600 2002-08-02  Martin Baulig  <martin@gnome.org>
22601
22602         * class.cs (TypeContainer.Define): Define all nested interfaces here.
22603         Fixes bug #28407, added test-155.cs.
22604
22605 2002-08-01  Martin Baulig  <martin@gnome.org>
22606
22607         * class.cs (Event.EmitDefaultMethod): Make this work with static
22608         events.  Fixes #28311, added verify-3.cs.
22609
22610 2002-08-01  Martin Baulig  <martin@gnome.org>
22611
22612         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22613         `is_disposable' fields.
22614         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22615         `hm.is_disposable' if we're using the collection pattern.
22616         (Foreach.EmitCollectionForeach): Use the correct type for the
22617         enumerator's local variable, only emit the try/finally block if
22618         necessary (fixes #27713).
22619
22620 2002-08-01  Martin Baulig  <martin@gnome.org>
22621
22622         * ecore.cs (Expression.report118): Renamed to Error118 and made
22623         it public static.
22624
22625         * statement.cs (Throw.Resolve): Check whether the expression is of
22626         the correct type (CS0118) and whether the type derives from
22627         System.Exception (CS0155).
22628         (Catch.Resolve): New method.  Do the type lookup here and check
22629         whether it derives from System.Exception (CS0155).
22630         (Catch.CatchType, Catch.IsGeneral): New public properties.
22631
22632         * typemanager.cs (TypeManager.exception_type): Added.
22633
22634 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
22635
22636         * driver.cs: Updated About function.
22637
22638 2002-07-31  Martin Baulig  <martin@gnome.org>
22639
22640         Implemented Control Flow Analysis.
22641
22642         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22643         (EmitContext.CurrentBranching): Added.
22644         (EmitContext.StartFlowBranching): Added.
22645         (EmitContext.EndFlowBranching): Added.
22646         (EmitContext.KillFlowBranching): Added.
22647         (EmitContext.IsVariableAssigned): Added.
22648         (EmitContext.SetVariableAssigned): Added.
22649         (EmitContext.IsParameterAssigned): Added.
22650         (EmitContext.SetParameterAssigned): Added.
22651         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22652         Added control flow analysis stuff here.
22653
22654         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22655         resolve the expression as lvalue.
22656         (LocalVariableReference.DoResolve): Check whether the variable has
22657         already been assigned.
22658         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22659         the parameter as assigned here.
22660         (ParameterReference.DoResolve): Check whether the parameter has already
22661         been assigned.
22662         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22663         expression as lvalue.
22664
22665         * statement.cs (FlowBranching): New class for the flow analysis code.
22666         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22667         (LabeledStatement.IsDefined): New public property.
22668         (LabeledStatement.AddUsageVector): New public method to tell flow
22669         analyis that the label may be reached via a forward jump.
22670         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22671         flow analysis.
22672         (VariableInfo.Number): New public field.  This is used by flow analysis
22673         to number all locals of a block.
22674         (Block.CountVariables): New public property.  This is the number of
22675         local variables in this block (including the locals from all parent
22676         blocks).
22677         (Block.EmitMeta): Number all the variables.
22678
22679         * statement.cs: Added flow analysis support to all classes.
22680
22681 2002-07-31  Martin Baulig  <martin@gnome.org>
22682
22683         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
22684         To get debugging messages, compile mcs with /define:MCS_DEBUG and
22685         then use this argument.
22686
22687         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
22688
22689         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
22690         use this to specify /define options.
22691
22692 2002-07-29  Martin Baulig  <martin@gnome.org>
22693
22694         * statement.cs (Fixed): Moved all code that does variable lookups
22695         and resolvings from Emit to Resolve.
22696
22697         * statement.cs (For): Moved all code that does variable lookups
22698         and resolvings from Emit to Resolve.
22699
22700         * statement.cs (Using): Moved all code that does variable lookups
22701         and resolvings from Emit to Resolve.
22702
22703 2002-07-29  Martin Baulig  <martin@gnome.org>
22704
22705         * attribute.cs (Attribute.Resolve): Explicitly catch a
22706         System.NullReferenceException when creating the
22707         CustromAttributeBuilder and report a different warning message.
22708
22709 2002-07-29  Martin Baulig  <martin@gnome.org>
22710
22711         * support.cs (ParameterData.ParameterName): Added method to
22712         get the name of a parameter.
22713
22714         * typemanager.cs (TypeManager.IsValueType): New public method.
22715
22716 2002-07-29  Martin Baulig  <martin@gnome.org>
22717
22718         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
22719         is a flag which specifies that it's either ref or out.
22720         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
22721         the out parameter to `out Parameter.Modifier mod', also set the
22722         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
22723
22724         * support.cs (InternalParameters.ParameterModifier): Distinguish
22725         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22726         Parameter.Modifier.ISBYREF flag if it's either ref or out.
22727
22728         * expression.cs (Argument.GetParameterModifier): Distinguish
22729         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22730         Parameter.Modifier.ISBYREF flag if it's either ref or out.
22731
22732 2002-07-29  Martin Baulig  <martin@gnome.org>
22733
22734         * expression.cs (ParameterReference.ParameterReference): Added
22735         `Location loc' argument to the constructor.
22736
22737         * cs-parser.jay: Pass location to ParameterReference.
22738
22739 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
22740
22741         * statement.cs (Try): Initialize the location.
22742
22743         * cs-parser.jay: pass location to Try.
22744
22745         * expression.cs (Unary.Reduce): Change the prototype to return
22746         whether a constant fold could be performed or not.  The result is
22747         returned in an out parameters.  In the case of Indirection and
22748         AddressOf, we want to perform the full tests.
22749
22750 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
22751
22752         * statement.cs (Statement.Emit): Flag dead code.
22753
22754 2002-07-27  Andrew Birkett  <andy@nobugs.org>
22755
22756         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
22757
22758 2002-07-27  Martin Baulig  <martin@gnome.org>
22759
22760         * class.cs (MethodData.Define): Put back call to
22761         TypeManager.AddMethod(), accidentally commented this out.
22762
22763         * report.cs (Debug): New public method to print debugging information,
22764         this is `[Conditional ("DEBUG")]'.
22765
22766 2002-07-26  Martin Baulig  <martin@gnome.org>
22767
22768         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
22769         (switch_statement): Push the current_block to the switch_stack and
22770         pop it again when we're done with the switch.
22771         (switch_section): The new block is a child of the current_block.
22772         Fixes bug #24007, added test-152.cs.
22773
22774 2002-07-27  Martin Baulig  <martin@gnome.org>
22775
22776         * expression.cs (Invocation.EmitArguments): When calling a varargs
22777         function with only its fixed arguments, we need to pass an empty
22778         array.
22779
22780 2002-07-27  Martin Baulig  <martin@gnome.org>
22781
22782         Mono 0.13 has been released.
22783
22784 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
22785
22786         * driver.cs: Rename --resource to --linkres, because that is what
22787         we do currently, we dont support --resource yet.
22788
22789         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
22790
22791 2002-07-25  Martin Baulig  <martin@gnome.org>
22792
22793         * class.cs (MethodData): New public class.  This is a `method builder'
22794         class for a method or one accessor of a Property/Indexer/Event.
22795         (MethodData.GetMethodFlags): Moved here from MemberBase.
22796         (MethodData.ApplyAttributes): Likewise.
22797         (MethodData.ApplyObsoleteAttribute): Likewise.
22798         (MethodData.ApplyConditionalAttribute): Likewise.
22799         (MethodData.ApplyDllImportAttribute): Likewise.
22800         (MethodData.CheckAbstractAndExternal): Likewise.
22801         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
22802         (MethodData.Emit): Formerly known as Method.Emit().
22803         (MemberBase): Moved everything which was specific to a single
22804         accessor/method to MethodData.
22805         (Method): Create a new MethodData and call Define() and Emit() on it.
22806         (Property, Indexer, Event): Create a new MethodData objects for each
22807         accessor and call Define() and Emit() on them.
22808
22809 2002-07-25  Martin Baulig  <martin@gnome.org>
22810
22811         Made MethodCore derive from MemberBase to reuse the code from there.
22812         MemberBase now also checks for attributes.
22813
22814         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
22815         (MemberBase.GetMethodFlags): Moved here from class Method and marked
22816         as virtual.
22817         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
22818         `CallingConventions cc' and `Attributes opt_attrs' arguments.
22819         (MemberBase.ApplyAttributes): New virtual method; applies the
22820         attributes to a method or accessor.
22821         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
22822         (MemberBase.ApplyConditionalAttribute): Likewise.
22823         (MemberBase.ApplyDllImportAttribute): Likewise.
22824         (MemberBase.CheckAbstractAndExternal): Likewise.
22825         (MethodCore.ParameterTypes): This is now a property instead of a
22826         method, it's initialized from DoDefineParameters().
22827         (MethodCore.ParameterInfo): Removed the set accessor.
22828         (MethodCore.DoDefineParameters): New protected virtual method to
22829         initialize ParameterTypes and ParameterInfo.
22830         (Method.GetReturnType): We can now simply return the MemberType.
22831         (Method.GetMethodFlags): Override the MemberBase version and add
22832         the conditional flags.
22833         (Method.CheckBase): Moved some code from Define() here, call
22834         DoDefineParameters() here.
22835         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
22836         here to avoid some larger code duplication.
22837         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
22838         ensure that abstract and external accessors don't declare a body.
22839
22840         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
22841         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
22842         lookup in the attribute's parent classes, so we need to abort as soon
22843         as we found the first match.
22844         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
22845         the attribute has no arguments.
22846
22847         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
22848         of a Method.
22849
22850 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22851
22852         * cs-parser.jay: reverted previous patch.
22853
22854 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22855
22856         * cs-parser.jay: fixed bug #22119.
22857
22858 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22859
22860         * attribute.cs: fixed compilation. The error was:
22861         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
22862         be assigned to before control leaves the current method."
22863         [FIXME:  Filed as bug #28186: MCS must report this error.]
22864
22865 2002-07-25  Martin Baulig  <martin@gnome.org>
22866
22867         * attribute.cs (Attribute.Conditional_GetConditionName): New static
22868         method to pull the condition name ouf of a Conditional attribute.
22869         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
22870         the obsolete message and error flag out of an Obsolete attribute.
22871
22872         * class.cs (Method.GetMethodFlags): New public method to get the
22873         TypeManager.MethodFlags for this method.
22874         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
22875         private methods.
22876         (Method.Define): Get and apply the Obsolete and Conditional attributes;
22877         if we're overriding a virtual function, set the new private variable
22878         `parent_method'; call the new TypeManager.AddMethod().
22879
22880         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
22881         the MethodBuilder and the Method in a PtrHashtable.
22882         (TypeManager.builder_to_method): Added for this purpose.
22883         (TypeManager.MethodFlags): Added IsObsoleteError.
22884         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
22885         Obsolete and Conditional arguments in MethodBuilders.  If we discover
22886         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
22887         the message from the attribute.
22888
22889 2002-07-24  Martin Baulig  <martin@gnome.org>
22890
22891         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
22892         preprocessor directives, ensure that the argument to #define/#undef is
22893         exactly one identifier and that it's actually an identifier.
22894
22895         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
22896         did not work ....
22897
22898 2002-07-24  Martin Baulig  <martin@gnome.org>
22899
22900         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
22901         initialize it to TypeManager.object_type in the constructor.
22902         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
22903         of the `hm.get_current' method if we're using the collection pattern.
22904         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
22905         for the explicit conversion to make it work when we're using the collection
22906         pattern and the `Current' property has a different return type than `object'.
22907         Fixes #27713.
22908
22909 2002-07-24  Martin Baulig  <martin@gnome.org>
22910
22911         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
22912         does not match, but don't report any errors.  This method is called in
22913         order for all methods in a MethodGroupExpr until a matching method is
22914         found, so we don't want to bail out if the first method doesn't match.
22915         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
22916         matches, report the 123.  Fixes #28070.
22917
22918 2002-07-24  Martin Baulig  <martin@gnome.org>
22919
22920         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
22921         TypeManager.TypeToCoreType() to the top of the method so the
22922         following equality checks will work.  Fixes #28107.
22923
22924 2002-07-24  Martin Baulig  <martin@gnome.org>
22925
22926         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
22927         operand is of type uint, and the other operand is of type sbyte,
22928         short or int, the operands are converted to type long." -
22929         Actually do what this comment already told us.  Fixes bug #28106,
22930         added test-150.cs.
22931
22932 2002-07-24  Martin Baulig  <martin@gnome.org>
22933
22934         * class.cs (MethodBase): New abstract class.  This is now a base
22935         class for Property, Indexer and Event to avoid some code duplication
22936         in their Define() and DefineMethods() methods.
22937         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
22938         generic methods for Define() and DefineMethods().
22939         (FieldBase): Derive from MemberBase, not MemberCore.
22940         (Property): Derive from MemberBase, not MemberCore.
22941         (Property.DefineMethod): Moved all the code from this method to the
22942         new MethodBase.DefineAccessor(), just call it with appropriate
22943         argumetnts.
22944         (Property.Define): Call the new Property.DoDefine(), this does some
22945         sanity checks and we don't need to duplicate the code everywhere.
22946         (Event): Derive from MemberBase, not MemberCore.
22947         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
22948         accessors, this will also make them work with interface events.
22949         (Indexer): Derive from MemberBase, not MemberCore.
22950         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
22951         (Indexer.Define): Use the new MethodBase functions.
22952
22953         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
22954         argument to the constructor.
22955         (Interface.FindMembers): Added support for interface events.
22956         (Interface.PopluateEvent): Implemented.
22957
22958         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
22959
22960 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
22961
22962         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
22963         but this is required to check for a method name being the same as
22964         the containing class.  
22965
22966         Handle this now.
22967
22968 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22969
22970         * interface.cs: initialize variable.
22971
22972 2002-07-23  Martin Baulig  <martin@gnome.org>
22973
22974         Implemented the IndexerName attribute in interfaces.
22975
22976         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
22977         name if this is an explicit interface implementation.
22978         (Indexer.InterfaceIndexerName): New public variable.  If we're
22979         implementing an interface indexer, this is the IndexerName in that
22980         interface.  Otherwise, it's the IndexerName.
22981         (Indexer.DefineMethod): If we're implementing interface indexer,
22982         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
22983         and Pending.ImplementIndexer methods.
22984         (Indexer.Define): Also define the PropertyBuilder if we're
22985         implementing an interface indexer and this is neither an explicit
22986         interface implementation nor do the IndexerName match the one in
22987         the interface.
22988
22989         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
22990         If a method is defined here, then we always need to create a proxy
22991         for it.  This is used when implementing interface indexers.
22992         (Pending.IsInterfaceIndexer): New public method.
22993         (Pending.ImplementIndexer): New public method.
22994         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
22995         This is used when implementing interface indexers to define a proxy
22996         if necessary.
22997         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
22998         define a proxy if necessary.
22999
23000         * interface.cs (Interface.IndexerName): New public variable.
23001         (Interface.PopulateIndexer): Set the IndexerName.
23002         (Interface.DefineIndexers): New private method.  Populate all the
23003         indexers and make sure their IndexerNames match.
23004
23005         * typemanager.cs (IndexerPropertyName): Added support for interface
23006         indexers.
23007
23008 2002-07-22  Martin Baulig  <martin@gnome.org>
23009
23010         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23011         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23012         ret if HasReturnLabel.
23013         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23014         variables.
23015
23016         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23017         and set the ec.LoopBeginTryCatchLevel.
23018         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23019         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23020         the current ec.TryCatchLevel, the branch goes out of an exception
23021         block.  In this case, we need to use Leave and not Br.
23022
23023 2002-07-22  Martin Baulig  <martin@gnome.org>
23024
23025         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23026         block unless the block does not always return or it is contained in
23027         another try { ... } catch { ... } block.  Fixes bug #26506.
23028         Added verify-1.cs to the test suite.
23029
23030 2002-07-22  Martin Baulig  <martin@gnome.org>
23031
23032         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23033         then we do not always return.  Fixes bug #24985.
23034
23035 2002-07-22  Martin Baulig  <martin@gnome.org>
23036
23037         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23038         lookup on a per-class level; ie. walk up the class hierarchy until we
23039         found at least one applicable method, then choose the best among them.
23040         Fixes bug #24463 and test-29.cs.
23041
23042 2002-07-22  Martin Baulig  <martin@gnome.org>
23043
23044         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23045         return types of the methods.  The return type is not part of the
23046         signature and we must not check it to make the `new' modifier work.
23047         Fixes bug #27999, also added test-147.cs.
23048         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23049
23050         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23051         on the method's return type.
23052
23053 2002-07-21  Martin Baulig  <martin@gnome.org>
23054
23055         * assign.cs: Make this work if the rightmost source is a constant and
23056         we need to do an implicit type conversion.  Also adding a few more tests
23057         to test-38.cs which should have caught this.
23058
23059         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23060         target in the makefile for this.  The makefile.gnu is primarily intended
23061         for end-users who don't want to debug the compiler.
23062
23063 2002-07-21  Martin Baulig  <martin@gnome.org>
23064
23065         * assign.cs: Improved the Assign class so it can now handle embedded
23066         assignments (X = Y = Z = something).  As a side-effect this'll now also
23067         consume less local variables.  test-38.cs now passes with MCS, added
23068         a few new test cases to that test.
23069
23070 2002-07-20  Martin Baulig  <martin@gnome.org>
23071
23072         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23073         instructions.  Fixes bug #27977, also added test-146.cs.
23074
23075 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23076
23077         * cs-tokenizer.cs: fixed getHex ().
23078
23079 2002-07-19  Martin Baulig  <martin@gnome.org>
23080
23081         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23082         not Type.GetType() to lookup the array type.  This is needed when
23083         we're constructing an array of a user-defined type.
23084         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23085         single-dimensional arrays, but also for single-dimensial arrays of
23086         type decimal.
23087
23088 2002-07-19  Martin Baulig  <martin@gnome.org>
23089
23090         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23091         this function is called, it's not allowed to share LocalBuilders
23092         among ILGenerators.
23093
23094 2002-07-19  Martin Baulig  <martin@gnome.org>
23095
23096         * expression.cs (Argument.Resolve): Report an error 118 when trying
23097         to pass a type as argument.
23098
23099 2002-07-18  Martin Baulig  <martin@gnome.org>
23100
23101         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23102         Conv_R_Un for the signed `long' type.
23103
23104 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23105
23106         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23107         `expr' for the temporary result, as that will fail if we do
23108         multiple resolves on the same expression.
23109
23110 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23111
23112         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23113         ec.TypeContainer for looking up aliases. 
23114
23115         * class.cs (TypeContainer): Remove LookupAlias from here.
23116
23117         * decl.cs (DeclSpace); Move here.
23118
23119 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23120
23121         * class.cs (FindMembers): Only call filter if the constructor
23122         bulider is not null.
23123
23124         Also handle delegates in `NestedTypes' now.  Now we will perform
23125         type lookups using the standard resolution process.  This also
23126         fixes a bug.
23127
23128         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23129         This uses Expressions (the limited kind that can be parsed by the
23130         tree) instead of strings.
23131
23132         * expression.cs (ComposedCast.ToString): Implement, used to flag
23133         errors since now we have to render expressions.
23134
23135         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23136         FormArrayType. 
23137
23138         * ecore.cs (SimpleName.ToString): ditto.
23139
23140         * cs-parser.jay: Instead of using strings to assemble types, use
23141         Expressions to assemble the type (using SimpleName, ComposedCast,
23142         MemberAccess).  This should fix the type lookups in declarations,
23143         because we were using a different code path for this.
23144
23145         * statement.cs (Block.Resolve): Continue processing statements
23146         even when there is an error.
23147
23148 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * class.cs (Event.Define): Also remove the `remove' method from
23151         the list of pending items.
23152
23153         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23154         generate more compact code. 
23155
23156 2002-07-17  Martin Baulig  <martin@gnome.org>
23157
23158         * const.cs (Const.LookupConstantValue): Add support for constant
23159         `unchecked' and `checked' expressions.
23160         Also adding test case test-140.cs for this.
23161
23162 2002-07-17  Martin Baulig  <martin@gnome.org>
23163
23164         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23165         check whether mi.ReturnType implements the IEnumerator interface; the
23166         `==' and the IsAssignableFrom() will fail in this situation.
23167
23168 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23169
23170         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23171         here too.
23172
23173 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23174
23175         * expression.cs: fixed bug #27811.
23176
23177 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23178
23179         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23180         Molaro: when we are a ref, the value already contains a pointer
23181         value, do not take the address of it.
23182
23183 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23184         * removed mb-parser.jay and mb-tokenizer.cs
23185
23186 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23187
23188         * expression.cs: check against the building corlib void type.
23189
23190 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23191
23192         * ecore.cs: fix for valuetype static readonly fields: when 
23193         initializing them, we need their address, not the address of a copy.
23194
23195 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23196
23197         * typemanager.cs: register also enum_type in corlib.
23198
23199 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23200
23201         * class.cs: allow calling this (but not base) initializers in structs.
23202
23203 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23204
23205         * ecore.cs: make sure we compare against the building base types
23206         in GetTypeSize ().
23207
23208 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23209
23210         * typemanager.cs: fix TypeToCoreType() to handle void and object
23211         (corlib gets no more typerefs after this change).
23212
23213 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23214
23215         * expression.cs (ArrayCreation.EmitArrayArguments): use
23216         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23217
23218         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23219         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23220         array indexes, the runtime actually forbids them.
23221
23222         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23223         for array arguments here.
23224
23225         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23226         instead of the default for ValueTypes.
23227
23228         (New.DoEmit): Use IsValueType instead of
23229         IsSubclassOf (value_type)
23230         (New.DoResolve): ditto.
23231         (Invocation.EmitCall): ditto.
23232
23233         * assign.cs (Assign): ditto.
23234
23235         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23236         Statements *are* currently doing part of their resolution during
23237         Emit.  
23238
23239         Expressions do always resolve during resolve, but statements are
23240         only required to propagate resolution to their children.
23241
23242 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23243
23244         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23245
23246         (LoadAssembly): Do not add the dll if it is already specified
23247
23248         (MainDriver): Add the System directory to the link path at the end,
23249         after all the other -L arguments. 
23250
23251         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23252         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23253         ldelem.u1) and using the opposite for sbytes.
23254
23255         This fixes Digger, and we can finally run it.
23256
23257         * driver.cs (UnixParseOption): Move the option parsing here.  
23258         (CSCParseOption): Implement CSC-like parsing of options.
23259
23260         We now support both modes of operation, the old Unix way, and the
23261         new CSC-like way.  This should help those who wanted to make cross
23262         platform makefiles.
23263
23264         The only thing broken is that /r:, /reference: and /lib: are not
23265         implemented, because I want to make those have the same semantics
23266         as the CSC compiler has, and kill once and for all the confussion
23267         around this.   Will be doing this tomorrow.
23268
23269         * statement.cs (Unsafe.Resolve): The state is checked during
23270         resolve, not emit, so we have to set the flags for IsUnsfe here.
23271
23272 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23273
23274         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23275         not catch the Error_ObjectRefRequired in SimpleName (as it is
23276         possible to have a class/instance variable name that later gets
23277         deambiguated), we have to check this here.      
23278
23279 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23280
23281         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23282         make static and put into Expression.
23283
23284         (Event.Define): Register the private field of the event with the 
23285         TypeManager so that GetFieldFromEvent can get at it.
23286
23287         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23288         keep track of the private field associated with an event which
23289         has no accessors.
23290
23291         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23292         private field.
23293
23294         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23295
23296 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23297
23298         * expression.cs (Binary.EmitBranchable): this routine emits the
23299         Binary expression in a branchable context.  This basically means:
23300         we need to branch somewhere, not just get the value on the stack.
23301
23302         This works together with Statement.EmitBoolExpression.
23303
23304         * statement.cs (Statement.EmitBoolExpression): Use
23305         EmitBranchable. 
23306
23307 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23308
23309         * statement.cs (For): Reduce the number of jumps in loops.
23310
23311         (For): Implement loop inversion for the For statement.
23312
23313         (Break): We can be breaking out of a Try/Catch controlled section
23314         (foreach might have an implicit try/catch clause), so we need to
23315         use Leave instead of Br.
23316
23317         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23318         now).  If the instace expression supports IMemoryLocation, we use
23319         the AddressOf method from the IMemoryLocation to extract the
23320         address instead of emitting the instance.
23321
23322         This showed up with `This', as we were emitting the instance
23323         always (Emit) instead of the Address of This.  Particularly
23324         interesting when This is a value type, as we dont want the Emit
23325         effect (which was to load the object).
23326
23327 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
23328
23329         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23330
23331         * statement.cs (Checked): Set the CheckedState during the resolve
23332         process too, as the ConvCast operations track the checked state on
23333         the resolve process, and not emit.
23334
23335         * cs-parser.jay (namespace_member_declaration): Flag that we have
23336         found a declaration when we do.  This is used to flag error 1529
23337
23338         * driver.cs: Report ok when we display the help only.
23339
23340 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
23341
23342         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23343
23344 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
23345
23346         * cs-tokenizer.cs (define): We also have to track locally the
23347         defines.  AllDefines is just used for the Conditional Attribute,
23348         but we also need the local defines for the current source code. 
23349
23350 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
23351
23352         * statement.cs (While, For, Do): These loops can exit through a
23353         Break statement, use this information to tell whether the
23354         statement is the last piece of code.
23355
23356         (Break): Flag that we break.
23357
23358         * codegen.cs (EmitContexts): New `Breaks' state variable.
23359
23360 2002-07-03  Martin Baulig  <martin@gnome.org>
23361
23362         * class.cs (TypeContainer.MethodModifiersValid): Allow override
23363         modifiers in method declarations in structs.  Otherwise, you won't
23364         be able to override things like Object.Equals().
23365
23366 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23367
23368         * class.cs (Method, Property, Indexer): Do not allow the public
23369         modifier to be used in explicit interface implementations.
23370
23371         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23372         override modifiers in method declarations in structs
23373
23374 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
23375
23376         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23377         integer or real overflow, report an error
23378
23379 2002-07-02  Martin Baulig  <martin@gnome.org>
23380
23381         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23382         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23383         to tell the runtime about our newly created System.Object and
23384         System.ValueType types.
23385
23386 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23387
23388         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23389         struct instead of Ldarg/Starg.
23390
23391 2002-07-02  Martin Baulig  <martin@gnome.org>
23392
23393         * expression.cs (Indirection.Indirection): Call
23394         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23395
23396 2002-07-02  Martin Baulig  <martin@gnome.org>
23397
23398         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23399         ValueType, call TypeManager.TypeToCoreType() on it.
23400         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23401         the OpCodes.Newarr argument.
23402
23403 2002-07-02  Martin Baulig  <martin@gnome.org>
23404
23405         * expression.cs (Invocation.EmitCall): When compiling corlib,
23406         replace all calls to the system's System.Array type to calls to
23407         the newly created one.
23408
23409         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23410         System.Array methods.
23411         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23412         from the system's System.Array type which must be replaced.
23413
23414 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23415
23416         * typemanager.cs: load unverifiable_code_ctor so we can build
23417         corlib using the correct type. Avoid using GetTypeCode() with
23418         TypeBuilders.
23419         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23420         TypeManager.object_type to allow building corlib.
23421
23422 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23423
23424         * ecore.cs: handle System.Enum separately in LoadFromPtr().
23425
23426 2002-07-01  Martin Baulig  <martin@gnome.org>
23427
23428         * class.cs: Make the last change actually work, we need to check
23429         whether `ifaces != null' to avoid a crash.
23430
23431 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23432
23433         * class.cs: when we build structs without fields that implement
23434         interfaces, we need to add the interfaces separately, since there is
23435         no API to both set the size and add the interfaces at type creation
23436         time.
23437
23438 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23439
23440         * expression.cs: the dimension arguments to the array constructors
23441         need to be converted if they are a long.
23442
23443 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23444
23445         * class.cs: don't emit ldarg.0 if there is no parent constructor
23446         (fixes showstopper for corlib).
23447
23448 2002-06-29  Martin Baulig  <martin@gnome.org>
23449
23450         MCS now compiles corlib on GNU/Linux :-)
23451
23452         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23453         ie. check for MethodImplOptions.InternalCall.
23454
23455         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23456         and TypeManager.attribute_type are null, so we must explicitly check
23457         whether parent is not null to find out whether it's an attribute type.
23458         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23459         and SetBuilder, not only if the property is neither abstract nor external.
23460         This is necessary to set the MethodImplOptions on the accessor methods.
23461         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23462         SetBuilder, see Property.Emit().
23463
23464         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23465         populate "System.Object", "System.ValueType" and "System.Attribute" since
23466         they've already been populated from BootCorlib_PopulateCoreTypes().
23467
23468 2002-06-29  Martin Baulig  <martin@gnome.org>
23469
23470         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23471         is the NullLiteral, we also need to make sure that target_type is not
23472         an enum type.   
23473
23474 2002-06-29  Martin Baulig  <martin@gnome.org>
23475
23476         * rootcontext.cs (RootContext.ResolveCore): We must initialize
23477         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23478         before calling BootstrapCorlib_ResolveDelegate ().
23479
23480 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23481
23482         * statement.cs: fixed build-breaker. All tests passed ok.
23483
23484 2002-06-27  Martin Baulig  <martin@gnome.org>
23485
23486         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23487         for System.Decimal when compiling corlib.
23488
23489 2002-06-27  Martin Baulig  <martin@gnome.org>
23490
23491         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23492         switch blocks which contain nothing but a default clause.
23493
23494 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
23495
23496        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23497
23498 2002-06-27  Martin Baulig  <martin@gnome.org>
23499
23500         * ecore.cs (PropertyExpr.PropertyExpr): Call
23501         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23502
23503         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23504         is already a TypeBuilder.
23505
23506 2002-06-27  Martin Baulig  <martin@gnome.org>
23507
23508         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23509         `target_type == TypeManager.array_type', not IsAssignableFrom() in
23510         the "from an array-type to System.Array" case.  This makes it work
23511         when compiling corlib.
23512
23513 2002-06-27  Martin Baulig  <martin@gnome.org>
23514
23515         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23516         non-static PropertyExpr, set its InstanceExpression.  This makes
23517         the `ICollection.Count' property work in System/Array.cs.
23518
23519 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
23520
23521         * driver.cs: Made error handling more consistent.  Errors now
23522         tracked by Report class, so many methods which used to return int
23523         now return void.  Main() now prints success/failure and 
23524         errors/warnings message.
23525
23526         Renamed '--probe' compiler argument to '--expect-error'.  Removed
23527         the magic number return values (123 and 124).  Now, if the
23528         expected error occurs, the compiler exits with success (exit value
23529         0).  If the compilation completes without seeing that particular
23530         error, the compiler exits with failure (exit value 1).  The
23531         makefile in mcs/errors has been changed to handle the new behaviour.
23532
23533         * report.cs: Made 'expected error' number a property and renamed
23534         it from 'Probe' to 'ExpectedError'.
23535
23536         * genericparser.cs: Removed error handling support, since it is
23537         now all done by Report class.
23538
23539         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23540         class, so parse() no longer returns an int.
23541
23542         * namespace.cs: Use Report.Error instead of GenericParser.error
23543
23544 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
23545
23546         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23547         TypeContainer.AddOperator): At the front of the list put the
23548         explicit implementations, so they get resolved/defined first. 
23549
23550 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
23551
23552         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23553         interface type is implemented by this TypeContainer.  Used during
23554         explicit interface implementation.
23555
23556         (Property.Define, Indexer.Define, Method.Define): Validate that
23557         the given interface in the explicit implementation is one of the
23558         base classes for the containing type.
23559
23560         Also if we are explicitly implementing an interface, but there is
23561         no match in the pending implementation table, report an error.
23562
23563         (Property.Define): Only define the property if we are
23564         not explicitly implementing a property from an interface.  Use the
23565         correct name also for those properties (the same CSC uses,
23566         although that is really not needed).
23567
23568         (Property.Emit): Do not emit attributes for explicitly implemented
23569         properties, as there is no TypeBuilder.
23570
23571         (Indexer.Emit): ditto.
23572
23573         Hiding then means that we do not really *implement* a pending
23574         implementation, which makes code fail.
23575
23576 2002-06-22  Martin Baulig  <martin@gnome.org>
23577
23578         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23579         the return value of Object.GetType().  [FIXME: we need to do this whenever
23580         we get a type back from the reflection library].
23581
23582 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23583
23584         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23585
23586 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
23587
23588         * attribute.cs: Return null if we can not look up the type.
23589
23590         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23591         the interface types found.
23592
23593         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23594         interface types found.
23595
23596         * typemanager.cs (GetInterfaces): Make this routine returns alll
23597         the interfaces and work around the lame differences between
23598         System.Type and System.Reflection.Emit.TypeBuilder in the results
23599         result for GetInterfaces.
23600
23601         (ExpandInterfaces): Given an array of interface types, expand and
23602         eliminate repeated ocurrences of an interface.  This expands in
23603         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23604         be IA, IB, IC.
23605
23606 2002-06-21  Martin Baulig  <martin@gnome.org>
23607
23608         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23609         on System.Enum.
23610
23611 2002-06-21  Martin Baulig  <martin@gnome.org>
23612
23613         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
23614         and called with one of the core types, return the corresponding typebuilder for
23615         that type.
23616
23617         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23618         element type.
23619
23620 2002-06-21  Martin Baulig  <martin@gnome.org>
23621
23622         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23623         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23624         (Expression.ConvertReferenceExplicit): Likewise.
23625
23626         * expression.cs (ElementAccess.DoResolve): Likewise.
23627         (ElementAccess.DoResolveLValue): Likewise.
23628
23629 2002-06-10  Martin Baulig  <martin@gnome.org>
23630
23631         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23632         add the "value" parameter to the parameter list.
23633
23634         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23635         to our caller.
23636
23637 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
23638
23639         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23640         the argument to an int, uint, long or ulong, per the spec.  Also
23641         catch negative constants in array creation.
23642
23643 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23644
23645         * class.cs: do not allow the same interface to appear twice in
23646         the definition list.
23647
23648 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23649
23650         * ecore.cs: don't use ldlen with System.Array.
23651
23652 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23653
23654         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23655
23656 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23657
23658         * modifiers.cs: produce correct field attributes for protected
23659         internal. Easy fix so miguel can work on ther harder stuff:-)
23660
23661 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
23662
23663         * pending.cs: New file.  Move the code from class.cs here.
23664         Support clearning the pending flag for all methods (when not doing
23665         explicit interface implementation).
23666
23667 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23668
23669         * rootcontext.cs: added a couple more types needed to bootstrap.
23670
23671 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
23672
23673         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23674         constructor in the type, instead of any constructor in the type
23675         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
23676         a bug in the Mono runtime when applying the params attribute). 
23677
23678 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
23679         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23680
23681 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
23682
23683         * expression.cs (Unary.ResolveOperator): Use TypeManager
23684         to resolve the type.
23685
23686 2002-06-13  Ravi Pratap  <ravi@ximian.com>
23687
23688         * cs-parser.jay (enum_member_declaration): Pass in the attributes
23689         attached.
23690
23691         * enum.cs (AddEnumMember): Add support to store the attributes associated 
23692         with each member too.
23693
23694         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
23695         field builders too - this takes care of the enum member case.
23696
23697 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
23698
23699         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
23700         address-of operator on both value types and pointers.
23701
23702 2002-06-10  Martin Baulig  <martin@gnome.org>
23703
23704         * interface.cs (Interface.PopulateIndexer): Add the indexer's
23705         PropertyBuilder to the `property_builders' list.
23706
23707         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
23708         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
23709         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
23710         find any indexers which are inherited from an interface.
23711
23712 2002-06-09  Martin Baulig  <martin@gnome.org>
23713
23714         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
23715         the same type as the constant if necessary.  There's also a test-130.cs
23716         for this.
23717
23718         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
23719
23720         * typemanager.cs (TypeManager.ChangeType): Previously known as
23721         Enum.ChangeEnumType().
23722
23723 2002-06-09  Martin Baulig  <martin@gnome.org>
23724
23725         * expression.cs (Cast.TryReduce): Added support for consts.
23726
23727 2002-06-08  Ravi Pratap  <ravi@ximian.com>
23728
23729         * class.cs (Accessor): Hold attributes information so we can pass
23730         it along.
23731
23732         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
23733         Modify to pass in attributes attached to the methods.
23734
23735         (add_accessor_declaration, remove_accessor_declaration): Ditto.
23736
23737         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
23738         to handle the Accessor kind :-)
23739
23740         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
23741
23742 2002-06-08  Martin Baulig  <martin@gnome.org>
23743
23744         * expression.cs (Unary.TryReduceNegative): Added support for
23745         ULongConstants.
23746
23747 2002-06-08  Martin Baulig  <martin@gnome.org>
23748
23749         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
23750         name can't be found in the `defined_names' - the caller will do a
23751         MemberLookup in this case and thus find methods in System.Enum
23752         such as Enum.IsDefined().
23753
23754 2002-06-08  Martin Baulig  <martin@gnome.org>
23755
23756         * enum.cs (Enum.ChangeEnumType): This is a custom version of
23757         Convert.ChangeType() which works with TypeBuilder created types.
23758         (Enum.LookupEnumValue, Enum.Define): Use it here.
23759
23760         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
23761         `TypeBuilder.BaseType != null' check.
23762         (TypeContainer.FindMembers): Only lookup parent members if we
23763         actually have a parent.
23764         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
23765         (ConstructorInitializer.Resolve): Likewise.
23766
23767         * interface.cs (Interface.FindMembers): Added
23768         `TypeBuilder.BaseType != null' check.
23769
23770         * rootcontext.cs (RootContext.ResolveCore): Added
23771         "System.Runtime.CompilerServices.IndexerNameAttribute" to
23772         classes_second_stage.
23773
23774         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
23775         debug_type and trace_type when compiling with --nostdlib.       
23776
23777 2002-06-07  Martin Baulig  <martin@gnome.org>
23778
23779         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
23780         (AddField): Set it to true when adding a non-static field.
23781         (DefineType): Use `have_nonstatic_fields' to find out whether we
23782         have non-static fields, not `Fields != null'.
23783
23784 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
23787         dereferencing a null on the static-field code path)
23788
23789 2002-05-30  Martin Baulig  <martin@gnome.org>
23790
23791         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
23792         to take command line arguments.  Use reflection to call the new
23793         custom `Initialize' function on the symbol writer and pass it the
23794         command line arguments.
23795
23796         * driver.cs (--debug-args): New command line argument to pass command
23797         line arguments to the symbol writer.
23798
23799 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
23800
23801         * assign.cs (DoResolve): Forgot to do the implicit conversion to
23802         the target type for indexers and properties.  Thanks to Joe for
23803         catching this.
23804
23805 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
23806
23807         * typemanager.cs (MethodFlags): returns the method flags
23808         (Obsolete/ShouldIgnore) that control warning emission and whether
23809         the invocation should be made, or ignored. 
23810
23811         * expression.cs (Invocation.Emit): Remove previous hack, we should
23812         not do this on matching a base type, we should do this based on an attribute
23813
23814         Only emit calls to System.Diagnostics.Debug and
23815         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
23816         on the command line.
23817
23818         * rootcontext.cs: Global settings for tracing and debugging.
23819
23820         * cs-tokenizer.cs (define): New utility function to track
23821         defines.   Set the global settings for TRACE and DEBUG if found.
23822
23823 2002-05-25  Ravi Pratap  <ravi@ximian.com>
23824
23825         * interface.cs (Populate*): Pass in the TypeContainer as well as
23826         the DeclSpace as parameters so that we can create EmitContexts and
23827         then use that to apply attributes etc.
23828
23829         (PopulateMethod, PopulateEvent, PopulateProperty)
23830         (PopulateIndexer): Apply attributes everywhere.
23831
23832         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
23833         etc.
23834
23835         (ApplyAttributes): Update accordingly.
23836
23837         We now apply interface attributes for all members too.
23838
23839 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
23840
23841         * class.cs (Indexer.Define); Correctly check if we are explicit
23842         implementation (instead of checking the Name for a ".", we
23843         directly look up if the InterfaceType was specified).
23844
23845         Delay the creation of the PropertyBuilder.
23846
23847         Only create the PropertyBuilder if we are not an explicit
23848         interface implementation.   This means that explicit interface
23849         implementation members do not participate in regular function
23850         lookups, and hence fixes another major ambiguity problem in
23851         overload resolution (that was the visible effect).
23852
23853         (DefineMethod): Return whether we are doing an interface
23854         implementation. 
23855
23856         * typemanager.cs: Temporary hack until we get attributes in
23857         interfaces (Ravi is working on that) and we get IndexerName
23858         support in interfaces.
23859
23860         * interface.cs: Register the indexers as properties.
23861
23862         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
23863         warning, I have verified that this is a bug in the .NET runtime
23864         (JavaScript suffers of the same problem).
23865
23866         * typemanager.cs (MemberLookup): When looking up members for
23867         interfaces, the parent of an interface is the implicit
23868         System.Object (so we succeed in searches of Object methods in an
23869         interface method invocation.  Example:  IEnumerable x;  x.ToString
23870         ()) 
23871
23872 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
23873
23874         * class.cs (Event): Events should also register if they do
23875         implement the methods that an interface requires.
23876
23877         * typemanager.cs (MemberLookup); use the new GetInterfaces
23878         method. 
23879
23880         (GetInterfaces): The code used to lookup interfaces for a type is
23881         used in more than one place, factor it here. 
23882
23883         * driver.cs: Track the errors at the bottom of the file, we kept
23884         on going.
23885
23886         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
23887         instance if the method we are calling is static!
23888
23889 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
23890
23891         * attribute.cs (ApplyAttributes): Make this function filter out
23892         the IndexerName attribute (as that attribute in reality is never
23893         applied) and return the string constant for the IndexerName
23894         attribute. 
23895
23896         * class.cs (TypeContainer.Emit): Validate that all the indexers
23897         have the same IndexerName attribute, and if so, set the
23898         DefaultName attribute on the class. 
23899
23900         * typemanager.cs: The return value might contain other stuff (not
23901         only methods).  For instance, consider a method with an "Item"
23902         property and an Item method.
23903
23904         * class.cs: If there is a problem with the parameter types,
23905         return. 
23906
23907 2002-05-24  Ravi Pratap  <ravi@ximian.com>
23908
23909         * ecore.cs (ImplicitConversionExists): Wrapper function which also
23910         looks at user defined conversion after making a call to 
23911         StandardConversionExists - we need this for overload resolution.
23912
23913         * expression.cs : Update accordingly the various method calls.
23914
23915         This fixes 2 bugs filed against implicit user defined conversions 
23916
23917 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
23918
23919         * statement.cs: Track the result of the assignment.
23920
23921 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
23922
23923         * expression.cs (MemberAccess): Improved error reporting for
23924         inaccessible members.
23925
23926 2002-05-22  Martin Baulig  <martin@gnome.org>
23927
23928         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
23929         itself with debugging support.
23930
23931 2002-05-22  Martin Baulig  <martin@gnome.org>
23932
23933         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
23934         Removed, this isn't needed anymore.
23935
23936 2002-05-20  Martin Baulig  <martin@gnome.org>
23937
23938         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
23939         be underlying type for an enum.
23940
23941 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
23942
23943         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
23944         that splits out the loading of just the core types.
23945
23946         * rootcontext.cs (ResolveCore): Split the struct resolution in
23947         two, so we can load the enumeration underlying types before any
23948         enums are used.
23949
23950         * expression.cs (Is): Bandaid until we fix properly Switch (see
23951         bug #24985 for details).
23952
23953         * typemanager.cs (ImplementsInterface): The hashtable will contain
23954         a null if there are no interfaces implemented.
23955
23956 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
23957
23958         * cs-parser.jay (indexer_declarator): It is fine to have array
23959         parameters
23960
23961 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
23962
23963         * typemanager.cs: (RegisterBuilder): New function used to register
23964         TypeBuilders that implement interfaces.  Since
23965         TypeBuilder.GetInterfaces (as usual) does not work with lame
23966         Reflection.Emit. 
23967         (AddUserType): register interfaces.
23968
23969         (ImplementsInterface): Use the builder_to_ifaces hash if we are
23970         dealing with TypeBuilder.  Also, arrays are showing up as
23971         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
23972         methods can not be invoked on them!
23973
23974         * ecore.cs (ExplicitReferenceConversionExists): Made public.
23975         (ImplicitReferenceConversionExists): Split out from
23976         StandardConversionExists. 
23977
23978         * expression.cs (As): We were only implementing one of the three
23979         cases for the as operator.  We now implement them all.
23980         (Is): Implement the various other cases for Is as well.
23981
23982         * typemanager.cs (CACHE): New define used to control if we want or
23983         not the FindMembers cache.  Seems to have a negative impact on
23984         performance currently
23985
23986         (MemberLookup): Nested types have full acess to
23987         enclosing type members
23988
23989         Remove code that coped with instance/static returns for events, we
23990         now catch this in RealFindMembers.
23991
23992         (RealFindMembers): only perform static lookup if the instance
23993         lookup did not return a type or an event.  
23994
23995 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
23996
23997         * assign.cs (CompoundAssign): We pass more semantic information
23998         now to Compound Assignments than we did before: now we have all
23999         the information at hand, and now we resolve the target *before* we
24000         do the expression expansion, which allows the "CacheValue" method
24001         to have the effect we intended (before, a [x] += 1 would generate
24002         two differen ArrayAccess expressions from the ElementAccess,
24003         during the resolution process).
24004
24005         (CompoundAssign.DoResolve): Resolve target and original_source here.
24006
24007 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24008
24009         * expression.cs (ArrayAccess): dropped debugging information. 
24010
24011         * typemanager.cs: Small bug fix: I was always returning i_members,
24012         instead of one of i_members or s_members (depending on which had
24013         the content).
24014
24015         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24016         method is invoked before any code generation takes place, and it
24017         is a mechanism to inform that the expression will be invoked more
24018         than once, and that the method should use temporary values to
24019         avoid having side effects
24020
24021         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24022
24023         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24024         implementation.
24025
24026         * expression.cs (Indirection, ArrayAccess): Add support for
24027         CacheTemporaries in these two bad boys. 
24028
24029         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24030         ldobj or ldind_ref.  
24031         (StoreFromPtr): Handle stobj as well.
24032
24033         * expression.cs (UnaryMutator): Share more code.
24034
24035         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24036         down: I was not tracking the Filter function as well, which
24037         was affecting the results of the cache.
24038
24039 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24040
24041         * attribute.cs: Remove the hack to handle the CharSet property on
24042         StructLayouts. 
24043
24044 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24045
24046         * attribute.cs (DoResolve): More uglyness, we now only try to
24047         resolve the attribute partially, to extract the CharSet
24048         information (only if we are a StructLayout attribute).  Otherwise 
24049
24050         (GetExtraTypeInfo): Add some code to conditionally kill in the
24051         future this.   I am more and more convinced that the .NET
24052         framework has special code to handle the attribute setting on
24053         certain elements.
24054
24055         * expression.cs (IsParamsMethodApplicable): Revert my previous
24056         foreach change here, it was wrong.
24057
24058 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24059
24060         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24061         (pp_expr): do not abort on unknown input, just return.
24062         (eval): abort if there are pending chars.
24063
24064         * attribute.cs (Attribute.Resolve): Positional parameters are
24065         optional.  Deal with that case.
24066
24067         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24068         the Ansi/Unicode/Auto information for the type.
24069
24070         (TypeContainer.DefineType): instantiate the EmitContext here, as
24071         we will be using it during the type definition (to resolve
24072         attributes) and during the emit phase.
24073
24074         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24075         to pull type information out of the attributes
24076
24077         (Attribute.Resolve): track the constructor builder, and allow for
24078         multiple invocations (structs and classes will use this).
24079
24080         * ecore.cs (MemberLookupFinal): new version with all the
24081         parameters customizable.
24082
24083         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24084         constructors.  Return if the result value is null (as the error
24085         would have been flagged already by MemberLookupFinal)
24086
24087         Do not allow instances of abstract classes or interfaces to be
24088         created.
24089
24090         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24091         We have to compare the assembly property here when dealing with
24092         FamANDAssem and Assembly access modifiers, because we might be
24093         creating an assembly from *modules* (that means that we are not
24094         getting TypeBuilders for types defined in other modules that are
24095         part of this assembly).
24096
24097         (Method.Emit): If the method is marked abstract and has a body,
24098         emit an error. 
24099
24100         (TypeContainer.DefineMembers): If both the defined member and the
24101         parent name match are methods, then do not emit any warnings: let
24102         the Method.Define routine take care of flagging warnings.  But if
24103         there is a mismatch (method overrides something else, or method is
24104         overriwritten by something, then emit warning).
24105
24106         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24107         set to null, this means `do not check for the return type on the
24108         signature'. 
24109
24110         (Method.Define): set the return type for the method signature to
24111         null, so that we get methods with the same name and parameters and
24112         different return types.  This is used to flag warning 114 (you are
24113         hiding a method, and you probably want to use the new/override
24114         keywords instead).
24115
24116         * typemanager.cs (MemberLookup): Implemented proper access
24117         control, closing a long standing set of bug reports.  The problem
24118         was that the Framework only has two bits: Public and NonPublic,
24119         and NonPublic includes private and protected methods, but we need
24120         to enforce the FamANDAssem, FamOrAssem and Family. 
24121
24122 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24123
24124         * statement.cs (GotoCase): Return true: Ammounts to giving up
24125         knowledge on whether we return or not, and letting the other case
24126         be responsible for it.
24127
24128 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24129
24130         * driver.cs: Do not load directories for each file processed, only
24131         do it if there is a pattern.
24132
24133         * ecore.cs: Report readonly assigns here as well, as we might have
24134         been resolved only by MemberAccess.
24135
24136         (SimpleName.SimpleNameResolve): Also be useful for LValue
24137         resolution.   We need this to propagate assign to local readonly variables
24138
24139         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24140         do not want to reuse potential criteria memory.
24141
24142         * class.cs (MyEventBuilder): Set reflected_type;
24143
24144         * ecore.cs (Constantify): Added support for constifying bools.
24145
24146         (RootContext.LookupType): Added a cache for values looked up in
24147         the declaration space.
24148
24149         * typemanager.cs (FindMembers): Now is a front-end to
24150         RealFindMembers, and provides a two-level hashtable-based cache to
24151         the request.  
24152
24153         15% performance improvement: from 22.5 to 19.2 seconds.
24154
24155         * expression.cs (IsParamsMethodApplicable): use foreach.
24156         (Invocation.DoResolve): ditto.
24157         (New.DoResolve): ditto.
24158         (ArrayCreation.DoResolve): ditto.
24159
24160         * ecore.cs (FindMostEncompassingType): use foreach.
24161
24162         * delegate.cs (NewDelegate.DoResolve): Use foreach
24163
24164         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24165         (RemoveMethods): use foreach.
24166
24167         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24168         nested foreach statements instead of for, and also break out of
24169         the inner loop once a match is found.
24170
24171         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24172
24173 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24174
24175         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24176         we actually unwrap the expression to allow for extra information
24177         to be extracted. 
24178
24179         * expression.cs: Use Shr_Un on unsigned operations. 
24180
24181 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24182
24183         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24184         applicable operators was not being considered correctly. This closes
24185         the bug Miguel reported.
24186
24187 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24188
24189         * attribute.cs: check that the type derives from System.Attribute
24190         and report the correct error in that case (moved the duplicate code to
24191         its own method, too).
24192
24193 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24194
24195         * attribute.cs: lookup attribute type name as the spec says: first the
24196         bare attribute name and then name + "Attribute" (nant compiles with
24197         mcs after this fix).
24198
24199 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24200
24201         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24202         Because of the way we parse things, we should try to see if a
24203         UIntConstant can fit in an integer.
24204
24205 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24206
24207         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24208         when we are in an explicit context.
24209
24210         (ConvertReferenceExplicit): When converting from Iface type S to Class
24211         T make sure the rules are implemented as an OR.
24212
24213         * parameter.cs (ParameterType): Make it a property for now although the
24214         purpose really isn't anything immediate.
24215
24216         * expression.cs (Is*Applicable): Do better checking on the parameter type
24217         of a ref/out parameter. The ones from the system assemblies are already 
24218         marked with the correct type so we don't need to do any correction.
24219
24220         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24221         the object type is standard too so include that.
24222
24223 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24224
24225         * ecore.cs (StandardConversionExists): Augment with missing code:
24226         deal with IntConstant, LongConstants and Enumerations.
24227
24228         * assign.cs: Report the error, instead of failing silently
24229
24230         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24231         typecontainer that they are declared, because the
24232         typecontainer/namespace will have the list of using clauses that
24233         need to be applied.
24234
24235         Assembly Attributes were escaping the normal registration
24236         mechanism. 
24237
24238         (EmitCode): Apply attributes within an EmitContext that represents
24239         the container they were declared on.
24240
24241         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24242
24243 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24244
24245         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24246         Revamp completely - make much cleaner as we now operate only
24247         on a set of Types.
24248
24249         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24250         to implement the logic detailed in the spec more correctly.
24251
24252         (UserDefinedConversion): Update accordingly.
24253
24254 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24255
24256         * statement.cs: Return flow analysis information up.
24257
24258         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24259         and the default.
24260
24261         (token): Do not consume an extra character before calling
24262         decimal_digits.
24263
24264 2002-05-06  Piers Haken <piersh@friskit.com>
24265
24266         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24267
24268 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24269
24270         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24271         EmitContext during the instance constructor initializer
24272         resolution, to stop access to instance variables.
24273
24274         This is mandated by the spec, last paragraph of the `constructor
24275         initializers' section. 
24276
24277 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24278
24279         * cs-parser.jay, class.cs (Accessor): new class used to represent
24280         an accessor (get or set).  In the past we used `null' to represent
24281         a missing accessor.  But this is ambiguous because there was no
24282         way to tell in abstract indexers/properties if one of them was
24283         specified.
24284
24285         Now there is a way of addressing that.
24286
24287         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24288         instead of FindMembers.
24289
24290         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24291         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24292
24293         * attribute.cs: Treat indexers and properties as the same in terms
24294         of applying attributes
24295
24296         * ecore.cs (FindMostEncompassedType): Use statically initialized
24297         EmptyExpressions()s like we do elsewhere to avoid creating useless
24298         objects (and we take this out of the tight loop).
24299
24300         (GetConversionOperators): Move the code to extract the actual
24301         operators to a separate routine to clean things up.
24302
24303 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24304
24305         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24306         events are always registered FieldBuilders.
24307
24308         * class.cs (FieldBase): New class shared by Fields 
24309
24310         * delegate.cs: If we are a toplevel delegate, use our full name.
24311         If we are a nested delegate, then only use our tail name.
24312
24313 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24314
24315         * expression.cs (IsApplicable): Ensure that we add the "&" to
24316         ref/out types before comparing it with the type of the argument.
24317
24318         (IsParamsMethodApplicable): Ditto.
24319
24320         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24321         silly me ;-)
24322
24323         * delegate.cs : Handle the case when we have more than one applicable
24324         method. Flag an error only when we finish checking all.
24325
24326 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
24327
24328         * expression.cs: Add support for boolean static initializers.
24329
24330 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
24331
24332         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24333
24334         * parameter.cs (ComputeParameterTypes,
24335         ComputeAndDefineParameterTypes): Better error handling: now we
24336         clear the `types' cache if we fail during any of the type lookups.
24337         We also return the status code correctly to our caller
24338
24339         * delegate.cs: If we fail to define a delegate, abort the extra
24340         steps. 
24341
24342         * expression.cs (Binary.ResolveOperator): for
24343         operator==(object,object) and operator !=(object, object) we also
24344         have to verify that there is an implicit conversion from one to
24345         the other.
24346
24347         (ArrayAccess.DoResolve): Array Access can operate on
24348         non-variables. 
24349
24350 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
24351
24352         * assign.cs (CompoundAssign): A new class used as a "flag" that
24353         the assignment actually is happening as part of a compound
24354         assignment operator.
24355
24356         During compound assignment, a few new rules exist to enable things
24357         like:
24358
24359         byte b |= 1 + 2
24360
24361         From the spec:
24362
24363         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24364         to the type of x) if y is implicitly convertible to the type of x,
24365         and the operator is a builtin operator and the return type of the
24366         operator is explicitly convertible to the type of x. 
24367
24368         * rootcontext.cs: Reset warning level to 2.  4 catches various
24369         "interesting" features in mcs, we must clean this up at some
24370         point, but currently am trying to kill other bugs ;-)
24371
24372         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24373         in container classes as well.  
24374
24375         * expression.cs (Binary.ResolveOperator): Handle string case
24376         before anything else (as operator overloading does emit an error
24377         before doing anything else).
24378
24379         This code could go away when we move to a table driven model, but
24380         i could not come up with a good plan last night.
24381
24382 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
24383
24384         * typemanager.cs (CSharpName): reimplementation using regex.
24385         * class.cs: added null check for fields in Emit
24386         * rootcontext.cs: set warninglevel to 4
24387
24388 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
24389
24390         * typemanager.cs (CSharpName): reimplemented with Lupus
24391         suggestion.
24392
24393 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
24394
24395         * statement.cs (If): correclty implement Resolve, because we were
24396         not catching sem errors in there.  The same process is needed
24397         everywhere else. 
24398         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24399
24400
24401         (Statement.Warning_DeadCodeFound): Factorize code.
24402         (While): Report dead code here too.
24403
24404         (Statement): Added Resolve virtual method to allow
24405         for resolution split from the emit code.
24406
24407 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24408
24409         * statement.cs (EmitBoolExpression): No longer try to resolve the
24410         expression here.    
24411         (MakeBoolean): New utility function that resolve, implicitly
24412         converts to boolean and tags the expression. 
24413
24414
24415         (If, Do): Implement dead code elimination.
24416         (While): Implement loop inversion
24417
24418         (Do, While, For, If): Resolve the expression prior to calling our
24419         code generation.
24420
24421 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
24422
24423         * class.cs:
24424           - added method Report28 (warning: program has more than one entry point)
24425           - added method IsEntryPoint, implements paragraph 10.1 of the spec
24426           - modified method Method.Define, the part at the end of the method
24427
24428         * rootcontext.cs: added static public Location EntryPointLocation;
24429           
24430         * ../errors/cs0028.cs : Add test case for the above warning.              
24431
24432         * typemanager.cs:
24433           - modified method CSharpName to allow arrays of primitive type to
24434             be printed nicely (e.g. instead of System.Int32[][] it now prints
24435             int[][])
24436           - added method CSharpSignature: returns the signature of a method
24437             in string format to be used in reporting errors, warnings, etc.
24438
24439         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24440         with String.Empty.
24441
24442 2002-04-26  Ravi Pratap  <ravi@ximian.com>
24443
24444         * delegate.cs (Define): Fix extremely silly bug where I was
24445         setting the type of the 'object' parameter of the BeginInvoke
24446         method to System.IAsyncResult instead of System.Object ;-)
24447
24448 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24449
24450         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24451         here. 
24452
24453         (Constructor.Emit): return if we fail to initialize the
24454         constructor.  Another door closed!  
24455
24456         * expression.cs (New.DoResolve): Improve error message (from -6 to
24457         1501).  Use DeclaredOnly lookup to find the exact constructor.
24458
24459         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24460         loop.  This is useful.
24461
24462         * cs-parser.jay: Adjust the default parameters so that destructors
24463         have the proper signature.
24464
24465 2002-04-26  Martin Baulig  <martin@gnome.org>
24466
24467         * driver.cs (LoadAssembly): If `assembly' contains any characters
24468         which are only valid in path names and not in assembly names
24469         (currently slash, backslash and point), use Assembly.LoadFrom ()
24470         instead of Assembly.Load () on the `assembly' (before iteration
24471         over the link_paths).
24472
24473 2002-04-26  Martin Baulig  <martin@gnome.org>
24474
24475         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24476
24477 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
24478
24479         * class.cs (Property): use the new typemanager.MemberLookup
24480
24481         (TypeContainer.MemberLookup): Implement using the
24482         TypeManager.MemberLookup now. 
24483
24484         * typemanager.cs: Make MemberLookup a function of the TypeManager,
24485         and return MemberInfos, so that these can be used without an
24486         EmitContext (what we had before).
24487
24488 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
24489
24490         * expression.cs: Fix the case where the argument to params if the
24491         type of the params.  I omitted handling this before.   Fixed
24492
24493 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24494
24495         * driver.cs: Call BootCorlib_PopulateCoreType
24496
24497         * class.cs (Property.CheckBase): Check for properties only, not
24498         for all members. 
24499
24500         * interface.cs: Temporary hack: try/catch around the
24501         CustomAttributeBuilder, because I am getting an exception that I
24502         do not understand.
24503
24504         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24505         types whose definitions are required to be there (attributes are
24506         defined before standard types).
24507
24508         Compute definitions as we boot the various types, as they are used
24509         immediately (value_type class will need object_type, but if we do
24510         not initialize object_type, we will pass a null, which will let
24511         the runtime pick the System.Object from the existing corlib, which
24512         is not what we want).
24513
24514 2002-04-22  Patrik Torstensson <totte@labs2.com>
24515
24516         * cs-tokenizer.cs: fixed a number of trim() issues.
24517
24518 2002-04-22  Ravi Pratap  <ravi@ximian.com>
24519
24520         * expression.cs (Argument.Type): Ensure that we return the correct
24521         type when we have out or ref parameters [in which case we 
24522         append a "&"].
24523
24524 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24525
24526         * class.cs (Property, Indexer): Allow extern modifier in there. 
24527
24528         * typemanager.cs (InitBaseTypes): Initializes object_type and
24529         value_type, since those will be used early on during the bootstrap
24530         process to compile corlib.
24531
24532         (InitCoreTypes): Move code from here to InitBaseTypes.
24533
24534 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
24535
24536         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24537         single-dimension arrays as using the ldlen opcode.  
24538
24539         Daniel Lewis discovered this optimization.  
24540
24541         * typemanager.cs: Add signature for System.Array::get_Length
24542
24543 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24544
24545         * statement.cs: report the error when the foreach does not apply to an
24546         array nor a collection.
24547
24548 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
24549
24550         * expression.cs: Add implicit conversions to the operator ~.
24551
24552         * constant.cs (DecimalConstant.Emit): Emit decimal value.
24553
24554         * typemanager.cs: Locate the decimal constructor.
24555
24556 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24557
24558         * attribute.cs: use the new property of TypeOf.
24559         * expression.cs: added 'get' property around typearg.
24560
24561         These changes fix a build breaker reported by NickD. Is this the
24562         correct way to fix?  If not, please, revert my changes and make it
24563         work :-).
24564
24565 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
24566
24567         * attribute.cs: Add support for typeof in attribute invocations.
24568         I am not sure that this is right though.
24569
24570 2002-04-14  Duncan Mak  <duncan@ximian.com>
24571
24572         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24573         Binary.Operator.Division case.
24574
24575 2002-04-13  Ravi Pratap  <ravi@ximian.com>
24576
24577         * class.cs (DefineType): Ensure that we do a proper check on
24578         attribute types and also register it with the TypeManager.
24579
24580         (TypeContainer.Targets): The default for attribute types is
24581         AttributeTargets.All.
24582
24583         * attribute.cs (ApplyAttributes): Registering the attribute type
24584         is done elsewhere, not when we discover we have a Usage attribute.
24585
24586 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24587
24588         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24589         and get rid of is_delegate parameter.
24590
24591         * everywhere : update.
24592
24593 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24594
24595         * cs-parser.jay (compilation_unit): Revamp completely to use
24596         some new ideas that I got from Rhys' grammar to solve the problems
24597         with assembly level attributes.
24598
24599         (outer_declaration): New grammar production.
24600
24601         (attribute_sections): Add.
24602
24603         (opt_attributes): Base on attribute_sections
24604
24605         (namespace_declaration): Allow opt_attributes to tackle the case
24606         when we have assembly level attributes - we are clever in this
24607         regard now ;-)
24608
24609         * attribute.cs (ApplyAttributes): Do not worry about assembly 
24610         attributes in the non-global context.
24611
24612         * rootcontext.cs (AddGlobalAttributes): Go back to using this
24613         instead of SetGlobalAttributes.
24614
24615         * class.cs, rootcontext.cs : Ensure we define and generate 
24616         attribute types before anything else.
24617
24618         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24619         and flag the new error -20 for the case when the attribute type
24620         does not have valid targets specified. csc does not catch this.
24621
24622         * ../errors/errors.txt : update for error # -20
24623
24624 2002-04-11  Ravi Pratap  <ravi@ximian.com>
24625
24626         * support.cs (InternalParameters.ParameterModifier): Do some null
24627         checking and return sane values.
24628
24629         * class.cs (Method.Define): If we are a PInvoke method, ensure
24630         that we are static and extern. Report error # 601
24631
24632         * ../errors/cs0601.cs : Add test case for the above error.
24633
24634 2002-04-07  Ravi Pratap  <ravi@ximian.com>
24635
24636         * rootcontext.cs (attribute_types): We need to keep type of
24637         all attribute types separately and emit code for them first.
24638
24639         (RegisterAttribute) : Implement.
24640
24641         * class.cs (DefineType): Check if the current Type is a custom
24642         attribute type and register it accordingly.
24643
24644         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24645         adding the first attribute twice and rename to
24646
24647         (SetGlobalAttributes): this.
24648
24649         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24650         lookups.
24651
24652         * attribute.cs (ApplyAttributes): Take an additional argument telling us
24653         if we are processing global arguments. Hmm, I am unsure of this.
24654
24655 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24656
24657         * expression.cs: added static array of strings to avoid calling
24658         Enum.ToString () for Operator in Binary. Significant recover of
24659         performance.
24660
24661 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
24662
24663         * class.cs (FindMembers): Allow the Builders of the various
24664         members to be null.  If they are skip them.  This only happens
24665         during the PInvoke declaration.
24666
24667 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
24668
24669         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24670         failure, so we do not keep going afterwards.
24671
24672         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24673         wanted to pass `false' as the `is_delegate' argument.  If this is
24674         the case, why not use delegate_type == null to mean `is_delegate =
24675         false' and anything else as is_delegate = true.
24676
24677 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
24678
24679         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24680         code for the section, not the beginning of the tests.
24681
24682 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
24683
24684         * cfold.cs: Handle operator + (Enum x, Underlying x) 
24685
24686         * expression.cs (Binary): same.  Warn about errors where we have
24687         Enum/Enum in operator + as well.
24688
24689 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
24690
24691         * statement.cs:
24692                 - added support for switch(bool)
24693                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
24694                 - add TableSwitchEmit() to handle table-based switch statements
24695
24696 2002-04-05  Ravi Pratap  <ravi@ximian.com>
24697
24698         * expression.cs (Invocation.OverloadResolve): Factor out code which
24699         does parameter compatibility checking with arguments so that we can 
24700         re-use the code even from Delegate.VerifyApplicability
24701
24702         (VerifyArgumentsCompat): Move above code here.
24703
24704         * delegate.cs (VerifyApplicability): Get rid of duplicate code
24705         and instead make a call to the above method.
24706
24707 2002-03-31  Ravi Pratap  <ravi@ximian.com>
24708
24709         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
24710         We use it to keep track of classes which are attribute types.
24711
24712 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
24713
24714         * delegate.cs (Delegate.Define): Correctly define the types in the
24715         presence of fixed and array parameters.
24716
24717         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
24718         doing FindMembers.
24719
24720         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
24721         include NonPublic after the first iteration.
24722
24723         * class.cs (Indexer.CheckBase): Only check if both parents are
24724         non-null. 
24725
24726         * cs-parser.jay (accessor_body): If empty, set to null.
24727
24728         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
24729         same code path here to resolve constants names that we did have in
24730         MemberAccess.DoResolve.  There is too much code duplicated here.
24731
24732 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
24733
24734         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
24735
24736         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
24737         to MakeUnionSet.
24738
24739         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
24740         tokens, numbers and strings.
24741
24742         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
24743         parenthesis.
24744
24745         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
24746         asyncronous parameters and the regular parameters.  
24747
24748         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
24749         specify the target directory.
24750
24751         * expression.cs: (This.DoResolve): Simplify
24752         (As.Emit): Optimize, do not generate IsInst if the expression is
24753         always of the given type.
24754
24755         (Is.DoResolve): Bug fix, we were reporting both always/never for
24756         the is expression.
24757
24758         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
24759         creating too many unnecessary arrays.
24760
24761 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
24762
24763         * class.cs (EmitFieldInitializer): Use Assign expression to assign
24764         fields instead of rolling our own initializer.   Takes care of all
24765         implicit conversions, and drops unnecessary static checks/argument.
24766
24767 2002-03-31  Dick Porter  <dick@ximian.com>
24768
24769         * driver.cs: use the GetDirectories() return values properly, and
24770         use "/" as path separator.
24771
24772 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
24773
24774         * expression.cs (Unary): Optimize - - expr into expr.
24775         (Binary): Optimize a + (-b) into a -b.
24776
24777         * codegen.cs (CodeGen): Made all methods static.
24778
24779 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
24780
24781         * rootcontext.cs: 
24782
24783         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
24784         TypeBuilder property.
24785
24786         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
24787         instead. 
24788
24789         * tree.cs: Removed the various RecordXXXX, and replaced with a
24790         single RecordDecl.  Removed all the accessor methods, and just
24791         left a single access point Type 
24792
24793         * enum.cs: Rename DefineEnum to DefineType.
24794
24795         * decl.cs: New abstract method `DefineType' used to unify the
24796         Defines for Enumerations, Interfaces, TypeContainers and
24797         Delegates.
24798
24799         (FindType): Moved LookupInterfaceOrClass here.  Moved the
24800         LookupBaseClasses method that used to live in class.cs and
24801         interface.cs here, and renamed to FindType.
24802
24803         * delegate.cs: Implement DefineType.  Take advantage of the
24804         refactored pattern for locating the parent builder without taking
24805         the parent_builder argument (which we know does not work if we are
24806         nested, and triggering a toplevel definition).
24807
24808 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24809
24810         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
24811         accessibility of a member has changed during override and report
24812         an error if so.
24813
24814         * class.cs (Method.Define, Property.Define): Only complain on
24815         overrides if the method is private, any other accessibility is
24816         fine (and since we just checked the permission is the same, we are
24817         good to go).
24818
24819         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
24820         and elif are processed always.  The other pre-processing
24821         directives are only processed if we are "taking" the path
24822
24823 2002-03-29  Martin Baulig  <martin@gnome.org>
24824
24825         * class.cs (Method.Emit): Only emit symbolic debugging info if the
24826         current location is not Null.
24827
24828         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
24829         a separate method so we can profile it.
24830
24831         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
24832         `span.Seconds' are just seconds, but no minutes or hours.
24833         (MainDriver): Profile the CodeGen.SaveSymbols calls.
24834
24835 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24836
24837         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
24838         Remove the gratuitous set of Final:
24839
24840                                 // If an interface implementation, then we can set Final.
24841                                 if (((flags & MethodAttributes.Abstract) == 0) &&
24842                                     implementing.DeclaringType.IsInterface)
24843                                         flags |= MethodAttributes.Final;
24844
24845         I do not know what I was smoking when I used that.
24846
24847
24848         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
24849         step into fixing the name resolution issues for delegates and
24850         unifying the toplevel name resolution.
24851
24852 2002-03-28  Martin Baulig  <martin@gnome.org>
24853
24854         * class.cs (Method.Emit): If we have a symbol writer, call its
24855         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
24856         tell it about the current method.
24857
24858         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
24859         writer that we're going to emit the first byte of IL code for a new
24860         statement (a new source line).
24861         (EmitContext.EmitTopBlock): If we have a symbol writer, call
24862         EmitContext.Mark() before emitting any code.
24863
24864         * location.cs (SymbolDocument): Return null when we're Null.
24865
24866         * statement.cs (Statement): Moved the `Location loc' variable here.
24867         (Statement.EmitBoolExpression): If we have a symbol writer, call
24868         ec.Mark() before emitting any code to tell it that we're at the
24869         beginning of a new statement.
24870         (StatementExpression): Added `Location' argument to the constructor.
24871         (Block): Added public readonly variable `StartLocation' and public
24872         variable `EndLocation'.  The latter is to be set using SetEndLocation().
24873         (Block): Added constructor which takes a start and end location.
24874         (Block.SetEndLocation): New method. This sets the end location.
24875         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
24876         local variables we create.
24877         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
24878         each statement and do also mark the begin and end of the block.
24879
24880         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
24881         tell it the current lexer.Location, use Location.Null for the end of the
24882         block.
24883         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
24884         current block, set its end location using SetEndLocation().
24885         (statement_expression): StatementExpression constructor now takes the
24886         lexer.Location as additional argument.
24887         (for_statement, declare_local_variables): Likewise.
24888         (declare_local_variables): When creating a new implicit block, use the
24889         new Block constructor and pass it the lexer.Location.
24890
24891 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24892
24893         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
24894         members also on the parent interfaces recursively.
24895
24896 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
24897
24898         * report.cs: Use new formats, since Gonzalo finished the missing
24899         bits. 
24900
24901         * expression.cs (Binary.ResolveOperator): added missing operator|
24902         operator& and operator^ for bool/bool.
24903
24904         * cs-parser.jay: CheckDef now takes a Location argument that is
24905         used to report errors more precisly (instead of reporting the end
24906         of a definition, we try to track something which is a lot closer
24907         to the source of the problem).
24908
24909         * cs-tokenizer.cs: Track global token use, so we can properly flag
24910         the use of #define/#undef after the first token has been seen.
24911
24912         Also, rename the reportXXXX to Error_DescriptiveName
24913
24914         * decl.cs (DeclSpace.IsTopLevel): Move property here from
24915         TypeContainer, so that Enum and Interface can use this too.
24916
24917         * class.cs (TypeContainer.LookupInterfaceOrClass,
24918         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
24919         `builder' argument.  Typically this was used to pass the parent
24920         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
24921         the definition).  
24922
24923         The problem is that a nested class could trigger the definition of
24924         a toplevel class, and the builder would be obviously wrong in that
24925         case. 
24926
24927         So we drop this argument, and we compute dynamically the
24928         TypeBuilder/ModuleBuilder (the correct information was available
24929         to us anyways from DeclSpace.Parent)
24930
24931         * interface.cs (Interface.DefineInterface): Drop builder
24932         parameter cleanup like class.cs
24933
24934         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
24935         like class.cs
24936
24937         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
24938         values. 
24939
24940         (Try.Emit): Propagate the returns value from the statement.
24941
24942         (Return.Emit): Even if we are leavning 
24943
24944         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
24945
24946         * modifiers.cs: Fix the computation of MethodAttributes flags.
24947
24948 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
24949
24950         * driver.cs: allow compilation of files that start with '/'.
24951         Add a default case when checking the argument of --target.
24952
24953 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
24954
24955         * interface.cs: Implement the same search algorithm for types in
24956         the interface code.
24957
24958         * delegate.cs: Do not allow multiple definition.
24959
24960         * Recovered ChangeLog that got accidentally amputated
24961
24962         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
24963
24964         * rootcontext.cs: Load manually enum to allow core classes to
24965         contain enumerations.
24966
24967         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
24968         Update to new static methods in TypeManager.
24969
24970         * typemanager.cs (GetMethod, GetConstructor): Use our
24971         implementation of FindMembers to find the members, since during
24972         corlib compilation, the types are TypeBuilders and GetMethod and
24973         GetConstructor do not work.
24974
24975         Make all methods in TypeManager static.
24976
24977         (InitCodeHelpers): Split the functionality from
24978         the InitCodeTypes function.
24979
24980         * driver.cs: Call InitCodeHelpers after we have populated the
24981         types. 
24982
24983         * cs-parser.jay (delegate_declaration): we did not used to compute
24984         the delegate name correctly for void delegates.
24985
24986 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
24987
24988         * rootcontext.cs (RootContext): Init the interface_resolve_order
24989         and type_container_resolve_order always.
24990
24991         (ResolveCore, BootstrapCorlib_ResolveClass,
24992         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
24993         compiler when compiling with --nostdlib
24994
24995         * class.cs (TypeContainer.DefineType): Check that our parent is
24996         not null.  This test is most important when we are bootstraping
24997         the core types.
24998
24999         * codegen.cs: Split out the symbol writing code.
25000
25001 2002-03-25  Martin Baulig  <martin@gnome.org>
25002
25003         * driver.cs (-g): Made -g an alias for --debug.
25004
25005 2002-03-24  Martin Baulig  <martin@gnome.org>
25006
25007         * codegen.cs (SymbolWriter): New public variable. Returns the
25008         current symbol writer.
25009         (CodeGen): Added `bool want_debugging_support' argument to the
25010          constructor. If true, tell the ModuleBuild that we want debugging
25011         support and ask it for the ISymbolWriter.
25012         (Save): If we have a symbol writer, call it's Close() method after
25013         saving the assembly.
25014
25015         * driver.c (--debug): New command line argument to create a
25016         debugger information file.
25017
25018         * location.cs (SymbolDocument): New public property. Returns an
25019         ISymbolDocumentWriter object for the current source file or null
25020         if we don't have a symbol writer.
25021
25022 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25023
25024         * driver.cs (LoadAssembly): Correctly return when all the paths
25025         have been tried and not before.
25026
25027         * statement.cs (Switch.Emit): return the actual coverage for this
25028         statement (returns/not-returns)
25029
25030         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25031         switch of the statement if we are the last switch section.  That
25032         kills two problems: try/catch problems (we used to emit an empty
25033         nop at the end) and switch statements where all branches would
25034         return. 
25035
25036 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25037
25038         * driver.cs: Add default assemblies (the equivalent to the
25039         Microsoft CSC.RSP file)
25040
25041         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25042         also update tokens_seen and set it to false.
25043
25044         * driver.cs: Implement --recurse for Mike.
25045
25046         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25047         correctly splitting out the paths.
25048
25049 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25050
25051         * interface.cs (Interface.PopulateProperty): Instead of using
25052         `parent' as the declaration space for the set parameters, use
25053         `this' 
25054
25055         * support.cs (InternalParameters): InternalParameters constructor
25056         takes a DeclSpace instead of a TypeContainer.
25057
25058         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25059         types are being initialized, load the address of it before calling
25060         the function.  
25061
25062         (New): Provide a mechanism to disable the generation of local
25063         value type temporaries when the caller will be providing us with
25064         an address to store it.
25065
25066         (ArrayCreation.EmitDynamicInitializers): Use it.
25067
25068 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25069
25070         * expression.cs (Invocation.EmitArguments): Only probe for array
25071         property if there is more than one argument.  Sorry about that.
25072
25073         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25074         empty param arrays.
25075
25076         * class.cs (Method.LabelParameters): Fix incorrect code path that
25077         prevented the `ParamArrayAttribute' from being applied to the
25078         params attribute.
25079
25080 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25081
25082         * support.cs (ReflectionParameters): Correctly compute whether the
25083         last argument is a params array.  Fixes the problem with
25084         string.Split ('a')
25085
25086         * typemanager.cs: Make the assemblies array always be non-null
25087         (empty, but non-null)
25088
25089         * tree.cs (RecordDecl): New function that abstracts the recording
25090         of names.  This reports error 101, and provides a pointer to the
25091         previous declaration.  Fixes a crash in the compiler.
25092
25093         * cs-parser.jay (constructor_declaration): Update to new grammar,
25094         and provide a constructor_body that can be empty.
25095
25096 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25097
25098         * driver.cs: Add support for --resources.
25099
25100         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25101         Make all types for the various array helper methods be integer.
25102
25103         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25104         CheckState to ConvCast.
25105
25106         (ConvCast): Now it takes a `checked' state argument, to avoid
25107         depending on the emit context for the conversion, and just using
25108         the resolve time setting.
25109
25110         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25111         instead of Invocation.EmitArguments.  We do not emit the original
25112         arguments, instead we emit those which have been converted to
25113         unsigned int expressions.
25114
25115         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25116
25117         * codegen.cs: ditto.
25118
25119         * expression.cs (LocalVariableReference): Drop the use of the
25120         Store function that depended on the variable index.
25121
25122         * statement.cs (VariableInfo): Drop the `Idx' property from this
25123         class, as this is not taking into account the indexes for
25124         temporaries tat we generate during the execution, getting the
25125         indexes wrong.
25126
25127         * class.cs: First emit class initializers, then call the parent
25128         constructor. 
25129
25130         * expression.cs (Binary): Fix opcode emision.
25131         (UnaryMutator.EmitCode): Support checked code generation
25132
25133         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25134         matches for events for both the Static and Instance scans,
25135         pointing to the same element.   Fix that.
25136
25137 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25138
25139         * rootcontext.cs (ResolveTree): Always set the
25140         interface_resolve_order, because nested interfaces will be calling
25141         into us.
25142
25143         * class.cs (GetInterfaceOrClass): Track the same resolution
25144         process used by TypeManager.LookupType.  This fixes the nested
25145         type lookups in class declarations (separate path from
25146         LookupType). 
25147
25148         (TypeContainer.DefineType): Also define nested interfaces.
25149         (TypeContainer.RegisterOrder): New public function used to
25150         register the order in which child interfaces need to be closed.
25151
25152         Nested interfaces need to be closed after their parents have been
25153         created. 
25154
25155         * interface.cs (InterfaceAttr): Put all the logic for computing
25156         the interface attribute here. 
25157
25158         (DefineInterface): Register our interface order with the
25159         RootContext or with the TypeContainer depending on the case.
25160
25161 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25162
25163         * cs-parser.jay: rework foreach statement to work with the new
25164         changes to the policy on SimpleNames.
25165
25166         * report.cs: support Stacktrace on warnings as well.
25167
25168         * makefile: drop --unsafe and /unsafe from the compile.
25169
25170 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25171
25172         * ecore.cs (StandardConversionExists): Modify to take an Expression
25173         as the first parameter. Ensure we do null -> reference type conversion
25174         checking.
25175
25176         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25177         temporary Expression objects.
25178
25179 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25180
25181         * interface.cs: workaround bug in method overloading resolution
25182         (there is already a bugzilla bug for it).
25183
25184 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25185
25186         We could also solve this problem by having a separate path for
25187         performing type lookups, instead of DoResolve, we could have a
25188         ResolveType entry point, and only participating pieces of the
25189         production (simplename, deref, array) would implement this. 
25190
25191         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25192         signal SimpleName to only resolve type names and not attempt to
25193         resolve anything else.
25194
25195         * expression.cs (Cast): Set the flag.
25196
25197         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25198
25199         * class.cs: Only report 108 if there is no `new' modifier.
25200
25201         * cs-parser.jay: rework foreach statement to work with the new
25202         changes to the policy on SimpleNames.
25203
25204         * report.cs: support Stacktrace on warnings as well.
25205
25206         * makefile: drop --unsafe and /unsafe from the compile.
25207
25208 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25209
25210         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25211         lookups here, instead of doing that at parse time.  This means
25212         that our grammar will not introduce `LocalVariableReferences' as
25213         expressions at this point.  That solves the problem of code like
25214         this:
25215
25216         class X {
25217            static void Main ()
25218            { int X = 1;
25219             { X x = null }}}
25220
25221         This is only half the fix.  The full fix requires parameters to
25222         also be handled in this way.
25223
25224         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25225         makes the use more obvious of the DeclSpace.  The
25226         ec.TypeContainer.TypeBuilder is now only used to pull the
25227         TypeBuilder for it.
25228
25229         My theory is that I can get rid of the TypeBuilder completely from
25230         the EmitContext, and have typecasts where it is used (from
25231         DeclSpace to where it matters).  
25232
25233         The only pending problem is that the code that implements Aliases
25234         is on TypeContainer, and probably should go in DeclSpace.
25235
25236         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25237         lookups here, instead of doing that at parse time.  This means
25238         that our grammar will not introduce `LocalVariableReferences' as
25239         expressions at this point.  That solves the problem of code like
25240         this:
25241
25242         class X {
25243            static void Main ()
25244            { int X = 1;
25245             { X x = null }}}
25246
25247         This is only half the fix.  The full fix requires parameters to
25248         also be handled in this way.
25249
25250         * class.cs (Property.DefineMethod): When implementing an interface
25251         method, set newslot, when implementing an abstract method, do not
25252         set the flag (before we tried never setting it, or always setting
25253         it, which is the difference).
25254         (Indexer.DefineMethod): same.
25255         (Method.DefineMethod): same.
25256
25257         * ecore.cs: Only set the status used flag if we get back a Field.
25258
25259         * attribute.cs: Temporary hack, so Paolo can keep working.
25260
25261 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25262
25263         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25264         the unmanaged type in the case we have a MarshalAs attribute.
25265
25266         (Resolve): Handle the case when we are parsing the special MarshalAs
25267         attribute [we need to store the unmanaged type to use later]
25268
25269         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25270         MarshalAs Attribute.
25271
25272         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25273         on parameters and accordingly set the marshalling info.
25274
25275 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25276
25277         * class.cs: Optimizing slightly by removing redundant code after
25278         we switched to the `NoTypes' return value.
25279         (Property.DefineMethod): use NoTypes here too.
25280
25281         This fixes the bug I introduced in my last batch of changes.
25282
25283 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25284
25285         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25286
25287         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25288         Enums since those are types too. 
25289
25290         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25291
25292         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25293         thanks to a call during the lookup process.
25294
25295 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25296
25297         * statement.cs (Foreach): Lots of work to accomodate a particular
25298         kind of foreach statement that I had not kept in mind.  It is
25299         possible to have foreachs on classes that provide a GetEnumerator
25300         method that return objects that implement the "pattern" for using
25301         a foreach, there is no need to support GetEnumerator
25302         specifically. 
25303
25304         This is needed to compile nant.
25305
25306         * decl.cs: Only report 114 if the member is not `Finalize' and if
25307         the warning level is at least 2.
25308
25309         * class.cs: Moved the compare function from Method to
25310         MethodSignature. 
25311
25312         (MethodSignature.InheritableMemberSignatureCompare): Add new
25313         filter function that is used to extract inheritable methods from a
25314         class. 
25315
25316         (Method.Define): Use the new `inheritable_method_signature_filter'
25317         delegate
25318
25319         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25320         command. 
25321
25322 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25323
25324         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25325
25326         * cs-parser.jay: Add opt_semicolon to the interface declaration.
25327
25328         * expression.cs: Pass location information to
25329         ConvertImplicitStandard. 
25330
25331         * class.cs: Added debugging code to track return values from
25332         interfaces. 
25333
25334 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
25335
25336         * expression.cs (Is.DoResolve): If either side of the `is' is an
25337         interface, do not flag the warning.
25338
25339         * ecore.cs (ImplicitReferenceConversion): We need a separate test
25340         for interfaces
25341
25342         * report.cs: Allow for --fatal to be used with --probe.
25343
25344         * typemanager.cs (NoTypes): Move the definition for the empty Type
25345         array here. 
25346
25347         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25348         properties. 
25349         (TypeContainer.DefineProxy): New function used to proxy to parent
25350         implementations when implementing interfaces.
25351         (TypeContainer.ParentImplements): used to lookup if our parent
25352         implements a public function that is required by an interface.
25353         (TypeContainer.VerifyPendingMethods): Hook this up.
25354
25355         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25356         `modules' and `assemblies' arraylists into arrays.  We only grow
25357         these are the very early start up of the program, so this improves
25358         the speedof LookupType (nicely measured).
25359
25360         * expression.cs (MakeByteBlob): Replaced unsafe code with
25361         BitConverter, as suggested by Paolo.
25362
25363         * cfold.cs (ConstantFold.Binary): Special case: perform constant
25364         folding of string concatenation, but if either side is a string,
25365         and the other is not, then return null, and let the runtime use
25366         the concatenation on the string plus the object (using
25367         `Object.ToString'). 
25368
25369 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
25370
25371         Constant Folding has been implemented now.
25372
25373         * expression.cs (Unary.Reduce): Do not throw an exception, catch
25374         the error instead on types that are not supported in one's
25375         complement. 
25376
25377         * constant.cs (Constant and all children): New set of functions to
25378         perform implict and explicit conversions.
25379
25380         * ecore.cs (EnumConstant): Implement the new functions to perform
25381         conversion by proxying to the child expression.
25382
25383         * codegen.cs: (ConstantCheckState): Constant evaluation has its
25384         own separate setting that can not be turned off from the command
25385         line using --unchecked or --checked and is only controlled using
25386         the checked/unchecked statements and expressions.  This setting is
25387         used by the constant folder to flag errors.
25388
25389         * expression.cs (CheckedExpr, UncheckedExpr): Set the
25390         ConstantCheckState as well.   
25391
25392         During Resolve, they also have to flag the state, because the
25393         constant folder runs completely in the Resolve phase.
25394
25395         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25396         well.
25397
25398 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25399
25400         * cfold.cs: New file, this file contains the constant folder.
25401
25402         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25403         argument to track whether we are using the resulting address to
25404         load or store a value and provide better error messages. 
25405
25406         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25407         new AddressOf arguments.
25408
25409         * statement.cs (Foreach.EmitCollectionForeach): Update
25410
25411         * expression.cs (Argument.Emit): Call AddressOf with proper
25412         arguments to track usage.
25413
25414         (New.DoEmit): Call AddressOf with new arguments.
25415
25416         (Unary.Emit): Adjust AddressOf call.
25417
25418 2002-03-01  Ravi Pratap  <ravi@ximian.com>
25419
25420         * cs-parser.jay (member_access): Change the case for pre-defined types
25421         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
25422         this suggestion.
25423
25424         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25425         a method body.
25426
25427         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25428         essentially like methods and apply attributes like MethodImplOptions to them too.
25429
25430         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25431         not being null.
25432
25433         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25434         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25435         is the DeclSpace.
25436
25437         * Update code everywhere accordingly.
25438
25439         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25440
25441         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25442
25443 2002-02-28  Ravi Pratap  <ravi@ximian.com>
25444
25445         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25446         try performing lookups against those instead of jumping straight into using
25447         the 'using' clauses.
25448
25449         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25450
25451         (LookupType): Perform lookups in implicit parents too.
25452
25453         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25454         sequence as RootContext.LookupType. 
25455
25456         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
25457         the various cases of namespace lookups into this method.
25458
25459 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25460
25461         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25462         in positional arguments)
25463
25464         * class.cs (Operator): Update the AllowedModifiers to contain
25465         extern. 
25466
25467         * cs-parser.jay: Update operator declaration to allow for the
25468         operator body to be empty.
25469
25470         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25471         values. 
25472
25473 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
25474
25475         * class.cs (Method.Emit): Label parameters.
25476
25477         * driver.cs: Return 1 or 0 as the program exit code.
25478
25479 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
25480
25481         * expression.cs: Special case the `null' object when trying to
25482         auto-compute the type, as anything can be explicitly converted to
25483         that. 
25484
25485         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25486         spotting this Paolo.
25487
25488         (Expression.ImplicitNumericConversion): Perform comparissions of
25489         the type using the underlying type in the case of an enumeration
25490         rather than using the enumeration type for the compare.
25491
25492         Cope with the underlying == type case, which is not possible to
25493         catch before. 
25494
25495         (Expression.ConvertNumericExplicit): Perform comparissions of
25496         the type using the underlying type in the case of an enumeration
25497         rather than using the enumeration type for the compare.
25498
25499         * driver.cs: If the user does not supply an extension, assume .exe
25500
25501         * cs-parser.jay (if_statement): Rewrote so that we can track the
25502         location for the if statement.
25503
25504         * expression.cs (Binary.ConstantFold): Only concat strings when
25505         the operation is "+", not everything ;-)
25506
25507         * statement.cs (Statement.EmitBoolExpression): Take a location
25508         argument. 
25509         (If, While, Do): Track location.
25510
25511         * expression.cs (Binary.ResolveOperator): In the object + string
25512         case, I was missing a call to ConvertImplicit
25513
25514 2002-02-25  Ravi Pratap  <ravi@ximian.com>
25515
25516         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25517         Location arguments. Ensure we use RootContext.LookupType to do our work
25518         and not try to do a direct Type.GetType and ModuleBuilder.GetType
25519
25520         * interface.cs (PopulateMethod): Handle the type of the parameter being
25521         null gracefully.
25522
25523         * expression.cs (Invocation.BetterFunction): Handle the case when we 
25524         have a params method with no fixed arguments and a call is made with no
25525         arguments.
25526
25527 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
25528
25529         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25530         the verbatim-string-literal
25531
25532         * support.cs (InternalParameters.ParameterModifier): handle null
25533         fixed parameters.
25534         (InternalParameters.ParameterType): ditto.
25535
25536         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25537         duplicating the name of the variable parameter.
25538         (GetParameterByName): Fix bug where we were not looking up array
25539         paramters if they were the only present (thanks Paolo!).
25540         (GetParameterInfo): We only have an empty set of types if both
25541         fixed and array are set to null.
25542         (GetParameterInfo-idx): Handle FixedParameter == null
25543
25544         * cs-parser.jay: Handle the case where there is no catch
25545         statements (missing null test).
25546
25547 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
25548
25549         * driver.cs (MainDriver): Be conservative on our command line
25550         handling.
25551
25552         Catch DirectoryNotFoundException when calling GetFiles.
25553
25554         (SplitPathAndPattern): Used to split the input specification into
25555         a path and a pattern that we can feed to Directory.GetFiles.
25556
25557 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
25558
25559         * statement.cs (Fixed): Implement the last case of the Fixed
25560         statement (string handling).
25561
25562         * expression.cs (StringPtr): New class used to return a char * to
25563         a string;  Used by the Fixed statement.
25564
25565         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
25566
25567         * expression.cs (Binary.ResolveOperator): Remove redundant
25568         MemberLookup pn parent type.
25569         Optimize union call, we do not need a union if the types are the same.
25570         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25571         type.
25572
25573         Specialize the use of MemberLookup everywhere, instead of using
25574         the default settings. 
25575
25576         (StackAlloc): Implement stackalloc keyword.
25577
25578         * cs-parser.jay: Add rule to parse stackalloc.
25579
25580         * driver.cs: Handle /h, /help, /?
25581
25582         * expression.cs (MakeByteBlob): Removed the hacks we had in place
25583         before we supported unsafe code.
25584
25585         * makefile: add --unsafe to the self compilation of mcs.
25586
25587 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
25588
25589         * expression.cs (PointerArithmetic): New class that is used to
25590         perform pointer arithmetic.
25591         (Binary.Resolve): Handle pointer arithmetic
25592         Handle pointer comparission.
25593         (ArrayPtr): Utility expression class that is used to take the
25594         address of an array.
25595
25596         (ElementAccess): Implement array access for pointers
25597
25598         * statement.cs (Fixed): Implement fixed statement for arrays, we
25599         are missing one more case before we are done.
25600
25601         * expression.cs (Indirection): Implement EmitAssign and set the
25602         ExprClass to Variable.  This allows pointer dereferences to be
25603         treated as variables, and to have values assigned to them.
25604
25605         * ecore.cs (Expression.StoreFromPtr): New utility function to
25606         store values dereferencing.
25607
25608 2002-02-20  Ravi Pratap  <ravi@ximian.com>
25609
25610         * expression.cs (Binary.ResolveOperator): Ensure that we are
25611         not trying to operate on a void type - this fixes the reported
25612         bug.
25613
25614         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25615         the parent implementation is sealed.
25616
25617         * ../errors/cs0239.cs : Add.
25618
25619         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25620
25621         * typemanager.cs (unverifiable_code_type): Corresponds to 
25622         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25623         which have unsafe code in them.
25624
25625         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
25626         unsafe context.
25627
25628 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
25629
25630         * cs-tokenizer.cs: Add support for @"litreal strings"
25631
25632         Make tokenizer accept pre-processor directives
25633         on any column (remove the old C-like limitation). 
25634
25635         * rootcontext.cs (EmitCode): Emit any global attributes.
25636         (AddGlobalAttributes): Used to keep track of assembly attributes. 
25637
25638         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25639
25640         * cs-parser.jay: Add support for global attributes.  
25641
25642 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
25643
25644         * expression.cs (Indirection): New helper class.  Unary will
25645         create Indirection classes to be able to implement the
25646         IMemoryLocation interface on it.
25647
25648 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
25649
25650         * cs-parser.jay (fixed_statement): reference the right statement.
25651
25652         * statement.cs (Fixed.Emit): Finish implementing the fixed
25653         statement for the &x case.
25654
25655 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
25656
25657         * class.cs (Property.Define, Method.Define): Remove newslot when
25658         `implementing'.  
25659
25660         * modifiers.cs: My use of NewSlot when `Abstract' was set was
25661         wrong.  NewSlot should only be used if the `new' keyword is present.
25662
25663         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25664         locating our system dir.  Sorry about this.
25665
25666 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25667
25668         * driver.cs (GetSystemDir): Compute correctly the location of our
25669         system assemblies.  I was using the compiler directory instead of
25670         the library directory.
25671
25672 2002-02-13  Ravi Pratap  <ravi@ximian.com>
25673
25674         * expression.cs (BetterFunction): Put back in what Miguel commented out
25675         since it is the correct fix. The problem is elsewhere ;-)
25676
25677         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25678         parameters of the parms method are themselves compatible or not !
25679
25680         (StandardConversionExists): Fix very dangerous bug where we were forgetting
25681         to check that a class implements an interface before saying that an implicit
25682         conversion was allowed. Use ImplementsInterface to do the checking.
25683
25684 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25685
25686         * class.cs (Method.Define): Track whether we are an explicit
25687         implementation or not.  And only call DefineMethodOverride if we
25688         are an explicit implementation.
25689
25690         (Property.DefineMethod): Ditto.
25691
25692 2002-02-11  Ravi Pratap  <ravi@ximian.com>
25693
25694         * expression.cs (BetterFunction): Catch hideous bug which was
25695          preventing us from detecting ambiguous calls due to implicit casts i.e
25696         cs0121.
25697
25698 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
25699
25700         * support.cs (Pair): Remove un-needed method.  I figured why I was
25701         getting the error in cs-parser.jay, the variable in a foreach loop
25702         is readonly, and the compiler does not really treat this as a variable.
25703
25704         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
25705         instead of EQUALS in grammar.  
25706
25707         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
25708
25709         * expression.cs (Unary.DoResolve): Check whether the argument is
25710         managed or not.
25711
25712 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
25713
25714         * support.cs: Api for Pair to set a value.  Despite the fact that
25715         the variables are public the MS C# compiler refuses to compile
25716         code that accesses the field if the variable is part of a foreach
25717         statement. 
25718
25719         * statement.cs (Fixed): Begin implementation of the fixed
25720         statement.
25721
25722         (Block.AddVariable): Return the VariableInfo on success and null
25723         on failure instead of true/false. 
25724
25725         * cs-parser.jay (foreach): Catch errors on variables already
25726         defined (we were ignoring this value before) and properly unwind
25727         the block hierarchy
25728
25729         (fixed_statement): grammar for the fixed statement.
25730
25731 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
25732
25733         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
25734         pointer types to be incretemented.
25735
25736         (SizeOf): Implement.
25737
25738         * cs-parser.jay (pointer_member_access): Implement
25739         expr->IDENTIFIER production.
25740
25741         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
25742         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
25743         on safe contexts.
25744
25745         (Unary): Implement indirection.
25746
25747         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
25748         use in non-unsafe context).
25749
25750         (SimpleName.DoResolve): Check for pointers in field access on safe
25751         contexts. 
25752
25753         (Expression.LoadFromPtr): Factor the load-indirect code in this
25754         function.  This was duplicated in UnboxCast and ParameterReference
25755
25756 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
25757
25758         * expression.cs (ComposedCast): report an error if a pointer cast
25759         is used in a safe region.
25760
25761         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
25762         pointer type casts in unsafe context.
25763
25764         * codegen.cs (EmitContext): Set up IsUnsafe.
25765
25766         * cs-parser.jay (non_expression_type): Add productions for pointer
25767         casts. 
25768
25769         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
25770         code.  We should not use force into static mode if the method is
25771         not virtual.  Fixes bug in MIS
25772
25773         * statement.cs (Do.Emit, While.Emit, For.Emit,
25774         Statement.EmitBoolExpression): Add support to Do and While to
25775         propagate infinite loop as `I do return' semantics.
25776
25777         Improve the For case to also test for boolean constants.
25778
25779         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
25780         to the list of attributes we can add.
25781
25782         Remove `EmitContext' argument.
25783
25784         * class.cs (Method.Define): Apply parameter attributes.
25785         (Constructor.Define): Apply parameter attributes.
25786         (MethodCore.LabelParameters): Move here the core of labeling
25787         parameters. 
25788
25789         * support.cs (ReflectionParameters.ParameterModifier,
25790         InternalParameters.ParameterModifier): Use IsByRef on the type and
25791         only return the OUT bit for these parameters instead of in/out/ref
25792         flags.
25793
25794         This is because I miss-understood things.  The ParameterInfo.IsIn
25795         and IsOut represent whether the parameter has the [In] and [Out]
25796         attributes set.  
25797
25798 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
25799
25800         * ecore.cs (FieldExpr.Emit): Release temporaries.
25801
25802         * assign.cs (LocalTemporary.Release): new function.
25803
25804         * codegen.cs (EmitContext.GetTemporaryStorage,
25805         EmitContext.FreeTemporaryStorage): Rework the way we deal with
25806         temporary storage.  Now we can "put back" localbuilders when we
25807         are done with them
25808
25809 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
25810
25811         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
25812         need to make a copy of the variable to generate verifiable code.
25813
25814 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
25815
25816         * driver.cs: Compute dynamically the system directory.
25817
25818         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
25819         Slower, but more generally useful.  Used by the abstract
25820         registering implementation. 
25821
25822         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
25823         the rules for the special rule on Type/instances.  First check if
25824         we have the same name, and if so, try that special static path
25825         rather than the instance path.
25826
25827 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
25828
25829         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
25830         for, while and if.
25831
25832         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
25833         Enum, ValueType, Delegate or Array for non-corlib compiles.
25834
25835         * cs-tokenizer.cs: Catch long identifiers (645)
25836
25837         * typemanager.cs (IndexerPropetyName): Ravi never tested this
25838         piece of code.
25839
25840         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
25841         fix, we were returning too early, so we were not registering
25842         pending methods from abstract classes.
25843
25844         Do not register pending methods if the class is abstract.
25845
25846         * expression.cs (Conditional.DoResolve): Report circular implicit
25847         conversions when we neecd to compute it for conditional
25848         expressions. 
25849
25850         (Is.DoResolve): If the expression is always of the provided type,
25851         flag warning 183.  If the expression can not ever be of the
25852         provided type flag warning 184.
25853
25854         * class.cs: Catch 169 as well.
25855
25856         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
25857         read. 
25858
25859 2002-01-18  Nick Drochak  <ndrochak@gol.com>
25860
25861         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
25862
25863 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
25864
25865         * interface.cs: (PopulateMethod): Check for pointers being defined
25866         only if the unsafe context is active.
25867         (PopulateProperty): ditto.
25868         (PopulateIndexer): ditto.
25869
25870         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
25871         specified.  If pointers are present, make sure that they are
25872         present in an unsafe context.
25873         (Constructor, Constructor.Define): ditto.
25874         (Field, Field.Define): ditto.
25875         (Property, Property.Define): ditto.
25876         (Event, Event.Define): ditto.
25877
25878         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
25879         hashtable if there are classes or structs defined.
25880
25881         * expression.cs (LocalVariableReference.DoResolve): Simplify this
25882         code, as the constant resolution moved.
25883
25884         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
25885         the metadata, so we can flag error 133. 
25886
25887         * decl.cs (MemberCore.UnsafeOK): New function to test that a
25888         pointer is being declared in an unsafe context.
25889
25890 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
25891
25892         * modifiers.cs (Modifiers.Check): Require a Location argument.
25893         Report error 227 for Unsafe use.
25894
25895         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
25896
25897         * statement.cs (For.Emit): If the test is null, then report that
25898         we do `return', as we wont reach anything afterwards.
25899
25900         (Switch.SwitchGoverningType): Track the expression that matched
25901         the conversion.
25902
25903         * driver.cs: Allow negative numbers as an error code to flag.
25904
25905         * cs-parser.jay: Handle 1551.
25906
25907         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
25908
25909 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
25910
25911         * cs-parser.jay: Report 1518 (type declaration can only contain
25912         class, struct, interface, enum or delegate)
25913
25914         (switch_label): Report 1523 (keywords `case' or `default' must
25915         preced code)
25916
25917         (opt_switch_sections): Report 1522 (empty switch)
25918
25919         * driver.cs: Report 1515 (response file specified multiple times)
25920         Report 1516 (Source file specified multiple times).
25921
25922         * expression.cs (Argument.Resolve): Signal 1510
25923
25924         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
25925         access not allowed in static code)
25926
25927 2002-01-11  Ravi Pratap  <ravi@ximian.com>
25928
25929         * typemanager.cs (IsPointerType): Utility method which we are going
25930         to need a lot.
25931
25932         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
25933         the object type, so we take care of that.
25934
25935         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
25936
25937         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
25938         added to non-params parameters :-)
25939
25940         * typemanager.cs (CSharpName): Include 'void' type too. 
25941
25942         (void_ptr_type): Include in the set of core types.
25943
25944         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
25945         duplicating code.
25946
25947         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
25948         an unsafe context.
25949
25950         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
25951         completely forgotten about it.
25952
25953 2002-01-10  Ravi Pratap  <ravi@ximian.com>
25954
25955         * cs-parser.jay (pointer_type): Add. This begins our implementation
25956         of parsing rules for unsafe code.
25957
25958         (unsafe_statement): Implement.
25959
25960         (embedded_statement): Modify to include the above.
25961
25962         * statement.cs (Unsafe): Implement new class for unsafe blocks.
25963
25964         * codegen.cs (EmitContext.InUnsafe): Add. This determines
25965         if the current context is an unsafe one.
25966
25967         * cs-parser.jay (local_variable_pointer_type): Since local variable types
25968         are handled differently, we need separate rules for them.
25969
25970         (local_variable_declaration): Update to use local_variable_pointer_type
25971         to allow variable declarations of unmanaged pointer types.
25972
25973         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
25974         in unsafe contexts.
25975
25976         * ../errors/cs0214.cs : Add.
25977
25978 2002-01-16  Nick Drochak  <ndrochak@gol.com>
25979
25980         * makefile: remove 'response' file when cleaning.
25981
25982 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
25983
25984         * cs-parser.jay: Report 1524.
25985
25986 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
25987
25988         * typemanager.cs (RegisterMethod): drop checking if we have
25989         registered this from here
25990
25991 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
25992
25993         * class.cs (Method.EmitDestructor): Implement calling our base
25994         destructor. 
25995
25996         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
25997         value of InFinally.
25998
25999         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26000         this routine and will wrap the call in a try/catch block.  Deal
26001         with the case.
26002
26003 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26004
26005         * ecore.cs (Expression.MemberLookup): instead of taking a
26006         parameter `same_type' that was used to tell whether we could
26007         access private members we compute our containing type from the
26008         EmitContext.
26009
26010         (FieldExpr): Added partial support for volatile fields.  This does
26011         not work for volatile fields exposed from assemblies, as I can not
26012         figure out how to extract the modreq from it.
26013
26014         Updated all the source files to use this.
26015
26016         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26017         because it is referenced by MemberLookup very often. 
26018
26019 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26020
26021         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26022         TypeBuilder.GetCustomAttributes to retrieve what we need.
26023
26024         Get rid of redundant default_member_attr_type as this is the same as
26025         default_member_type which already exists.
26026
26027         * interface.cs, attribute.cs : Update accordingly.
26028
26029 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26030
26031         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26032         work for TYpeBuilders though.  Ravi, can you please fix this?
26033
26034         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26035
26036         * expression.cs (Argument.Emit): Handle the case of ref objects
26037         being passed to ref functions;  
26038
26039         (ParameterReference.EmitLoad): Loads the content of the pointer
26040         without dereferencing.
26041
26042 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26043
26044         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26045
26046 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26047
26048         * class.cs (Indexer.DefineMethod): Incorporate the interface
26049         type in the name of the method if we are doing explicit interface
26050         implementation.
26051
26052         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26053
26054         (BetterConversion): Fix extremely trivial bug where we were referring to
26055         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26056         again !
26057
26058         * ../errors/bug16.cs : Add although we have fixed it.
26059
26060 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26061
26062         * expression.cs (BaseIndexer): Begin implementation.
26063
26064         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26065
26066         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26067         production directly to remove a shift/reduce, and implement
26068         explicit interface implementation.
26069
26070         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26071         after a floating point suffix.
26072
26073         * expression.cs (DoNumericPromotions): Improved the conversion for
26074         uint/uint.  If we have a constant, we avoid doing a typecast to a
26075         larger type.
26076
26077         * class.cs (Indexer): Implement explicit interface implementation
26078         for indexers.
26079
26080 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26081
26082         * class.cs: make the default instance constructor public and hidebysig.
26083
26084 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26085
26086         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26087         so we can call it from elsewhere.
26088
26089         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26090         we emit it internally if the class has a defined indexer; otherwise the user
26091         emits it by decorating the class definition with the DefaultMemberAttribute.
26092
26093         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26094         attribute is not used on a type which defines an indexer.
26095
26096         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26097         character when we skip whitespace.
26098
26099         * ../errors/cs0646.cs : Add.
26100
26101 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26102
26103         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26104         again. 
26105
26106         * makefile: Add practical target `mcs3.exe' which builds the third
26107         generation compiler. 
26108
26109         * expression.cs (New): Fix structures constructor calling.
26110
26111         * class.cs (Property, Method, Indexer): Emit Final flag on the
26112         method if we are an interface implementation and we are not
26113         abstract. 
26114
26115         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26116         whether this property is referencing a `base' method.
26117
26118         * expression.cs (Invocation.EmitCall): take an extra argument:
26119         is_base, this is used to determine whether the `call' or
26120         `callvirt' opcode should be used.
26121
26122
26123         * delegate.cs: update EmitCall.
26124
26125         * class.cs (Method.Define): Set NewSlot for the cases where we are
26126         not implementing an interface method.
26127
26128         (Property.Define): ditto.
26129
26130 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26131
26132         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26133         'r'.  Allows mcs to parse itself fully.
26134
26135 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26136
26137         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26138         of the number of initializers that require the InitializeArray method.
26139
26140         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26141         update the above field where necessary.
26142
26143         (MakeByteBlob): Update accordingly.
26144
26145         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26146         greater than 2.
26147
26148         (EmitDynamicInitializers): Update in accordance with the new optimization.
26149
26150         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26151         same OpCode applies.
26152
26153         * cs-parser.jay : Fix some glaring errors I introduced.
26154
26155 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26156
26157         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26158         so that we can check for name clashes there too.
26159
26160         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26161         for interface indexers.
26162
26163         * interfaces.cs (Define): Emit the default member attribute.
26164
26165         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26166         variable was being referred to while setting the value ;-)
26167
26168 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26169
26170         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26171         byte-by-byte information when we know the data is zero.
26172
26173         Make the block always a multiple of 4, because
26174         DefineInitializedData has a bug.
26175
26176         * assign.cs: Fix, we should assign from the temporary, not from
26177         the source. 
26178
26179         * expression.cs (MakeByteBlob): Fix my incorrect code.
26180
26181 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26182
26183         * typemanager.cs (EnumToUnderlying): This function is used to get
26184         the underlying type from an enumeration, because it does not
26185         always work. 
26186
26187         * constant.cs: Use the I4_S form for values between -128 and 127.
26188
26189         * statement.cs (Block.LookupLabel): Looks up a label.
26190         (Block): Drop support for labeled blocks.
26191
26192         (LabeledStatement): New kind of statement that represents a label
26193         only.
26194
26195         (Goto): Finally implement this bad boy.
26196
26197         * cs-parser.jay: Update to reflect new mechanism to implement
26198         labels.
26199
26200 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26201
26202         * codegen.cs (EmitContext.This): a codegen property that keeps the
26203         a single instance of this instead of creating many different this
26204         instances. 
26205
26206         * delegate.cs (Delegate.DoResolve): Update to use the property;
26207
26208         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26209
26210         * expression.cs (BaseAccess.DoResolve): Ditto.
26211
26212 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26213
26214         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26215         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26216
26217         (InitCoreTypes): Update accordingly.
26218
26219         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26220         so we can quickly store the state.
26221
26222         (ApplyAttributes): Set the correct implementation flags
26223         for InternalCall methods.
26224
26225 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26226
26227         * expression.cs (EmitCall): if a method is not virtual, then do
26228         not use callvirt on it.
26229
26230         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26231         user defined stuff) requires the use of stobj, which takes an
26232         address on the stack instead of an array and an index.  So emit
26233         the Ldelema operation for it.
26234
26235         (EmitStoreOpcode): Use stobj for valuetypes.
26236
26237         (UnaryMutator.EmitCode): Use the right 1 value depending on
26238         whether we are dealing with int64/uint64, float or doubles.
26239
26240         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26241         constructors that I implemented last night.
26242
26243         (Constructor.IsDefault): Fix to work properly for static
26244         constructors.
26245
26246         * cs-parser.jay (CheckDef): report method signature errors.
26247         Update error number 103 to be 132.
26248
26249         * decl.cs: New AdditionResult enumeration value: MethodExists.
26250         Although we do this check for methods later on in the semantic
26251         analysis, catching repeated default constructors is so easy that
26252         we catch these here. 
26253
26254         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26255         promotions code.
26256
26257         (ParameterReference.EmitAssign, Emit): handle
26258         bools as bytes.
26259
26260         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26261         (ArrayAccess.EmitStoreOpcode): ditto.
26262
26263         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26264
26265         * expression.cs (MakeByteBlob): Complete all the missing types
26266         (uint, short, ushort, byte, sbyte)
26267
26268         * class.cs: Only init instance field initializers on instance
26269         constructors. 
26270
26271         Rename `constructors' to instance_constructors. 
26272
26273         (TypeContainer.AddConstructor): Only add constructors to the list
26274         if it is not static.
26275
26276         Make sure that we handle default_static_constructor independently
26277         everywhere where we handle instance_constructors
26278
26279 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26280
26281         * class.cs: Do not lookup or create a base initializer for a
26282         static constructor.
26283
26284         (ConstructorInitializer.Resolve): use the proper type to lookup
26285         for constructors.
26286
26287         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26288
26289         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26290         in DeclSpace. 
26291
26292         * decl.cs: CloseType is now an virtual method, the default
26293         implementation just closes this type.
26294
26295 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26296
26297         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26298         to PreserveSig by default. Also emit HideBySig on such methods.
26299
26300         Basically, set the defaults to standard values.
26301
26302         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26303         argument, if candidate is better, it can't be worse than the best !
26304
26305         (Invocation): Re-write bits to differentiate between methods being
26306         applicable in their expanded form and their normal form - for params
26307         methods of course.
26308
26309         Get rid of use_standard everywhere as only standard conversions are allowed
26310         in overload resolution. 
26311
26312         More spec conformance.
26313
26314 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26315
26316         * driver.cs: Add --timestamp, to see where the compiler spends
26317         most of its time.
26318
26319         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26320         `this' in static code.
26321
26322         (SimpleName.DoResolve): Implement in terms of a helper function
26323         that allows static-references to be passed upstream to
26324         MemberAccess.
26325
26326         (Expression.ResolveWithSimpleName): Resolve specially simple
26327         names when called by MemberAccess to implement the special
26328         semantics. 
26329
26330         (Expression.ImplicitReferenceConversion): Handle conversions from
26331         Null to reference types before others, as Null's type is
26332         System.Object. 
26333
26334         * expression.cs (Invocation.EmitCall): Handle the special case of
26335         calling methods declared on a reference type from a ValueType
26336         (Base classes System.Object and System.Enum)
26337
26338         (MemberAccess.Resolve): Only perform lookups on Enumerations if
26339         the left hand side is a TypeExpr, not on every enumeration. 
26340
26341         (Binary.Resolve): If types are reference types, then do a cast to
26342         object on operators != and == of both arguments.
26343
26344         * typemanager.cs (FindMembers): Extract instance and static
26345         members if requested.
26346
26347         * interface.cs (PopulateProperty): Use void_type instead of null
26348         as the return type for the setter method.
26349
26350         (PopulateIndexer): ditto.
26351
26352 2001-12-27  Ravi Pratap  <ravi@ximian.com>
26353
26354         * support.cs (ReflectionParameters): Fix minor bug where we
26355         were examining the wrong parameter for the ParamArray attribute.
26356
26357         Cope with requests for the type of the parameter at position
26358         greater than the params parameter's. We now return the element
26359         type of the params array as that makes more sense.
26360
26361         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
26362         accordingly as we no longer have to extract the element type
26363         ourselves.
26364
26365         (Invocation.OverloadResolve): Update.
26366
26367 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26368
26369         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26370         against IEnumerator, test whether the return value is a descendant
26371         of the IEnumerator interface.
26372
26373         * class.cs (Indexer.Define): Use an auxiliary method to implement
26374         the other bits of the method definition.  Begin support for
26375         explicit interface implementation.
26376
26377         (Property.DefineMethod): Use TypeManager.void_type instead of null
26378         for an empty return value.
26379
26380 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
26381
26382         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26383         dealing with a FieldExpr which is composed of a FieldBuilder, in
26384         the code path we did extract the constant, but we should have
26385         obtained the underlying value to be able to cast it (otherwise we
26386         end up in an infinite loop, this is what Ravi was running into).
26387
26388         (ArrayCreation.UpdateIndices): Arrays might be empty.
26389
26390         (MemberAccess.ResolveMemberAccess): Add support for section
26391         14.5.4.1 that deals with the special case of E.I when E is a type
26392         and something else, that I can be a reference to a static member.
26393
26394         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26395         handle a particular array type to create byte blobs, it is just
26396         something we dont generate byteblobs for.
26397
26398         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26399         arguments. 
26400
26401         * location.cs (Push): remove the key from the hashtable that we
26402         are about to add.   This happens for empty files.
26403
26404         * driver.cs: Dispose files after we have parsed them.
26405
26406         (tokenize): new function that only runs the tokenizer on its
26407         input, for speed testing.
26408
26409 2001-12-26  Ravi Pratap  <ravi@ximian.com>
26410
26411         * class.cs (Event.Define): Define the private field only if there
26412         are no accessors defined.
26413
26414         * expression.cs (ResolveMemberAccess): If there is no associated
26415         field with the event, that means we have an event defined with its
26416         own accessors and we should flag error cs0070 since transforming
26417         ourselves into a field is not valid in that case.
26418
26419         * ecore.cs (SimpleName.DoResolve): Same as above.
26420
26421         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26422         and charset to sane values.
26423
26424 2001-12-25  Ravi Pratap  <ravi@ximian.com>
26425
26426         * assign.cs (DoResolve): Perform check on events only if they 
26427         are being accessed outside the declaring type.
26428
26429         * cs-parser.jay (event_declarations): Update rules to correctly
26430         set the type of the implicit parameter etc.
26431
26432         (add_accessor, remove_accessor): Set current local parameters.
26433
26434         * expression.cs (Binary): For delegate addition and subtraction,
26435         cast the return value from the method into the appropriate delegate
26436         type.
26437
26438 2001-12-24  Ravi Pratap  <ravi@ximian.com>
26439
26440         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26441         of these as the workaround is unnecessary.
26442
26443         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26444         delegate data - none of that is needed at all.
26445
26446         Re-write bits to extract the instance expression and the delegate method
26447         correctly.
26448
26449         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
26450         on delegates too.
26451
26452         * attribute.cs (ApplyAttributes): New method to take care of common tasks
26453         of attaching attributes instead of duplicating code everywhere.
26454
26455         * everywhere : Update code to do attribute emission using the above method.
26456
26457 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26458
26459         * expression.cs (IsParamsMethodApplicable): if there are not
26460         parameters, return immediately.
26461
26462         * ecore.cs: The 0 literal can be implicity converted to an enum
26463         type. 
26464
26465         (SimpleName.DoResolve): First lookup the type, then lookup the
26466         members. 
26467
26468         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26469         want to get its address.  If the InstanceExpression is not
26470         addressable, store the result in a temporary variable, then get
26471         the address of it.
26472
26473         * codegen.cs: Only display 219 errors on warning level or above. 
26474
26475         * expression.cs (ArrayAccess): Make it implement the
26476         IMemoryLocation interface.
26477
26478         (Binary.DoResolve): handle the operator == (object a, object b)
26479         and operator != (object a, object b) without incurring into a
26480         BoxedCast (because 5 != o should never be performed).
26481
26482         Handle binary enumerator operators.
26483
26484         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26485         value type, otherwise use Ldelem_ref.
26486
26487         Use precomputed names;
26488
26489         (AddressOf): Implement address of
26490
26491         * cs-parser.jay (labeled_statement): Fix recursive block
26492         addition by reworking the production.
26493
26494         * expression.cs (New.DoEmit): New has a special case:
26495                 
26496                  If we are dealing with a ValueType, we have a few
26497                  situations to deal with:
26498                 
26499                     * The target of New is a ValueType variable, that is
26500                       easy, we just pass this as the variable reference
26501                 
26502                     * The target of New is being passed as an argument,
26503                       to a boxing operation or a function that takes a
26504                       ValueType.
26505                 
26506                       In this case, we need to create a temporary variable
26507                       that is the argument of New.
26508
26509
26510 2001-12-23  Ravi Pratap  <ravi@ximian.com>
26511
26512         * rootcontext.cs (LookupType): Check that current_type is not null before
26513         going about looking at nested types.
26514
26515         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26516         not implement the IAssignMethod interface any more.
26517
26518         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26519         where we tranform them into FieldExprs if they are being resolved from within
26520         the declaring type.
26521
26522         * ecore.cs (SimpleName.DoResolve): Do the same here.
26523
26524         * assign.cs (DoResolve, Emit): Clean up code considerably. 
26525
26526         * ../errors/bug10.cs : Add.
26527
26528         * ../errors/cs0070.cs : Add.
26529
26530         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26531
26532         * assign.cs : Get rid of EventIsLocal everywhere.
26533
26534 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26535
26536         * ecore.cs (ConvertIntLiteral): finished the implementation.
26537
26538         * statement.cs (SwitchLabel): Convert the value we are using as a
26539         key before looking up the table.
26540
26541 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26542
26543         * codegen.cs (EmitTopBlock): Require a Location argument now.
26544
26545         * cs-parser.jay (constructor_declarator): We need to setup
26546         current_local_parameters before we parse the
26547         opt_constructor_initializer, to allow the variables to be bound
26548         to the constructor arguments.
26549
26550         * rootcontext.cs (LookupType): First lookup nested classes in our
26551         class and our parents before we go looking outside our class.
26552
26553         * expression.cs (ConstantFold): Extract/debox the values at the
26554         beginnning. 
26555
26556         * rootcontext.cs (EmitCode): Resolve the constants first before we
26557         resolve the types.  This is not really needed, but it helps debugging.
26558
26559         * statement.cs: report location.
26560
26561         * cs-parser.jay: pass location to throw statement.
26562
26563         * driver.cs: Small bug fix.
26564
26565         * report.cs: Updated format to be 4-zero filled digits.
26566
26567 2001-12-22  Ravi Pratap  <ravi@ximian.com>
26568
26569         * expression.cs (CheckIndices): Fix minor bug where the wrong
26570         variable was being referred to ;-)
26571
26572         (DoEmit): Do not call EmitStaticInitializers when the 
26573         underlying type is System.Object.
26574
26575 2001-12-21  Ravi Pratap  <ravi@ximian.com>
26576
26577         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26578         and do the usual workaround for SRE.
26579
26580         * class.cs (MyEventBuilder.EventType): New member to get at the type
26581         of the event, quickly.
26582
26583         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26584
26585         * assign.cs (Assign.DoResolve): Handle the case when the target
26586         is an EventExpr and perform the necessary checks.
26587
26588         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26589         interface.
26590
26591         (SimpleName.MemberStaticCheck): Include check for EventExpr.
26592
26593         (EventExpr): Set the type in the constructor itself since we 
26594         are meant to be born fully resolved.
26595
26596         (EventExpr.Define): Revert code I wrote earlier.
26597                 
26598         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26599         instance expression is null. The instance expression is a This in that case
26600         or a null, depending on whether it is a static method or not.
26601
26602         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26603         refers to more than one method.
26604
26605         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26606         and accordingly flag errors.
26607
26608 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26609
26610         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26611
26612 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26613
26614         * location.cs (ToString): Provide useful rutine.
26615
26616 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26617
26618         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26619         objects, return the actual integral boxed.
26620
26621         * statement.cs (SwitchLabel): define an ILLabel for each
26622         SwitchLabel. 
26623
26624         (Switch.CheckSwitch): If the value is a Literal, extract
26625         the underlying literal.
26626
26627         Also in the unused hashtable we had, add the SwitchLabel so we can
26628         quickly look this value up.
26629
26630         * constant.cs: Implement a bunch of new constants.  Rewrite
26631         Literal based on this.  Made changes everywhere to adapt to this.
26632
26633         * expression.cs (Expression.MakeByteBlob): Optimize routine by
26634         dereferencing array only once, and also copes with enumrations.
26635
26636         bytes are two bytes wide, not one.
26637
26638         (Cast): Perform constant conversions.
26639
26640         * ecore.cs (TryImplicitIntConversion): Return literals instead of
26641         wrappers to the literals here.
26642
26643         * expression.cs (DoNumericPromotions): long literals can converted
26644         to ulong implicity (this is taken care of elsewhere, but I was
26645         missing this spot).
26646
26647         * ecore.cs (Expression.Literalize): Make the return type Literal,
26648         to improve type checking.
26649
26650         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26651
26652 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26653
26654         * literal.cs: Revert code from ravi that checked the bounds.  The
26655         bounds are sane by the definition of the type itself. 
26656
26657         * typemanager.cs: Fix implementation of ImplementsInterface.  We
26658         need to actually look up in our parent hierarchy for interfaces
26659         implemented. 
26660
26661         * const.cs: Use the underlying type for enumerations
26662
26663         * delegate.cs: Compute the basename for the delegate creation,
26664         that should fix the delegate test case, and restore the correct
26665         Type Lookup semantics in rootcontext
26666
26667         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
26668         referencing a nested type with the Reflection API is using the "+"
26669         sign. 
26670
26671         * cs-parser.jay: Do not require EOF token at the end.
26672
26673 2001-12-20  Ravi Pratap  <ravi@ximian.com>
26674
26675         * rootcontext.cs (LookupType): Concatenate type names with
26676         a '.' instead of a '+' The test suite passes again.
26677
26678         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26679         field of the enumeration.
26680
26681         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26682         the case when the member is an EventExpr.
26683
26684         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
26685         static has an associated instance expression.
26686
26687         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
26688
26689         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
26690
26691         * class.cs (Event.Define): Register event and perform appropriate checks
26692         for error #111.
26693
26694         We define the Add and Remove methods even if the use provides none because
26695         in that case, we provide default implementations ourselves.
26696
26697         Define a private field of the type of the event. This is done by the CSC compiler
26698         and we should be doing it too ;-)
26699
26700         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
26701         More methods we use in code we generate.
26702
26703         (multicast_delegate_type, delegate_type): Two separate types since the distinction
26704         is important.
26705
26706         (InitCoreTypes): Update accordingly for the above.
26707
26708         * class.cs (Event.Emit): Generate code for default accessors that we provide
26709
26710         (EmitDefaultMethod): Do the job in the above.
26711
26712         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
26713         appropriate place.
26714
26715 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26716
26717         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
26718         builders even if we were missing one.
26719
26720         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
26721         pass the Basename as our class name instead of the Name.  The
26722         basename will be correctly composed for us.
26723
26724         * parameter.cs (Paramters): Now takes a Location argument.
26725
26726         * decl.cs (DeclSpace.LookupType): Removed convenience function and
26727         make all the code call directly LookupType in RootContext and take
26728         this chance to pass the Location information everywhere.
26729
26730         * Everywhere: pass Location information.
26731
26732 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
26733
26734         * class.cs (Constructor.Define): Updated way of detecting the
26735         length of the parameters.
26736
26737         (TypeContainer.DefineType): Use basename as the type name for
26738         nested types.
26739
26740         (TypeContainer.Define): Do not recursively define types here, as
26741         definition is taken care in order by the RootContext.
26742
26743         * tree.cs: Keep track of namespaces in a per-file basis.
26744
26745         * parameter.cs (Parameter.ComputeSignature): Update to use
26746         DeclSpace. 
26747
26748         (Parameters.GetSignature): ditto.
26749
26750         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
26751         instead of a TypeContainer.
26752
26753         (Interface.SemanticAnalysis): Use `this' instead of our parent to
26754         resolve names.  Because we need to be resolve in our context, not
26755         our parents.
26756
26757         * driver.cs: Implement response files.
26758
26759         * class.cs (TypeContainer.DefineType): If we are defined, do not
26760         redefine ourselves.
26761
26762         (Event.Emit): Emit the code for add/remove handlers.
26763         (Event.Define): Save the MethodBuilders for add/remove.
26764
26765         * typemanager.cs: Use pair here too.
26766
26767         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
26768         DictionaryEntry requires the first argument to be non-null.  
26769
26770         (enum_declaration): Compute full name for registering the
26771         enumeration.
26772
26773         (delegate_declaration): Instead of using
26774         formal_parameter_list, use opt_formal_parameter_list as the list
26775         can be empty.
26776
26777         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
26778         (EventParsing): New property that controls whether `add' and
26779         `remove' are returned as tokens or identifiers (for events);
26780
26781 2001-12-19  Ravi Pratap  <ravi@ximian.com>
26782
26783         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
26784         use MyEventBuilder only and let it wrap the real builder for us.
26785
26786         (MyEventBuilder): Revamp constructor etc.
26787
26788         Implement all operations that we perform on EventBuilder in precisely the same
26789         way here too.
26790
26791         (FindMembers): Update to use the EventBuilder member.
26792
26793         (Event.Emit): Update accordingly.
26794
26795 2001-12-18  Ravi Pratap  <ravi@ximian.com>
26796
26797         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
26798         by calling the appropriate methods.
26799
26800         (GetCustomAttributes): Make stubs as they cannot possibly do anything
26801         useful.
26802
26803         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
26804
26805 2001-12-17  Ravi Pratap  <ravi@ximian.com>
26806
26807         * delegate.cs (Delegate.Populate): Check that the return type
26808         and various parameters types are indeed accessible.
26809
26810         * class.cs (Constructor.Define): Same here.
26811
26812         (Field.Define): Ditto.
26813
26814         (Event.Define): Ditto.
26815
26816         (Operator.Define): Check that the underlying Method defined itself
26817         correctly - so it's MethodBuilder should not be null.
26818
26819         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
26820         expression happens to be null.
26821
26822         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
26823         members but as of now we don't seem to be able to do anything really useful with it.
26824
26825         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
26826         not the EventBuilder.
26827
26828 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
26829
26830         * cs-tokenizer.cs: Add support for defines.
26831         Add support for #if, #elif, #else, #endif
26832
26833         (eval_var): evaluates a variable.
26834         (eval): stubbed for evaluating functions.
26835
26836         * cs-parser.jay: Pass the defines information
26837
26838         * driver.cs: Add --define command line option.
26839
26840         * decl.cs: Move MemberCore here.
26841
26842         Make it the base class for DeclSpace.  This allows us to catch and
26843         report 108 and 109 for everything now.
26844
26845         * class.cs (TypeContainer.Define): Extract all the members
26846         before populating and emit the warning 108 (new keyword required
26847         to override) instead of having each member implement this.
26848
26849         (MemberCore.Define): New abstract method, we will be using this in
26850         the warning reporting engine in Populate.
26851
26852         (Operator.Define): Adjust to new MemberCore protocol. 
26853
26854         * const.cs (Const): This does not derive from Expression, it is a
26855         temporary object we use to create fields, it is a MemberCore. 
26856
26857         * class.cs (Method.Define): Allow the entry point to be in a
26858         specific class.
26859
26860         * driver.cs: Rewrite the argument handler to clean it up a bit.
26861
26862         * rootcontext.cs: Made it just an auxiliary namespace feature by
26863         making everything static.
26864
26865         * driver.cs: Adapt code to use RootContext type name instead of
26866         instance variable.
26867
26868         * delegate.cs: Remove RootContext argument.
26869
26870         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
26871         argument. 
26872
26873         * class.cs (Event.Define): The lookup can fail.
26874
26875         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
26876
26877         * expression.cs: Resolve the this instance before invoking the code.
26878
26879 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
26880
26881         * cs-parser.jay: Add a production in element_access that allows
26882         the thing to become a "type" reference.  This way we can parse
26883         things like "(string [])" as a type.
26884
26885         Note that this still does not handle the more complex rules of
26886         casts. 
26887
26888
26889         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
26890
26891         * ecore.cs: (CopyNewMethods): new utility function used to
26892         assemble the list of methods from running FindMembers.
26893
26894         (MemberLookup): Rework FindMembers so that 
26895
26896 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
26897
26898         * class.cs (TypeContainer): Remove Delegates who fail to be
26899         defined.
26900
26901         * delegate.cs (Populate): Verify that we dont get null return
26902         values.   TODO: Check for AsAccessible.
26903
26904         * cs-parser.jay: Use basename to emit error 574 (destructor should
26905         have the same name as container class), not the full name.
26906
26907         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
26908         possible representation.  
26909
26910         Also implements integer type suffixes U and L.
26911
26912 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
26913
26914         * expression.cs (ArrayCreation.DoResolve): We need to do the
26915         argument resolution *always*.
26916
26917         * decl.cs: Make this hold the namespace.  Hold the root context as
26918         well.
26919         (LookupType): Move here.
26920
26921         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
26922
26923         * location.cs (Row, Name): Fixed the code, it was always returning
26924         references to the first file.
26925
26926         * interface.cs: Register properties defined through interfaces.
26927
26928         * driver.cs: Add support for globbing on the command line
26929
26930         * class.cs (Field): Make it derive from MemberCore as well.
26931         (Event): ditto.
26932
26933 2001-12-15  Ravi Pratap  <ravi@ximian.com>
26934
26935         * class.cs (Event::Define): Check that the type of the event is a delegate
26936         type else flag error #66.
26937
26938         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
26939         same.
26940
26941         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
26942         values of EntryPoint, CharSet etc etc.
26943
26944         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
26945
26946         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
26947         be null and we should ignore this. I am not sure if this is really clean. Apparently,
26948         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
26949         which needs this to do its work.
26950
26951         * ../errors/cs0066.cs : Add.
26952
26953 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
26954
26955         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
26956         helper functions.
26957
26958         * class.cs: (MethodSignature.MethodSignature): Removed hack that
26959         clears out the parameters field.
26960         (MemberSignatureCompare): Cleanup
26961
26962         (MemberCore): New base class used to share code between MethodCore
26963         and Property.
26964
26965         (RegisterRequiredImplementations) BindingFlags.Public requires
26966         either BindingFlags.Instace or Static.  Use instance here.
26967
26968         (Property): Refactored code to cope better with the full spec.
26969
26970         * parameter.cs (GetParameterInfo): Return an empty array instead
26971         of null on error.
26972
26973         * class.cs (Property): Abstract or extern properties have no bodies.
26974
26975         * parameter.cs (GetParameterInfo): return a zero-sized array.
26976
26977         * class.cs (TypeContainer.MethodModifiersValid): Move all the
26978         method modifier validation to the typecontainer so we can reuse
26979         this on properties.
26980
26981         (MethodCore.ParameterTypes): return an empty sized array of types.
26982
26983         (Property.Define): Test property modifier validity.
26984
26985         Add tests for sealed/override too.
26986
26987         (Method.Emit): abstract or extern methods have no bodies.
26988
26989 2001-12-14  Ravi Pratap  <ravi@ximian.com>
26990
26991         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
26992         thing.
26993
26994         (Method::Define, ::Emit): Modify accordingly.
26995
26996         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
26997
26998         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
26999
27000         * makefile: Pass in /unsafe.
27001
27002 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27003
27004         * class.cs (MakeKey): Kill routine.
27005
27006         * class.cs (TypeContainer.Define): Correctly define explicit
27007         method implementations (they require the full interface name plus
27008         the method name).
27009
27010         * typemanager.cs: Deply the PtrHashtable here and stop using the
27011         lame keys.  Things work so much better.
27012
27013         This of course broke everyone who depended on `RegisterMethod' to
27014         do the `test for existance' test.  This has to be done elsewhere.
27015
27016         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27017         the object stupid Equals method (because, that like fails all over
27018         the place).  We still do not use it.
27019
27020         * class.cs (TypeContainer.SetRequiredInterface,
27021         TypeContainer.RequireMethods): Killed these two routines and moved
27022         all the functionality to RegisterRequiredImplementations.
27023
27024         (TypeContainer.RegisterRequiredImplementations): This routine now
27025         registers all the implementations required in an array for the
27026         interfaces and abstract methods.  We use an array of structures
27027         which can be computed ahead of time to reduce memory usage and we
27028         also assume that lookups are cheap as most classes will not
27029         implement too many interfaces.
27030
27031         We also avoid creating too many MethodSignatures.
27032
27033         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27034         clear the "pending" bit if we find that there are problems with
27035         the declaration.
27036
27037         (TypeContainer.VerifyPendingMethods): Update to report errors of
27038         methods that look like implementations but are not.
27039
27040         (TypeContainer.Define): Add support for explicit interface method
27041         implementation. 
27042
27043 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27044
27045         * typemanager.cs: Keep track of the parameters here instead of
27046         being a feature of the TypeContainer.
27047
27048         * class.cs: Drop the registration of parameters here, as
27049         InterfaceMethods are also interface declarations.
27050
27051         * delegate.cs: Register methods with the TypeManager not only with
27052         the TypeContainer.  This code was buggy.
27053
27054         * interface.cs: Full registation here.
27055
27056 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27057
27058         * expression.cs: Remove reducer for binary expressions, it can not
27059         be done this way.
27060
27061         * const.cs: Put here the code that used to go into constant.cs
27062
27063         * constant.cs: Put here the code for constants, this is a new base
27064         class for Literals.
27065
27066         * literal.cs: Make Literal derive from Constant.
27067
27068 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27069
27070         * statement.cs (Return.Emit): Report error 157 if the user
27071         attempts to return from a finally block.
27072
27073         (Return.Emit): Instead of emitting a return, jump to the end of
27074         the function.
27075
27076         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27077         LocalBuilder to store the result of the function.  ReturnLabel is
27078         the target where we jump.
27079
27080
27081 2001-12-09  Radek Doulik  <rodo@ximian.com>
27082
27083         * cs-parser.jay: remember alias in current namespace
27084
27085         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27086         namespaces
27087
27088         * class.cs (LookupAlias): lookup alias in my_namespace
27089
27090         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27091         aliases hashtable
27092         (LookupAlias): lookup alias in this and if needed in parent
27093         namespaces
27094
27095 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27096
27097         * support.cs: 
27098
27099         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27100         making things static.  I need this to avoid passing the
27101         TypeContainer when calling ParameterType.
27102
27103         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27104         that did string manipulation to compute the type and then call
27105         GetType.  Use Parameter.ParameterType instead.
27106
27107         * cs-tokenizer.cs: Consume the suffix for floating values.
27108
27109         * expression.cs (ParameterReference): figure out whether this is a
27110         reference parameter or not.  Kill an extra variable by computing
27111         the arg_idx during emission.
27112
27113         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27114         function that returns whether a parameter is an out/ref value or not.
27115
27116         (Parameter.ParameterType): The type of the parameter (base,
27117         without ref/out applied).
27118
27119         (Parameter.Resolve): Perform resolution here.
27120         (Parameter.ExternalType): The full type (with ref/out applied).
27121
27122         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27123         support for expressions on the using statement.
27124
27125 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27126
27127         * statement.cs (Using.EmitLocalVariableDecls): Split the
27128         localvariable handling of the using statement.
27129
27130         (Block.EmitMeta): Keep track of variable count across blocks.  We
27131         were reusing slots on separate branches of blocks.
27132
27133         (Try.Emit): Emit the general code block, we were not emitting it. 
27134
27135         Check the type of the declaration to be an IDisposable or
27136         something that can be implicity converted to it. 
27137
27138         Emit conversions if required.
27139
27140         * ecore.cs (EmptyExpression): New utility class.
27141         (Expression.ImplicitConversionExists): New utility function.
27142
27143 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27144
27145         * statement.cs (Using): Implement.
27146
27147         * expression.cs (LocalVariableReference): Support read only variables.
27148
27149         * statement.cs: Remove the explicit emit for the Leave opcode.
27150         (VariableInfo): Add a readonly field.
27151
27152 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27153
27154         * ecore.cs (ConvCast): new class used to encapsulate the various
27155         explicit integer conversions that works in both checked and
27156         unchecked contexts.
27157
27158         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27159         properly generate the overflow opcodes.
27160
27161 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27162
27163         * statement.cs: The correct type for the EmptyExpression is the
27164         element_type, not the variable type.  Ravi pointed this out.
27165
27166 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27167
27168         * class.cs (Method::Define): Handle PInvoke methods specially
27169         by using DefinePInvokeMethod instead of the usual one.
27170
27171         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27172         above to do the task of extracting information and defining the method.
27173
27174 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27175
27176         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27177         of the condition for string type.
27178
27179         (Emit): Move that here. 
27180
27181         (ArrayCreation::CheckIndices): Keep string literals in their expression
27182         form.
27183
27184         (EmitDynamicInitializers): Handle strings appropriately.
27185
27186 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27187
27188         * codegen.cs (EmitContext): Replace multiple variables with a
27189         single pointer to the current Switch statement.
27190
27191         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27192         EmitContext.
27193
27194 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27195
27196         * statement.cs 
27197
27198         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27199         default'.
27200
27201         (Foreach.Emit): Foreach on arrays was not setting
27202         up the loop variables (for break/continue).
27203
27204         (GotoCase): Semi-implented.
27205
27206 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27207
27208         * attribute.cs (CheckAttribute): Handle system attributes by using
27209         Attribute.GetAttributes to examine information we need.
27210
27211         (GetValidPlaces): Same here.
27212
27213         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27214
27215         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27216
27217         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27218
27219         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27220
27221         (Method::Emit): Handle the case when we are a PInvoke method.
27222
27223 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27224
27225         * expression.cs: Use ResolveWithSimpleName on compound names.
27226
27227 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27228
27229         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27230         before trying to reduce it.
27231
27232         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27233
27234         * constant.cs (LookupConstantValue): Implement.
27235
27236         (EmitConstant): Use the above in emitting the constant.
27237
27238         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27239         that are user-defined by doing a LookupConstantValue on them.
27240
27241         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27242         too, like above.
27243
27244 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27245
27246         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27247
27248         (BaseAccess.DoResolve): Implement.
27249
27250         (MemberAccess.DoResolve): Split this routine into a
27251         ResolveMemberAccess routine that can be used independently
27252
27253 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27254
27255         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27256         As that share bits of the implementation.  Is returns a boolean,
27257         while As returns the Type that is being probed.
27258
27259 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27260
27261         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27262         instead of a Literal - much easier.
27263
27264         (EnumInTransit): Remove - utterly useless :-)
27265
27266         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27267
27268         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27269
27270         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27271         chain when we have no associated expression.
27272
27273 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27274
27275         * constant.cs (Define): Use Location while reporting the errror.
27276
27277         Also emit a warning when 'new' is used and there is no inherited
27278         member to hide.
27279
27280         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27281         populated.
27282
27283         (LookupEnumValue): Implement to lookup an enum member's value and define it
27284         if necessary.
27285
27286         (Populate): Re-write accordingly to use the above routine.
27287
27288 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27289
27290         * expression.cs (This): Fix prototype for DoResolveLValue to
27291         override the base class DoResolveLValue.
27292
27293         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27294         declarations) 
27295
27296         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27297         (we need to load the address of the field here).  This fixes
27298         test-22. 
27299
27300         (FieldExpr.DoResolveLValue): Call the DoResolve
27301         function to initialize the Instance expression.
27302
27303         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27304         correctly the GetEnumerator operation on a value type.
27305
27306         * cs-parser.jay: Add more simple parsing error catches.
27307
27308         * statement.cs (Switch): Add support for string switches.
27309         Handle null specially.
27310
27311         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27312
27313 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27314
27315         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27316
27317         (declare_local_constant): New helper function.
27318
27319         * statement.cs (AddConstant): Keep a separate record of constants
27320
27321         (IsConstant): Implement to determine if a variable is a constant.
27322
27323         (GetConstantExpression): Implement.
27324
27325         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27326
27327         * statement.cs (IsVariableDefined): Re-write.
27328
27329 2001-11-27  Ravi Pratap  <ravi@ximian.com>
27330
27331         * class.cs (TypeContainer::FindMembers): Look for constants
27332         in the case when we are looking for MemberTypes.Field
27333
27334         * expression.cs (MemberAccess::DoResolve): Check that in the
27335         case we are a FieldExpr and a Literal, we are not being accessed
27336         by an instance reference.
27337
27338         * cs-parser.jay (local_constant_declaration): Implement.
27339
27340         (declaration_statement): Implement for constant declarations.
27341
27342 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
27343
27344         * statement.cs (Switch): Catch double defaults.
27345
27346         (Switch): More work on the switch() statement
27347         implementation.  It works for integral values now, need to finish
27348         string support.
27349
27350
27351 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27352
27353         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27354         integer literals into other integer literals.  To be used by
27355         switch. 
27356
27357 2001-11-24  Ravi Pratap  <ravi@ximian.com>
27358
27359         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27360         some memory.
27361
27362         (EmitDynamicInitializers): Cope with the above since we extract data
27363         directly from ArrayData now.
27364
27365         (ExpectInitializers): Keep track of whether initializers are mandatory
27366         or not.
27367
27368         (Bounds): Make it a hashtable to prevent the same dimension being 
27369         recorded for every element in that dimension.
27370
27371         (EmitDynamicInitializers): Fix bug which prevented the Set array method
27372         from being found.
27373
27374         Also fix bug which was causing the indices to be emitted in the reverse
27375         order.
27376
27377 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27378
27379         * expression.cs (ArrayCreation): Implement the bits that Ravi left
27380         unfinished.  They do not work, because the underlying code is
27381         sloppy.
27382
27383 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27384
27385         * cs-parser.jay: Remove bogus fixme.
27386
27387         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27388         on Switch statement.
27389
27390 2001-11-23  Ravi Pratap  <ravi@ximian.com>
27391
27392         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27393         the same. 
27394
27395         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27396         parameter. Apparently, any expression is allowed. 
27397
27398         (ValidateInitializers): Update accordingly.
27399
27400         (CheckIndices): Fix some tricky bugs thanks to recursion.
27401
27402         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
27403         I was being completely brain-dead.
27404
27405         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27406         and re-write acordingly.
27407
27408         (DelegateInvocation): Re-write accordingly.
27409
27410         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27411
27412         (MakeByteBlob): Handle types more correctly.
27413
27414         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27415         initialization from expressions but it is incomplete because I am a complete
27416         Dodo :-|
27417
27418 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27419
27420         * statement.cs (If.Emit): Fix a bug that generated incorrect code
27421         on If.  Basically, we have to return `true' (ie, we do return to
27422         our caller) only if both branches of the if return.
27423
27424         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27425         short-circuit operators, handle them as short circuit operators. 
27426
27427         (Cast.DoResolve): Resolve type.
27428         (Cast.Cast): Take an expression as the target type.
27429
27430         * cs-parser.jay (cast_expression): Remove old hack that only
27431         allowed a limited set of types to be handled.  Now we take a
27432         unary_expression and we resolve to a type during semantic
27433         analysis.
27434
27435         Use the grammar productions from Rhys to handle casts (this is
27436         not complete like Rhys syntax yet, we fail to handle that corner
27437         case that C# has regarding (-x), but we will get there.
27438
27439 2001-11-22  Ravi Pratap  <ravi@ximian.com>
27440
27441         * class.cs (EmitFieldInitializer): Take care of the case when we have a
27442         field which is an array type.
27443
27444         * cs-parser.jay (declare_local_variables): Support array initialization too.
27445
27446         * typemanager.cs (MakeKey): Implement.
27447
27448         (everywhere): Use the above appropriately.
27449
27450         * cs-parser.jay (for_statement): Update for array initialization while
27451         declaring variables.
27452
27453         * ecore.cs : The error message was correct, it's the variable's names that
27454         were misleading ;-) Make the code more readable.
27455
27456         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27457         the correct type etc.
27458
27459         (ConvertExplicit): Handle Enum types by examining the underlying type.
27460
27461 2001-11-21  Ravi Pratap  <ravi@ximian.com>
27462
27463         * parameter.cs (GetCallingConvention): Always return
27464         CallingConventions.Standard for now.
27465
27466 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27467
27468         * expression.cs (Binary.ResolveOperator): Update the values of `l'
27469         and `r' after calling DoNumericPromotions.
27470
27471         * ecore.cs: Fix error message (the types were in the wrong order).
27472
27473         * statement.cs (Foreach.ProbeCollectionType): Need to pass
27474         BindingFlags.Instance as well 
27475
27476         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27477         implicit int literal conversion in an empty cast so that we
27478         propagate the right type upstream.
27479
27480         (UnboxCast): new class used to unbox value types.
27481         (Expression.ConvertExplicit): Add explicit type conversions done
27482         by unboxing.
27483
27484         (Expression.ImplicitNumericConversion): Oops, forgot to test for
27485         the target type before applying the implicit LongLiterals to ULong
27486         literal cast.
27487
27488 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
27489
27490         * cs-parser.jay (for_statement): Reworked the way For works: now
27491         we declare manually any variables that are introduced in
27492         for_initializer to solve the problem of having out-of-band code
27493         emition (that is what got for broken).
27494
27495         (declaration_statement): Perform the actual variable declaration
27496         that used to be done in local_variable_declaration here.
27497
27498         (local_variable_declaration): Do not declare anything, just pass
27499         the information on a DictionaryEntry
27500
27501 2001-11-20  Ravi Pratap  <ravi@ximian.com>
27502
27503         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27504         re-write of the logic to now make it recursive.
27505
27506         (UpdateIndices): Re-write accordingly.
27507
27508         Store element data in a separate ArrayData list in the above methods.
27509
27510         (MakeByteBlob): Implement to dump the array data into a byte array.
27511
27512 2001-11-19  Ravi Pratap  <ravi@ximian.com>
27513
27514         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27515         into CheckIndices.
27516
27517         * constant.cs (Define): Implement.
27518
27519         (EmitConstant): Re-write fully.
27520
27521         Pass in location info.
27522
27523         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27524         respectively.
27525
27526         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27527         DictionaryEntry since we need location info too.
27528
27529         (constant_declaration): Update accordingly.
27530
27531         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27532         code into another method : UpdateIndices.
27533
27534 2001-11-18  Ravi Pratap  <ravi@ximian.com>
27535
27536         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27537         some type checking etc.
27538
27539 2001-11-17  Ravi Pratap  <ravi@ximian.com>
27540
27541         * expression.cs (ArrayCreation::ValidateInitializers): Implement
27542         bits to provide dimension info if the user skips doing that.
27543
27544         Update second constructor to store the rank correctly.
27545
27546 2001-11-16  Ravi Pratap  <ravi@ximian.com>
27547
27548         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27549         and try to implement.
27550
27551         * ../errors/cs0150.cs : Add.
27552
27553         * ../errors/cs0178.cs : Add.
27554
27555 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
27556
27557         * statement.cs: Implement foreach on multi-dimensional arrays. 
27558
27559         * parameter.cs (Parameters.GetParameterByName): Also lookup the
27560         name of the params argument.
27561
27562         * expression.cs: Use EmitStoreOpcode to get the right opcode while
27563         initializing the array.
27564
27565         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27566         we can use this elsewhere.
27567
27568         * statement.cs: Finish implementation of foreach for single
27569         dimension arrays.
27570
27571         * cs-parser.jay: Use an out-of-band stack to pass information
27572         around, I wonder why I need this.
27573
27574         foreach_block: Make the new foreach_block the current_block.
27575
27576         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27577         function used to return a static Parameters structure.  Used for
27578         empty parameters, as those are created very frequently.
27579
27580         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27581
27582 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27583
27584         * interface.cs : Default modifier is private, not public. The
27585         make verify test passes again.
27586
27587 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27588
27589         * support.cs (ReflectionParameters): Fix logic to determine
27590         whether the last parameter is a params one. Test 9 passes again.
27591
27592         * delegate.cs (Populate): Register the builders we define with
27593         RegisterParameterForBuilder. Test 19 passes again.
27594
27595         * cs-parser.jay (property_declaration): Reference $6 instead
27596         of $$ to get at the location.
27597
27598         (indexer_declaration): Similar stuff.
27599
27600         (attribute): Ditto.
27601
27602         * class.cs (Property): Register parameters for the Get and Set methods
27603         if they exist. Test 23 passes again.
27604
27605         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27606         call to EmitArguments as we are sure there aren't any params arguments. 
27607         Test 32 passes again.
27608
27609         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27610         IndexOutOfRangeException. 
27611
27612         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27613         Test 33 now passes again.
27614
27615 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
27616
27617         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27618         broke a bunch of things.  Will have to come up with a better way
27619         of tracking locations.
27620
27621         * statement.cs: Implemented foreach for single dimension arrays.
27622
27623 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27624
27625         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27626         an error.  This removes the lookup from the critical path.
27627
27628         * cs-parser.jay: Removed use of temporary_loc, which is completely
27629         broken. 
27630
27631 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
27632
27633         * support.cs (ReflectionParameters.ParameterModifier): Report
27634         whether the argument is a PARAMS argument or not.
27635
27636         * class.cs: Set the attribute `ParamArrayAttribute' on the
27637         parameter argument.
27638
27639         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27640         and cons_param_array_attribute (ConstructorInfo for
27641         ParamArrayAttribute)., 
27642
27643         * codegen.cs: Emit the return using the `Return' statement, that
27644         way we can report the error correctly for missing return values. 
27645
27646         * class.cs (Method.Emit): Clean up.
27647
27648         * expression.cs (Argument.Resolve): Take another argument: the
27649         location where this argument is used.  Notice that this is not
27650         part of the "Argument" class as to reduce the size of the
27651         structure (we know the approximate location anyways).
27652
27653         Test if the argument is a variable-reference, if not, then
27654         complain with a 206.
27655
27656         (Argument.Emit): Emit addresses of variables.
27657
27658         (Argument.FullDesc): Simplify.
27659
27660         (Invocation.DoResolve): Update for Argument.Resolve.
27661
27662         (ElementAccess.DoResolve): ditto.
27663
27664         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27665         method should be virtual, as this method is always virtual.
27666
27667         (NewDelegate.DoResolve): Update for Argument.Resolve.
27668
27669         * class.cs (ConstructorInitializer.DoResolve): ditto.
27670
27671         * attribute.cs (Attribute.Resolve): ditto.
27672
27673 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
27674
27675         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27676
27677         * expression.cs (ParameterReference): Drop IStackStorage and implement
27678         IAssignMethod instead. 
27679
27680         (LocalVariableReference): ditto.
27681
27682         * ecore.cs (FieldExpr): Drop IStackStorage and implement
27683         IAssignMethod instead. 
27684
27685 2001-11-13  Miguel de Icaza <miguel@ximian.com>
27686
27687         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
27688         enumerations that are used in heavily used structures derive from
27689         byte in a laughable and pathetic attempt to reduce memory usage.
27690         This is the kind of pre-optimzations that you should not do at
27691         home without adult supervision.
27692
27693         * expression.cs (UnaryMutator): New class, used to handle ++ and
27694         -- separatedly from the other unary operators.  Cleans up the
27695         code, and kills the ExpressionStatement dependency in Unary.
27696
27697         (Unary): Removed `method' and `Arguments' from this class, making
27698         it smaller, and moving it all to SimpleCall, so I can reuse this
27699         code in other locations and avoid creating a lot of transient data
27700         strucutres when not required.
27701
27702         * cs-parser.jay: Adjust for new changes.
27703
27704 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
27705
27706         * enum.cs (Enum.Populate): If there is a failure during
27707         definition, return
27708
27709         * cs-parser.jay (opt_enum_base): we used to catch type errors
27710         here, but this is really incorrect.  The type error should be
27711         catched during semantic analysis.
27712
27713 2001-12-11  Ravi Pratap  <ravi@ximian.com>
27714
27715         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
27716         current_local_parameters as expected since I, in my stupidity, had forgotten
27717         to do this :-)
27718
27719         * attribute.cs (GetValidPlaces): Fix stupid bug.
27720
27721         * class.cs (Method::Emit): Perform check on applicability of attributes.
27722
27723         (Constructor::Emit): Ditto.
27724
27725         (Field::Emit): Ditto.
27726
27727         (Field.Location): Store location information.
27728
27729         (Property, Event, Indexer, Operator): Ditto.
27730
27731         * cs-parser.jay (field_declaration): Pass in location for each field.
27732
27733         * ../errors/cs0592.cs : Add.
27734
27735 2001-11-12  Ravi Pratap  <ravi@ximian.com>
27736
27737         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
27738
27739         (InitCoreTypes): Update accordingly.
27740
27741         (RegisterAttrType, LookupAttr): Implement.
27742
27743         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
27744         info about the same.
27745
27746         (Resolve): Update to populate the above as necessary.
27747
27748         (Error592): Helper.
27749
27750         (GetValidPlaces): Helper to the above.
27751
27752         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
27753
27754         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
27755
27756 2001-11-12  Ravi Pratap  <ravi@ximian.com>
27757
27758         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
27759
27760         * ../errors/cs0617.cs : Add.
27761
27762 2001-11-11  Ravi Pratap  <ravi@ximian.com>
27763
27764         * enum.cs (Emit): Rename to Populate to be more consistent with what
27765         we expect it to do and when exactly it is called.
27766
27767         * class.cs, rootcontext.cs : Update accordingly.
27768
27769         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
27770         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
27771
27772         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
27773
27774         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
27775         of a fieldinfo using the above, when dealing with a FieldBuilder.
27776
27777 2001-11-10  Ravi Pratap  <ravi@ximian.com>
27778
27779         * ../errors/cs0031.cs : Add.
27780
27781         * ../errors/cs1008.cs : Add.
27782
27783         * ../errrors/cs0543.cs : Add.
27784
27785         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
27786         enum type.
27787
27788         (FindMembers): Implement.
27789
27790         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
27791         enums and delegates too.
27792
27793         (enum_types): Rename to builder_to_enum.
27794
27795         (delegate_types): Rename to builder_to_delegate.
27796
27797         * delegate.cs (FindMembers): Implement.
27798
27799 2001-11-09  Ravi Pratap  <ravi@ximian.com>
27800
27801         * typemanager.cs (IsEnumType): Implement.
27802
27803         * enum.cs (Emit): Re-write parts to account for the underlying type
27804         better and perform checking etc.
27805
27806         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
27807         of the underlying type.
27808
27809         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
27810         value
27811
27812         * enum.cs (error31): Helper to report error #31.
27813
27814         * cs-parser.jay (enum_declaration): Store location of each member too.
27815
27816         * enum.cs (member_to_location): New hashtable. 
27817
27818         (AddEnumMember): Update location hashtable.
27819
27820         (Emit): Use the location of each member while reporting errors.
27821
27822 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27823
27824         * cs-parser.jay: A for_initializer if is a
27825         local_variable_declaration really ammount to have an implicit
27826         block with the variable declaration and no initializer for for.
27827
27828         * statement.cs (For.Emit): Cope with null initializers.
27829
27830         This fixes the infinite loop on for initializers.
27831
27832 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
27833
27834         * enum.cs: More cleanup.
27835
27836         * ecore.cs: Remove dead code.
27837
27838         * class.cs (Property.Emit): More simplification.
27839         (Event.Emit): ditto.
27840
27841         Reworked to have less levels of indentation.
27842
27843 2001-11-08  Ravi Pratap  <ravi@ximian.com>
27844
27845         * class.cs (Property): Emit attributes.
27846
27847         (Field): Ditto.
27848
27849         (Event): Ditto.
27850
27851         (Indexer): Ditto.
27852
27853         (Operator): Ditto.
27854
27855         * enum.cs (Emit): Ditto.
27856
27857         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
27858         Enums too.
27859
27860         * class.cs (Field, Event, etc.): Move attribute generation into the
27861         Emit method everywhere.
27862
27863         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
27864         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
27865         as we had no way of defining nested enums !
27866
27867         * rootcontext.cs : Adjust code accordingly.
27868
27869         * typemanager.cs (AddEnumType): To keep track of enum types separately.
27870
27871 2001-11-07  Ravi Pratap  <ravi@ximian.com>
27872
27873         * expression.cs (EvalConstantExpression): Move into ecore.cs
27874
27875         * enum.cs (Enum): Rename some members and make them public and readonly
27876         according to our convention.
27877
27878         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
27879         nothing else.
27880
27881         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
27882
27883         (Enum::Emit): Write a simple version for now which doesn't try to compute
27884         expressions. I shall modify this to be more robust in just a while.
27885
27886         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
27887
27888         (TypeContainer::CloseType): Create the Enum types too.
27889
27890         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
27891
27892         * expression.cs (EvalConstantExpression): Get rid of completely.
27893
27894         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
27895         user-defined values and other cases.
27896
27897         (IsValidEnumLiteral): Helper function.
27898
27899         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
27900         out there in the case we had a literal FieldExpr.
27901
27902         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
27903
27904         (Literalize): Revamp a bit to take two arguments.
27905
27906         (EnumLiteral): New class which derives from Literal to wrap enum literals.
27907
27908 2001-11-06  Ravi Pratap  <ravi@ximian.com>
27909
27910         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
27911
27912         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
27913
27914         (Resolve): Use the above to ensure we have proper initializers.
27915
27916 2001-11-05  Ravi Pratap  <ravi@ximian.com>
27917
27918         * expression.cs (Expression::EvalConstantExpression): New method to 
27919         evaluate constant expressions.
27920
27921         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
27922
27923 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
27924
27925         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
27926         in an array.
27927
27928         (Binary.ResolveOperator): Handle operator != (object a, object b)
27929         and operator == (object a, object b);
27930
27931         (Binary.DoNumericPromotions): Indicate whether the numeric
27932         promotion was possible.
27933
27934         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
27935         Implement.  
27936
27937         Made the ArrayAccess implement interface IAssignMethod instead of
27938         IStackStore as the order in which arguments are passed reflects
27939         this.
27940
27941         * assign.cs: Instead of using expr.ExprClass to select the way of
27942         assinging, probe for the IStackStore/IAssignMethod interfaces.
27943
27944         * typemanager.cs: Load InitializeArray definition.
27945
27946         * rootcontext.cs (RootContext.MakeStaticData): Used to define
27947         static data that can be used to initialize arrays. 
27948
27949 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
27950
27951         * expression.cs: Handle operator== and operator!= for booleans.
27952
27953         (Conditioal.Reduce): Implement reducer for the ?: operator.
27954
27955         (Conditional.Resolve): Implement dead code elimination.
27956
27957         (Binary.Resolve): Catch string literals and return a new
27958         concatenated string.
27959
27960         (Unary.Reduce): Implement reduction of unary expressions.
27961
27962         * ecore.cs: Split out the expression core handling here.
27963
27964         (Expression.Reduce): New method used to perform constant folding
27965         and CSE.  This is needed to support constant-expressions. 
27966
27967         * statement.cs (Statement.EmitBoolExpression): Pass true and false
27968         targets, and optimize for !x.
27969
27970 2001-11-04  Ravi Pratap  <ravi@ximian.com>
27971
27972         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
27973         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
27974         set custom atttributes.
27975
27976         * literal.cs (Literal::GetValue): New abstract method to return the actual
27977         value of the literal, cast as an object.
27978
27979         (*Literal): Implement GetValue method.
27980
27981         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
27982         expressions to the arraylist but objects of type Argument.
27983
27984         * class.cs (TypeContainer::Emit): Emit our attributes too.
27985
27986         (Method::Emit, Constructor::Emit): Ditto.
27987
27988         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
27989         to be ignoring earlier.
27990
27991 2001-11-03  Ravi Pratap  <ravi@ximian.com>
27992
27993         * attribute.cs (AttributeSection::Define): Implement to do the business
27994         of constructing a CustomAttributeBuilder.
27995
27996         (Attribute): New trivial class. Increases readability of code.  
27997
27998         * cs-parser.jay : Update accordingly.
27999
28000         (positional_argument_list, named_argument_list, named_argument): New rules
28001
28002         (attribute_arguments): Use the above so that we are more correct.
28003
28004 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28005
28006         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28007         to perform all checks for a method with a params parameter.
28008
28009         (Invocation::OverloadResolve): Update to use the above method and therefore
28010         cope correctly with params method invocations.
28011
28012         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28013         params too.
28014
28015         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28016         constructors in our parent too because we can't afford to miss out on 
28017         protected ones ;-)
28018
28019         * attribute.cs (AttributeSection): New name for the class Attribute
28020
28021         Other trivial changes to improve readability.
28022
28023         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28024         use the new class names.
28025
28026 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28027
28028         * class.cs (Method::Define): Complete definition for params types too
28029
28030         (Indexer::Define): Ditto.
28031
28032         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28033         Cope everywhere with a request for info about the array parameter.
28034
28035 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28036
28037         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28038
28039         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28040         local_variable_type to extract the string corresponding to the type.
28041
28042         (local_variable_type): Fixup the action to use the new helper method.
28043
28044         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28045         go.
28046
28047         * expression.cs : Clean out code which uses the above.
28048
28049 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28050
28051         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28052         and bale out if necessary by returning a false.
28053
28054         (RegisterProperty): Ditto.
28055
28056         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28057         and print out appropriate error messages.
28058
28059         * interface.cs (everywhere): Ditto.
28060
28061         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28062         location to constructor.
28063
28064         * class.cs (Property, Event, Indexer): Update accordingly.
28065
28066         * ../errors/cs111.cs : Added.
28067
28068         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28069         of a method, as laid down by the spec.
28070
28071         (Invocation::OverloadResolve): Use the above method.
28072
28073 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28074
28075         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28076         now take a TypeContainer and a Parameters object.
28077
28078         (ParameterData): Modify return type of ParameterModifier method to be 
28079         Parameter.Modifier and not a string.
28080
28081         (ReflectionParameters, InternalParameters): Update accordingly.
28082
28083         * expression.cs (Argument::GetParameterModifier): Same here.
28084
28085         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28086         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28087         symbol in it at all so maybe this is only for now.
28088
28089 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28090
28091         * support.cs (InternalParameters): Constructor now takes an extra argument 
28092         which is the actual Parameters class.
28093
28094         (ParameterDesc): Update to provide info on ref/out modifiers.
28095
28096         * class.cs (everywhere): Update call to InternalParameters to pass in
28097         the second argument too.
28098
28099         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28100         to return the modifier info [ref/out etc]
28101
28102         (InternalParameters, ReflectionParameters): Implement the above.
28103
28104         * expression.cs (Argument::ParameterModifier): Similar function to return
28105         info about the argument's modifiers.
28106
28107         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28108         too.
28109
28110         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28111         a new SetFormalParameters object which we pass to InternalParameters.
28112
28113 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28114
28115         * expression.cs (NewArray): Merge into the ArrayCreation class.
28116
28117 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28118
28119         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28120         NewUserdefinedArray into one as there wasn't much of a use in having
28121         two separate ones.
28122
28123         * expression.cs (Argument): Change field's name to ArgType from Type.
28124
28125         (Type): New readonly property which returns the proper type, taking into 
28126         account ref/out modifiers.
28127
28128         (everywhere): Adjust code accordingly for the above.
28129
28130         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28131         whether we are emitting for a ref or out parameter.
28132
28133         * expression.cs (Argument::Emit): Use the above field to set the state.
28134
28135         (LocalVariableReference::Emit): Update to honour the flag and emit the
28136         right stuff.
28137
28138         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28139
28140         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28141
28142         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28143
28144         (ReflectionParameters, InternalParameters): Implement the above method.
28145
28146         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28147         reporting errors.
28148
28149         (Invocation::FullMethodDesc): Ditto. 
28150
28151 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28152
28153         * cs-parser.jay: Add extra production for the second form of array
28154         creation. 
28155
28156         * expression.cs (ArrayCreation): Update to reflect the above
28157         change. 
28158
28159         * Small changes to prepare for Array initialization.
28160
28161 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28162
28163         * typemanager.cs (ImplementsInterface): interface might be null;
28164         Deal with this problem;
28165
28166         Also, we do store negative hits on the cache (null values), so use
28167         this instead of calling t.GetInterfaces on the type everytime.
28168
28169 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28170
28171         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28172
28173         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28174         split functionality out into different classes.
28175
28176         (New::FormArrayType): Move into NewBuiltinArray.
28177
28178         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28179         quite useless.
28180
28181         (NewBuiltinArray): New class to handle creation of built-in arrays.
28182
28183         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28184         account creation of one-dimensional arrays.
28185
28186         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28187
28188         (NewUserdefinedArray::DoResolve): Implement.
28189
28190         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28191
28192         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28193         we maintain inside the TypeManager. This is necessary to perform lookups on the
28194         module builder.
28195
28196         (LookupType): Update to perform GetType on the module builders too.     
28197
28198         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28199
28200         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28201
28202 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28203
28204         * expression.cs (New::DoResolve): Implement guts of array creation.
28205
28206         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28207
28208 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28209
28210         * expression.cs: Fix bug I introduced lsat night that broke
28211         Delegates. 
28212
28213         (Expression.Resolve): Report a 246 error (can not resolve name)
28214         if we find a SimpleName in the stream.
28215
28216         (Expression.ResolveLValue): Ditto.
28217
28218         (Expression.ResolveWithSimpleName): This function is a variant of
28219         ResolveName, this one allows SimpleNames to be returned without a
28220         warning.  The only consumer of SimpleNames is MemberAccess
28221
28222 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28223
28224         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28225         might arrive here.  I have my doubts that this is correct.
28226
28227         * statement.cs (Lock): Implement lock statement.
28228
28229         * cs-parser.jay: Small fixes to support `lock' and `using'
28230
28231         * cs-tokenizer.cs: Remove extra space
28232
28233         * driver.cs: New flag --checked, allows to turn on integer math
28234         checking. 
28235
28236         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28237         Threading.Monitor.Exit 
28238
28239 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28240
28241         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28242         Expression Class to be IndexerAccess.
28243
28244         Notice that Indexer::DoResolve sets the eclass to Value.
28245
28246 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28247
28248         * class.cs (TypeContainer::Emit): Emit code for indexers.
28249
28250         * assign.cs (IAssignMethod): New interface implemented by Indexers
28251         and Properties for handling assignment.
28252
28253         (Assign::Emit): Simplify and reuse code. 
28254
28255         * expression.cs (IndexerAccess, PropertyExpr): Implement
28256         IAssignMethod, clean up old code. 
28257
28258 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28259
28260         * typemanager.cs (ImplementsInterface): New method to determine if a type
28261         implements a given interface. Provides a nice cache too.
28262
28263         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28264         method.
28265
28266         (ConvertReferenceExplicit): Ditto.
28267
28268         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28269         various methods, with correct names etc.
28270
28271         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28272         Operator.UnaryNegation.
28273
28274         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28275         we have a unary plus or minus operator.
28276
28277         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28278         UnaryMinus.
28279
28280         * everywhere : update accordingly.
28281
28282         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28283         respectively.
28284
28285         * class.cs (Method::Define): For the case where we are implementing a method
28286         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28287         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28288
28289 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28290
28291         * interface.cs (FindMembers): Implement to work around S.R.E
28292         lameness.
28293
28294         * typemanager.cs (IsInterfaceType): Implement.
28295
28296         (FindMembers): Update to handle interface types too.
28297
28298         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28299         use IsAssignableFrom as that is not correct - it doesn't work.
28300
28301         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28302         and accordingly override EmitStatement.
28303
28304         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28305         using the correct logic :-)
28306
28307 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28308
28309         * ../errors/cs-11.cs : Add to demonstrate error -11 
28310
28311 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28312
28313         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28314         then pass this as a hint to ResolveLValue.
28315
28316         * expression.cs (FieldExpr): Add Location information
28317
28318         (FieldExpr::LValueResolve): Report assignment to readonly
28319         variable. 
28320
28321         (Expression::ExprClassFromMemberInfo): Pass location information.
28322
28323         (Expression::ResolveLValue): Add new method that resolves an
28324         LValue. 
28325
28326         (Expression::DoResolveLValue): Default invocation calls
28327         DoResolve. 
28328
28329         (Indexers): New class used to keep track of indexers in a given
28330         Type. 
28331
28332         (IStackStore): Renamed from LValue, as it did not really describe
28333         what this did.  Also ResolveLValue is gone from this interface and
28334         now is part of Expression.
28335
28336         (ElementAccess): Depending on the element access type
28337
28338         * typemanager.cs: Add `indexer_name_type' as a Core type
28339         (System.Runtime.CompilerServices.IndexerNameAttribute)
28340
28341         * statement.cs (Goto): Take a location.
28342
28343 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28344
28345         * delegate.cs (Delegate::VerifyDelegate): New method to verify
28346         if two delegates are compatible.
28347
28348         (NewDelegate::DoResolve): Update to take care of the case when
28349         we instantiate a delegate from another delegate.
28350
28351         * typemanager.cs (FindMembers): Don't even try to look up members
28352         of Delegate types for now.
28353
28354 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28355
28356         * delegate.cs (NewDelegate): New class to take care of delegate
28357         instantiation.
28358
28359         * expression.cs (New): Split the delegate related code out into 
28360         the NewDelegate class.
28361
28362         * delegate.cs (DelegateInvocation): New class to handle delegate 
28363         invocation.
28364
28365         * expression.cs (Invocation): Split out delegate related code into
28366         the DelegateInvocation class.
28367
28368 2001-10-17  Ravi Pratap  <ravi@ximian.com>
28369
28370         * expression.cs (New::DoResolve): Implement delegate creation fully
28371         and according to the spec.
28372
28373         (New::DoEmit): Update to handle delegates differently.
28374
28375         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28376         because of which we were printing out arguments in reverse order !
28377
28378         * delegate.cs (VerifyMethod): Implement to check if the given method
28379         matches the delegate.
28380
28381         (FullDelegateDesc): Implement.
28382
28383         (VerifyApplicability): Implement.
28384
28385         * expression.cs (Invocation::DoResolve): Update to accordingly handle
28386         delegate invocations too.
28387
28388         (Invocation::Emit): Ditto.
28389
28390         * ../errors/cs1593.cs : Added.
28391
28392         * ../errors/cs1594.cs : Added.
28393
28394         * delegate.cs (InstanceExpression, TargetMethod): New properties.
28395
28396 2001-10-16  Ravi Pratap  <ravi@ximian.com>
28397
28398         * typemanager.cs (intptr_type): Core type for System.IntPtr
28399
28400         (InitCoreTypes): Update for the same.
28401
28402         (iasyncresult_type, asynccallback_type): Ditto.
28403
28404         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28405         correct.
28406
28407         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28408         too.
28409
28410         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28411         the builders for the 4 members of a delegate type :-)
28412
28413         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28414         type.
28415
28416         * expression.cs (New::DoResolve): Implement guts for delegate creation.
28417
28418         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28419
28420 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
28421
28422         * statement.cs (Break::Emit): Implement.   
28423         (Continue::Emit): Implement.
28424
28425         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28426         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28427         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28428         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
28429         end loop
28430
28431         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28432         properties that track the label for the current loop (begin of the
28433         loop and end of the loop).
28434
28435 2001-10-15  Ravi Pratap  <ravi@ximian.com>
28436
28437         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28438         use of emitting anything at all.
28439
28440         * class.cs, rootcontext.cs : Get rid of calls to the same.
28441
28442         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28443
28444         (Populate): Define the constructor correctly and set the implementation
28445         attributes.
28446
28447         * typemanager.cs (delegate_types): New hashtable to hold delegates that
28448         have been defined.
28449
28450         (AddDelegateType): Implement.
28451
28452         (IsDelegateType): Implement helper method.
28453
28454         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28455
28456         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28457         and accordingly handle it.
28458
28459         * delegate.cs (Populate): Take TypeContainer argument.
28460         Implement bits to define the Invoke method. However, I still haven't figured out
28461         how to take care of the native int bit :-(
28462
28463         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
28464         Qualify the name of the delegate, not its return type !
28465
28466         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28467         conversion.
28468
28469         (StandardConversionExists): Checking for array types turns out to be recursive.
28470
28471         (ConvertReferenceExplicit): Implement array conversion.
28472
28473         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28474
28475 2001-10-12  Ravi Pratap  <ravi@ximian.com>
28476
28477         * cs-parser.jay (delegate_declaration): Store the fully qualified
28478         name as it is a type declaration.
28479
28480         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
28481         readonly.
28482
28483         (DefineDelegate): Renamed from Define. Does the same thing essentially,
28484         as TypeContainer::DefineType.
28485
28486         (Populate): Method in which all the definition of the various methods (Invoke)
28487         etc is done.
28488
28489         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28490         see.
28491
28492         (CloseDelegate): Finally creates the delegate.
28493
28494         * class.cs (TypeContainer::DefineType): Update to define delegates.
28495         (Populate, Emit and CloseType): Do the same thing here too.
28496
28497         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28498         delegates in all these operations.
28499
28500 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
28501
28502         * expression.cs: LocalTemporary: a new expression used to
28503         reference a temporary that has been created.
28504
28505         * assign.cs: Handle PropertyAccess back here, so that we can
28506         provide the proper semantic access to properties.
28507
28508         * expression.cs (Expression::ConvertReferenceExplicit): Implement
28509         a few more explicit conversions. 
28510
28511         * modifiers.cs: `NEW' modifier maps to HideBySig.
28512
28513         * expression.cs (PropertyExpr): Make this into an
28514         ExpressionStatement, and support the EmitStatement code path. 
28515
28516         Perform get/set error checking, clean up the interface.
28517
28518         * assign.cs: recognize PropertyExprs as targets, and if so, turn
28519         them into toplevel access objects.
28520
28521 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
28522
28523         * expression.cs: PropertyExpr::PropertyExpr: use work around the
28524         SRE.
28525
28526         * typemanager.cs: Keep track here of our PropertyBuilders again to
28527         work around lameness in SRE.
28528
28529 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
28530
28531         * expression.cs (LValue::LValueResolve): New method in the
28532         interface, used to perform a second resolution pass for LValues. 
28533
28534         (This::DoResolve): Catch the use of this in static methods.
28535
28536         (This::LValueResolve): Implement.
28537
28538         (This::Store): Remove warning, assigning to `this' in structures
28539         is 
28540
28541         (Invocation::Emit): Deal with invocation of
28542         methods on value types.  We need to pass the address to structure
28543         methods rather than the object itself.  (The equivalent code to
28544         emit "this" for structures leaves the entire structure on the
28545         stack instead of a pointer to it). 
28546
28547         (ParameterReference::DoResolve): Compute the real index for the
28548         argument based on whether the method takes or not a `this' pointer
28549         (ie, the method is static).
28550
28551         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28552         value types returned from functions when we need to invoke a
28553         method on the sturcture.
28554
28555
28556 2001-10-11  Ravi Pratap  <ravi@ximian.com>
28557
28558         * class.cs (TypeContainer::DefineType): Method to actually do the business of
28559         defining the type in the Modulebuilder or Typebuilder. This is to take
28560         care of nested types which need to be defined on the TypeBuilder using
28561         DefineNestedMethod.
28562
28563         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
28564         methods in RootContext, only ported to be part of TypeContainer.
28565
28566         (TypeContainer::GetInterfaceOrClass): Ditto.
28567
28568         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28569
28570         * interface.cs (Interface::DefineInterface): New method. Does exactly
28571         what RootContext.CreateInterface did earlier, only it takes care of nested types 
28572         too.
28573
28574         (Interface::GetInterfaces): Move from RootContext here and port.
28575
28576         (Interface::GetInterfaceByName): Same here.
28577
28578         * rootcontext.cs (ResolveTree): Re-write.
28579
28580         (PopulateTypes): Re-write.
28581
28582         * class.cs (TypeContainer::Populate): Populate nested types too.
28583         (TypeContainer::Emit): Emit nested members too.
28584
28585         * typemanager.cs (AddUserType): Do not make use of the FullName property,
28586         instead just use the name argument passed in as it is already fully
28587         qualified.
28588
28589         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28590         to TypeContainer mapping to see if a type is user-defined.
28591
28592         * class.cs (TypeContainer::CloseType): Implement. 
28593
28594         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28595         the default constructor.
28596
28597         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28598         twice.
28599
28600         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28601
28602         * interface.cs (CloseType): Create the type here.
28603
28604         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28605         the hierarchy.
28606
28607         Remove all the methods which are now in TypeContainer.
28608
28609 2001-10-10  Ravi Pratap  <ravi@ximian.com>
28610
28611         * delegate.cs (Define): Re-write bits to define the delegate
28612         correctly.
28613
28614 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
28615
28616         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28617
28618         * expression.cs (ImplicitReferenceConversion): handle null as well
28619         as a source to convert to any reference type.
28620
28621         * statement.cs (Return): Perform any implicit conversions to
28622         expected return type.  
28623
28624         Validate use of return statement.  
28625
28626         * codegen.cs (EmitContext): Pass the expected return type here.
28627
28628         * class.cs (Method, Constructor, Property): Pass expected return
28629         type to EmitContext.
28630
28631 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
28632
28633         * expression.cs: Make DoResolve take an EmitContext instead of a
28634         TypeContainer.
28635
28636         Replaced `l' and `location' for `loc', for consistency.
28637
28638         (Error, Warning): Remove unneeded Tc argument.
28639
28640         * assign.cs, literal.cs, constant.cs: Update to new calling
28641         convention. 
28642
28643         * codegen.cs: EmitContext now contains a flag indicating whether
28644         code is being generated in a static method or not.
28645
28646         * cs-parser.jay: DecomposeQI, new function that replaces the old
28647         QualifiedIdentifier.  Now we always decompose the assembled
28648         strings from qualified_identifier productions into a group of
28649         memberaccesses.
28650
28651 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
28652
28653         * rootcontext.cs: Deal with field-less struct types correctly now
28654         by passing the size option to Define Type.
28655
28656         * class.cs: Removed hack that created one static field. 
28657
28658 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28659
28660         * statement.cs: Moved most of the code generation here. 
28661
28662 2001-10-09  Ravi Pratap  <ravi@ximian.com>
28663
28664         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28665         seem very right.
28666
28667         (ElementAccess): Remove useless bits for now - keep checks as the spec
28668         says.
28669
28670 2001-10-08  Ravi Pratap  <ravi@ximian.com>
28671
28672         * expression.cs (ElementAccess::DoResolve): Remove my crap code
28673         and start performing checks according to the spec.
28674
28675 2001-10-07  Ravi Pratap  <ravi@ximian.com>
28676
28677         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28678         rank_specifiers instead.
28679
28680         (rank_specifiers): Change the order in which the rank specifiers are stored
28681
28682         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
28683
28684         * expression.cs (ElementAccess): Implement the LValue interface too.
28685
28686 2001-10-06  Ravi Pratap  <ravi@ximian.com>
28687
28688         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
28689         except that user defined conversions are not included.
28690
28691         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
28692         perform the conversion of the return type, if necessary.
28693
28694         (New::DoResolve): Check whether we are creating an array or an object
28695         and accordingly do the needful.
28696
28697         (New::Emit): Same here.
28698
28699         (New::DoResolve): Implement guts of array creation.
28700
28701         (New::FormLookupType): Helper function.
28702
28703 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28704
28705         * codegen.cs: Removed most of the code generation here, and move the
28706         corresponding code generation bits to the statement classes. 
28707
28708         Added support for try/catch/finalize and throw.
28709
28710         * cs-parser.jay: Added support for try/catch/finalize.
28711
28712         * class.cs: Catch static methods having the flags override,
28713         virtual or abstract.
28714
28715         * expression.cs (UserCast): This user cast was not really doing
28716         what it was supposed to do.  Which is to be born in fully resolved
28717         state.  Parts of the resolution were being performed at Emit time! 
28718
28719         Fixed this code.
28720
28721 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
28722
28723         * expression.cs: Implicity convert the result from UserCast.
28724
28725 2001-10-05  Ravi Pratap  <ravi@ximian.com>
28726
28727         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
28728         prevented it from working correctly. 
28729
28730         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
28731         merely ConvertImplicit.
28732
28733 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
28734
28735         * typemanager.cs: Make the LookupTypeContainer function static,
28736         and not per-instance.  
28737
28738         * class.cs: Make static FindMembers (the one that takes a Type
28739         argument). 
28740
28741         * codegen.cs: Add EmitForeach here.
28742
28743         * cs-parser.jay: Make foreach a toplevel object instead of the
28744         inline expansion, as we need to perform semantic analysis on it. 
28745
28746 2001-10-05  Ravi Pratap  <ravi@ximian.com>
28747
28748         * expression.cs (Expression::ImplicitUserConversion): Rename to
28749         UserDefinedConversion.
28750
28751         (Expression::UserDefinedConversion): Take an extra argument specifying 
28752         whether we look for explicit user conversions too.
28753
28754         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
28755
28756         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
28757
28758         (ExplicitUserConversion): Make it a call to UserDefinedConversion
28759         with the appropriate arguments.
28760
28761         * cs-parser.jay (cast_expression): Record location too.
28762
28763         * expression.cs (Cast): Record location info.
28764
28765         (Expression::ConvertExplicit): Take location argument.
28766
28767         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
28768         to determine if we are doing explicit conversions.
28769
28770         (UserCast::Emit): Update accordingly.
28771
28772         (Expression::ConvertExplicit): Report an error if everything fails.
28773
28774         * ../errors/cs0030.cs : Add.
28775
28776 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
28777
28778         * modifiers.cs: If the ABSTRACT keyword is present, also set the
28779         virtual and newslot bits. 
28780
28781         * class.cs (TypeContainer::RegisterRequiredImplementations):
28782         Record methods we need.
28783
28784         (TypeContainer::MakeKey): Helper function to make keys for
28785         MethodBases, since the Methodbase key is useless.
28786
28787         (TypeContainer::Populate): Call RegisterRequiredImplementations
28788         before defining the methods.   
28789
28790         Create a mapping for method_builders_to_methods ahead of time
28791         instead of inside a tight loop.
28792
28793         (::RequireMethods):  Accept an object as the data to set into the
28794         hashtable so we can report interface vs abstract method mismatch.
28795
28796 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
28797
28798         * report.cs: Make all of it static.
28799
28800         * rootcontext.cs: Drop object_type and value_type computations, as
28801         we have those in the TypeManager anyways.
28802
28803         Drop report instance variable too, now it is a global.
28804
28805         * driver.cs: Use try/catch on command line handling.
28806
28807         Add --probe option to debug the error reporting system with a test
28808         suite. 
28809
28810         * report.cs: Add support for exiting program when a probe
28811         condition is reached.
28812
28813 2001-10-03  Ravi Pratap  <ravi@ximian.com>
28814
28815         * expression.cs (Binary::DoNumericPromotions): Fix the case when
28816         we do a forcible conversion regardless of type, to check if 
28817         ForceConversion returns a null.
28818
28819         (Binary::error19): Use location to report error.
28820
28821         (Unary::error23): Use location here too.
28822
28823         * ../errors/cs0019.cs : Check in.
28824
28825         * ../errors/cs0023.cs : Check in.
28826
28827         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
28828         case of a non-null MethodInfo object with a length of 0 !
28829
28830         (Binary::ResolveOperator): Flag error if overload resolution fails to find
28831         an applicable member - according to the spec :-)
28832         Also fix logic to find members in base types.
28833
28834         (Unary::ResolveOperator): Same here.
28835
28836         (Unary::report23): Change name to error23 and make first argument a TypeContainer
28837         as I was getting thoroughly confused between this and error19 :-)
28838
28839         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
28840         (::FindMostEncompassedType): Implement.
28841         (::FindMostEncompassingType): Implement.
28842         (::StandardConversionExists): Implement.
28843
28844         (UserImplicitCast): Re-vamp. We now need info about most specific
28845         source and target types so that we can do the necessary conversions.
28846
28847         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
28848         mathematical union with no duplicates.
28849
28850 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
28851
28852         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
28853         in order from base classes to child classes, so that we can in
28854         child classes look up in our parent for method names and
28855         attributes (required for handling abstract, virtual, new, override
28856         constructs: we need to instrospect our base class, and if we dont
28857         populate the classes in order, the introspection might be
28858         incorrect.  For example, a method could query its parent before
28859         the parent has any methods and would determine that the parent has
28860         no abstract methods (while it could have had them)).
28861
28862         (RootContext::CreateType): Record the order in which we define the
28863         classes.
28864
28865 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
28866
28867         * class.cs (TypeContainer::Populate): Also method definitions can
28868         fail now, keep track of this.
28869
28870         (TypeContainer::FindMembers): Implement support for
28871         DeclaredOnly/noDeclaredOnly flag.
28872
28873         (Constructor::Emit) Return the ConstructorBuilder.
28874
28875         (Method::Emit) Return the MethodBuilder. 
28876         Check for abstract or virtual methods to be public.
28877
28878         * rootcontext.cs (RootContext::CreateType): Register all the
28879         abstract methods required for the class to be complete and the
28880         interface methods that must be implemented. 
28881
28882         * cs-parser.jay: Report error 501 (method requires body if it is
28883         not marked abstract or extern).
28884
28885         * expression.cs (TypeOf::Emit): Implement.
28886
28887         * typemanager.cs: runtime_handle_type, new global type.
28888
28889         * class.cs (Property::Emit): Generate code for properties.
28890
28891 2001-10-02  Ravi Pratap  <ravi@ximian.com>
28892
28893         * expression.cs (Unary::ResolveOperator): Find operators on base type
28894         too - we now conform exactly to the spec.
28895
28896         (Binary::ResolveOperator): Same here.
28897
28898         * class.cs (Operator::Define): Fix minor quirk in the tests.
28899
28900         * ../errors/cs0215.cs : Added.
28901
28902         * ../errors/cs0556.cs : Added.
28903
28904         * ../errors/cs0555.cs : Added.
28905
28906 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
28907
28908         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
28909         single integer which is really efficient
28910
28911 2001-10-01  Ravi Pratap  <ravi@ximian.com>
28912
28913         *  expression.cs (Expression::ImplicitUserConversion): Use location
28914         even in the case when we are examining True operators.
28915  
28916         * class.cs (Operator::Define): Perform extensive checks to conform
28917         with the rules for operator overloading in the spec.
28918
28919         * expression.cs (Expression::ImplicitReferenceConversion): Implement
28920         some of the other conversions mentioned in the spec.
28921
28922         * typemanager.cs (array_type): New static member for the System.Array built-in
28923         type.
28924
28925         (cloneable_interface): For System.ICloneable interface.
28926
28927         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
28928         we start resolving the tree and populating types.
28929
28930         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
28931  
28932 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
28933
28934         * expression.cs (Expression::ExprClassFromMemberInfo,
28935         Expression::Literalize): Create literal expressions from
28936         FieldInfos which are literals.
28937
28938         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
28939         type casts, because they were wrong.  The test suite in tests
28940         caught these ones.
28941
28942         (ImplicitNumericConversion): ushort to ulong requires a widening
28943         cast. 
28944
28945         Int32 constant to long requires widening cast as well.
28946
28947         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
28948         for integers because the type on the stack is not i4.
28949
28950 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
28951
28952         * expression.cs (report118): require location argument. 
28953
28954         * parameter.cs: Do not dereference potential null value.
28955
28956         * class.cs: Catch methods that lack the `new' keyword when
28957         overriding a name.  Report warnings when `new' is used without
28958         anything being there to override.
28959
28960         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
28961
28962         * class.cs: Only add constructor to hashtable if it is non-null
28963         (as now constructors can fail on define).
28964
28965         (TypeManager, Class, Struct): Take location arguments.
28966
28967         Catch field instance initialization in structs as errors.
28968
28969         accepting_filter: a new filter for FindMembers that is static so
28970         that we dont create an instance per invocation.
28971
28972         (Constructor::Define): Catch errors where a struct constructor is
28973         parameterless 
28974
28975         * cs-parser.jay: Pass location information for various new
28976         constructs. 
28977
28978         * delegate.cs (Delegate): take a location argument.
28979
28980         * driver.cs: Do not call EmitCode if there were problesm in the
28981         Definition of the types, as many Builders wont be there. 
28982
28983         * decl.cs (Decl::Decl): Require a location argument.
28984
28985         * cs-tokenizer.cs: Handle properly hex constants that can not fit
28986         into integers, and find the most appropiate integer for it.
28987
28988         * literal.cs: Implement ULongLiteral.
28989
28990         * rootcontext.cs: Provide better information about the location of
28991         failure when CreateType fails.
28992
28993 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
28994
28995         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
28996         as well.
28997
28998         * expression.cs (Binary::CheckShiftArguments): Add missing type
28999         computation.
29000         (Binary::ResolveOperator): Add type to the logical and and logical
29001         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29002         before.
29003
29004         (Binary::DoNumericPromotions): In the case where either argument
29005         is ulong (and most signed types combined with ulong cause an
29006         error) perform implicit integer constant conversions as well.
29007
29008 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29009
29010         * expression.cs (UserImplicitCast): Method should always be
29011         non-null. 
29012         (Invocation::BetterConversion): Simplified test for IntLiteral.
29013
29014         (Expression::ImplicitNumericConversion): Split this routine out.
29015         Put the code that performs implicit constant integer conversions
29016         here. 
29017
29018         (Expression::Resolve): Become a wrapper around DoResolve so we can
29019         check eclass and type being set after resolve.
29020
29021         (Invocation::Badness): Remove this dead function
29022
29023         (Binary::ResolveOperator): Do not compute the expensive argumnets
29024         unless we have a union for it.
29025
29026         (Probe::Emit): Is needs to do an isinst and then
29027         compare against null.
29028
29029         (::CanConvert): Added Location argument.  If the Location argument
29030         is null (Location.Null), then we do not report errors.  This is
29031         used by the `probe' mechanism of the Explicit conversion.  We do
29032         not want to generate an error for something that the user
29033         explicitly requested to be casted.  But the pipeline for an
29034         explicit cast first tests for potential implicit casts.
29035
29036         So for now, if the Location is null, it means `Probe only' to
29037         avoid adding another argument.   Might have to revise this
29038         strategy later.
29039
29040         (ClassCast): New class used to type cast objects into arbitrary
29041         classes (used in Explicit Reference Conversions).
29042
29043         Implement `as' as well.
29044
29045         Reverted all the patches from Ravi below: they were broken:
29046
29047                 * The use of `level' as a mechanism to stop recursive
29048                   invocations is wrong.  That was there just to catch the
29049                   bug with a strack trace but not as a way of addressing
29050                   the problem.
29051
29052                   To fix the problem we have to *understand* what is going
29053                   on and the interactions and come up with a plan, not
29054                   just get things going.
29055
29056                 * The use of the type conversion cache that I proposed
29057                   last night had an open topic: How does this work across
29058                   protection domains.  A user defined conversion might not
29059                   be public in the location where we are applying the
29060                   conversion, a different conversion might be selected
29061                   (ie, private A->B (better) but public B->A (worse),
29062                   inside A, A->B applies, but outside it, B->A will
29063                   apply).
29064
29065                 * On top of that (ie, even if the above is solved),
29066                   conversions in a cache need to be abstract.  Ie, `To
29067                   convert from an Int to a Short use an OpcodeCast', not
29068                   `To convert from an Int to a Short use the OpcodeCast on
29069                   the variable 5' (which is what this patch was doing).
29070
29071 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29072
29073         * expression.cs (Invocation::ConversionExists): Re-write to use
29074         the conversion cache
29075
29076         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29077         cache all conversions done, not just user-defined ones.
29078
29079         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29080         to determine if a conversion exists instead of acutually trying to 
29081         perform the conversion. It's faster too.
29082
29083         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29084         and only then attempt the implicit conversion.
29085
29086 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29087
29088         * expression.cs (ConvertImplicit): Use a cache for conversions
29089         already found. Check level of recursion and bail out if necessary.
29090
29091 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29092
29093         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29094         Export standard methods that we expect for string operations.
29095
29096         * statement.cs (Block::UsageWarning): Track usage of variables and
29097         report the errors for not used variables.
29098
29099         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29100         operator. 
29101
29102 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29103
29104         * codegen.cs: remove unnneded code 
29105
29106         * expression.cs: Removed BuiltinTypeAccess class
29107
29108         Fix the order in which implicit conversions are
29109         done.  
29110
29111         The previous fixed dropped support for boxed conversions (adding a
29112         test to the test suite now)
29113
29114         (UserImplicitCast::CanConvert): Remove test for source being null,
29115         that code is broken.  We should not feed a null to begin with, if
29116         we do, then we should track the bug where the problem originates
29117         and not try to cover it up here.
29118
29119         Return a resolved expression of type UserImplicitCast on success
29120         rather than true/false.  Ravi: this is what I was talking about,
29121         the pattern is to use a static method as a "constructor" for
29122         objects. 
29123
29124         Also, do not create arguments until the very last minute,
29125         otherwise we always create the arguments even for lookups that
29126         will never be performed. 
29127
29128         (UserImplicitCast::Resolve): Eliminate, objects of type
29129         UserImplicitCast are born in a fully resolved state. 
29130
29131         * typemanager.cs (InitCoreTypes): Init also value_type
29132         (System.ValueType). 
29133
29134         * expression.cs (Cast::Resolve): First resolve the child expression.
29135
29136         (LValue): Add new method AddressOf to be used by
29137         the `&' operator.  
29138
29139         Change the argument of Store to take an EmitContext instead of an
29140         ILGenerator, because things like FieldExpr need to be able to call
29141         their children expression to generate the instance code. 
29142
29143         (Expression::Error, Expression::Warning): Sugar functions for
29144         reporting errors.
29145
29146         (Expression::MemberLookup): Accept a TypeContainer instead of a
29147         Report as the first argument.
29148
29149         (Expression::ResolvePrimary): Killed.  I still want to improve
29150         this as currently the code is just not right.
29151
29152         (Expression::ResolveMemberAccess): Simplify, but it is still
29153         wrong. 
29154
29155         (Unary::Resolve): Catch errors in AddressOf operators.
29156
29157         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29158         index to a byte for the short-version, or the compiler will choose
29159         the wrong Emit call, which generates the wrong data.
29160
29161         (ParameterReference::Emit, ::Store): same.
29162
29163         (FieldExpr::AddressOf): Implement.
29164
29165         * typemanager.cs: TypeManager: made public variable instead of
29166         property.
29167
29168         * driver.cs: document --fatal.
29169
29170         * report.cs (ErrorMessage, WarningMessage): new names for the old
29171         Error and Warning classes.
29172
29173         * cs-parser.jay (member_access): Turn built-in access to types
29174         into a normal simplename
29175
29176 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29177
29178         * expression.cs (Invocation::BetterConversion): Fix to cope
29179         with q being null, since this was introducing a bug.
29180
29181         * expression.cs (ConvertImplicit): Do built-in conversions first.
29182
29183 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29184
29185         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29186
29187 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29188
29189         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29190         I had introduced long ago (what's new ?).
29191
29192         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29193         the work of all the checking. 
29194         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29195         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29196
29197         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29198         that is the right way. 
29199
29200         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29201         overloading resolution. Use everywhere instead of cutting and pasting code.
29202
29203         (Binary::ResolveOperator): Use MakeUnionSet.
29204
29205         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29206         we have to convert to bool types. Not complete yet.
29207
29208 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29209
29210         * typemanager.cs (TypeManager::CSharpName): support ushort.
29211
29212         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29213         to provide an expression that performsn an implicit constant int
29214         conversion (section 6.1.6).
29215         (Expression::ConvertImplicitRequired): Reworked to include
29216         implicit constant expression conversions.
29217
29218         (Expression::ConvertNumericExplicit): Finished.
29219
29220         (Invocation::Emit): If InstanceExpression is null, then it means
29221         that we perform a call on this.
29222
29223 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29224
29225         * expression.cs (Unary::Emit): Remove some dead code.
29226         (Probe): Implement Resolve and Emit for `is'.
29227         (Expression::ConvertImplicitRequired): Attempt to do constant
29228         expression conversions here.  Maybe should be moved to
29229         ConvertImplicit, but I am not sure.
29230         (Expression::ImplicitLongConstantConversionPossible,
29231         Expression::ImplicitIntConstantConversionPossible): New functions
29232         that tell whether is it possible to apply an implicit constant
29233         expression conversion.
29234
29235         (ConvertNumericExplicit): Started work on explicit numeric
29236         conversions.
29237
29238         * cs-parser.jay: Update operator constants.
29239
29240         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29241         (Parameters::GetSignature): Hook up VerifyArgs here.
29242         (Parameters::VerifyArgs): Verifies that no two arguments have the
29243         same name. 
29244
29245         * class.cs (Operator): Update the operator names to reflect the
29246         ones that the spec expects (as we are just stringizing the
29247         operator names).
29248
29249         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29250         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29251         previous usage did only work for our methods.
29252         (Expression::ConvertImplicit): Handle decimal implicit numeric
29253         conversions as well.
29254         (Expression::InternalTypeConstructor): Used to invoke constructors
29255         on internal types for default promotions.
29256
29257         (Unary::Emit): Implement special handling for the pre/post
29258         increment/decrement for overloaded operators, as they need to have
29259         the same semantics as the other operators.
29260
29261         (Binary::ResolveOperator): ditto.
29262         (Invocation::ConversionExists): ditto.
29263         (UserImplicitCast::Resolve): ditto.
29264
29265 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29266
29267         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29268         operator, return after emitting body. Regression tests pass again !
29269
29270         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29271         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29272         (Invocation::OverloadResolve): Ditto.
29273         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29274
29275         * everywhere : update calls to the above methods accordingly.
29276
29277 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29278
29279         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29280
29281         * expression.cs (ExpressionStatement): New base class used for
29282         expressions that can appear in statements, so that we can provide
29283         an alternate path to generate expression that do not leave a value
29284         on the stack.
29285
29286         (Expression::Emit, and all the derivatives): We no longer return
29287         whether a value is left on the stack or not.  Every expression
29288         after being emitted leaves a single value on the stack.
29289
29290         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29291         facilties of ExpressionStatement if possible.
29292
29293         * cs-parser.jay: Update statement_expression.
29294
29295 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29296
29297         * driver.cs: Change the wording of message
29298
29299 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29300
29301         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29302         the type of the expression to the return type of the method if
29303         we have an overloaded operator match ! The regression tests pass again !
29304         (Unary::ResolveOperator): Ditto.
29305
29306         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29307         to find "op_Implicit", not "implicit" ;-)
29308         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29309         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29310
29311         * everywhere : Correct calls to the above accordingly.
29312
29313         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29314         (ConvertImplicit): Do user-defined conversion if it exists.
29315
29316 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29317
29318         * assign.cs: track location.
29319         (Resolve): Use implicit conversions on assignment.
29320
29321         * literal.cs: Oops.  Not good, Emit of short access values should
29322         pass (Bytes) or the wrong argument will be selected.
29323
29324         * expression.cs (Unary::Emit): Emit code for -expr.
29325
29326         (Unary::ResolveOperator): Handle `Substract' for non-constants
29327         (substract from zero from the non-constants).
29328         Deal with Doubles as well. 
29329
29330         (Expression::ConvertImplicitRequired): New routine that reports an
29331         error if no implicit conversion exists. 
29332
29333         (Invocation::OverloadResolve): Store the converted implicit
29334         expressions if we make them
29335
29336 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29337
29338         * class.cs (ConstructorInitializer): Take a Location argument.
29339         (ConstructorBaseInitializer): Same here.
29340         (ConstructorThisInitializer): Same here.
29341
29342         * cs-parser.jay : Update all calls accordingly.
29343
29344         * expression.cs (Unary, Binary, New): Take location argument.
29345         Update accordingly everywhere.
29346
29347         * cs-parser.jay : Update all calls to the above to take a location
29348         argument.
29349
29350         * class.cs : Ditto.
29351
29352 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29353
29354         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29355         (Invocation::BetterConversion): Same here
29356         (Invocation::ConversionExists): Ditto.
29357
29358         (Invocation::ConversionExists): Implement.
29359
29360 2001-09-22  Ravi Pratap  <ravi@ximian.com>
29361
29362         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29363         Also take an additional TypeContainer argument.
29364
29365         * All over : Pass in TypeContainer as argument to OverloadResolve.
29366
29367         * typemanager.cs (CSharpName): Update to check for the string type and return
29368         that too.
29369
29370         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29371         a given method.
29372
29373 2001-09-21  Ravi Pratap  <ravi@ximian.com>
29374
29375         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29376         (Invocation::BetterFunction): Implement.
29377         (Invocation::BetterConversion): Implement.
29378         (Invocation::ConversionExists): Skeleton, no implementation yet.
29379
29380         Okay, things work fine !
29381
29382 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
29383
29384         * typemanager.cs: declare and load enum_type, delegate_type and
29385         void_type. 
29386
29387         * expression.cs (Expression::Emit): Now emit returns a value that
29388         tells whether a value is left on the stack or not.  This strategy
29389         might be reveted tomorrow with a mechanism that would address
29390         multiple assignments.
29391         (Expression::report118): Utility routine to report mismatches on
29392         the ExprClass.
29393
29394         (Unary::Report23): Report impossible type/operator combination
29395         utility function.
29396
29397         (Unary::IsIncrementableNumber): Whether the type can be
29398         incremented or decremented with add.
29399         (Unary::ResolveOperator): Also allow enumerations to be bitwise
29400         complemented. 
29401         (Unary::ResolveOperator): Implement ++, !, ~,
29402
29403         (Invocation::Emit): Deal with new Emit convetion.
29404
29405         * All Expression derivatives: Updated their Emit method to return
29406         whether they leave values on the stack or not.
29407
29408         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29409         stack for expressions that are statements. 
29410
29411 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29412
29413         * expression.cs (LValue): New interface.  Must be implemented by
29414         LValue objects.
29415         (LocalVariableReference, ParameterReference, FieldExpr): Implement
29416         LValue interface.
29417
29418         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29419         interface for generating code, simplifies the code.
29420
29421 2001-09-20  Ravi Pratap  <ravi@ximian.com>
29422
29423         * expression.cs (everywhere): Comment out return statements in ::Resolve
29424         methods to avoid the warnings.
29425
29426 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29427
29428         * driver.cs (parse): Report error 2001 if we can not open the
29429         source file.
29430
29431         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29432         not resolve it.
29433
29434         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29435         object. 
29436
29437         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29438         otherwise nested blocks end up with the same index.
29439
29440         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29441
29442         * expression.cs:  Instead of having FIXMEs in the Resolve
29443         functions, throw exceptions so it is obvious that we are facing a
29444         bug. 
29445
29446         * cs-parser.jay (invocation_expression): Pass Location information.
29447
29448         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29449         Use a basename for those routines because .NET does not like paths
29450         on them. 
29451
29452         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29453         already defined.
29454
29455 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
29456
29457         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29458         are loading the correct data types (throws an exception if not).
29459         (TypeManager::InitCoreTypes): Use CoreLookupType
29460
29461         * expression.cs (Unary::ResolveOperator): return the child
29462         expression for expressions which are just +expr.
29463         (Unary::ResolveOperator): Return negative literals for -LITERAL
29464         expressions (otherwise they are Unary {Literal}).
29465         (Invocation::Badness): Take into account `Implicit constant
29466         expression conversions'.
29467
29468         * literal.cs (LongLiteral): Implement long literal class.
29469         (IntLiteral): export the `Value' of the intliteral. 
29470
29471 2001-09-19  Ravi Pratap  <ravi@ximian.com>
29472
29473         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29474
29475         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
29476         instead of 'Operator'
29477
29478         * expression.cs (Binary::ResolveOperator): Update accordingly.
29479         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29480         and 'Minus'
29481
29482         * cs-parser.jay (unary_expression): Update to use the new names.
29483
29484         * gen-treedump.cs (GetUnary): Same here.
29485
29486         * expression.cs (Unary::Resolve): Implement.
29487         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
29488         operators are found instead of making noise ;-)
29489         (Unary::ResolveOperator): New method to do precisely the same thing which
29490         Binary::ResolveOperator does for Binary expressions.
29491         (Unary.method, .Arguments): Add.
29492         (Unary::OperName): Implement.   
29493         (Unary::ForceConversion): Copy and Paste !
29494
29495         * class.cs (Operator::Define): Fix a small bug for the case when we have 
29496         a unary operator.
29497
29498         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29499         for the inbuilt operators. Only overloading works for now ;-)
29500
29501 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
29502
29503         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29504         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29505
29506         * expression.cs (This::Emit): Implement. 
29507         (This::Resolve): Implement.
29508         (TypeOf:Resolve): Implement.
29509         (Expression::ResolveSimpleName): Add an implicit this to instance
29510         field references. 
29511         (MemberAccess::Resolve): Deal with Parameters and Fields. 
29512         Bind instance variable to Field expressions.
29513         (FieldExpr::Instance): New field used to track the expression that
29514         represents the object instance.
29515         (FieldExpr::Resolve): Track potential errors from MemberLookup not
29516         binding 
29517         (FieldExpr::Emit): Implement.
29518
29519         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29520         the last instruction contains a return opcode to avoid generating
29521         the last `ret' instruction (this generates correct code, and it is
29522         nice to pass the peverify output).
29523
29524         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29525         initializer for static and instance variables.
29526         (Constructor::Emit): Allow initializer to be null in the case of
29527         static constructors.  Only emit initializer for instance
29528         constructors. 
29529
29530         (TypeContainer::FindMembers): Return a null array if there are no
29531         matches.
29532
29533         Also fix the code for the MemberTypes.Method branch, as it was not
29534         scanning that for operators (or tried to access null variables before).
29535
29536         * assign.cs (Assign::Emit): Handle instance and static fields. 
29537
29538         * TODO: Updated.
29539
29540         * driver.cs: Stop compilation if there are parse errors.
29541
29542         * cs-parser.jay (constructor_declaration): Provide default base
29543         initializer for non-static constructors.
29544         (constructor_declarator): Do not provide a default base
29545         initializers if none was specified.
29546         Catch the fact that constructors should not have parameters.
29547
29548         * class.cs: Do not emit parent class initializers for static
29549         constructors, that should be flagged as an error.
29550
29551 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29552
29553         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29554         Move back code into TypeContainer::Populate.
29555
29556 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29557
29558         * class.cs (TypeContainer::AddConstructor): Fix the check to
29559         compare against Name, not Basename. 
29560         (Operator::OpType): Change Plus and Minus to Add and Subtract.
29561
29562         * cs-parser.jay : Update accordingly.
29563
29564         * class.cs (TypeContainer::FindMembers): For the case where we are searching
29565         for methods, don't forget to look into the operators too.
29566         (RegisterMethodBuilder): Helper method to take care of this for
29567         methods, constructors and operators.
29568         (Operator::Define): Completely revamp.
29569         (Operator.OperatorMethod, MethodName): New fields.
29570         (TypeContainer::Populate): Move the registering of builders into
29571         RegisterMethodBuilder.
29572         (Operator::Emit): Re-write.
29573
29574         * expression.cs (Binary::Emit): Comment out code path to emit method
29575         invocation stuff for the case when we have a user defined operator. I am
29576         just not able to get it right !
29577
29578 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29579
29580         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29581         argument. 
29582
29583         (Expression::MemberLookup): Provide a version that allows to
29584         specify the MemberTypes and BindingFlags. 
29585
29586         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29587         so it was not fetching variable information from outer blocks.
29588
29589         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29590         Beforefieldinit as it was buggy.
29591
29592         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29593         that Ravi put here.  
29594
29595         * class.cs (Constructor::Emit): Only emit if block is not null.
29596         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29597         deal with this by semantically definining it as if the user had
29598         done it.
29599
29600         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29601         constructors as we now "emit" them at a higher level.
29602
29603         (TypeContainer::DefineDefaultConstructor): Used to define the
29604         default constructors if none was provided.
29605
29606         (ConstructorInitializer): Add methods Resolve and Emit. 
29607
29608         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29609
29610 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29611
29612         * class.cs (TypeContainer::EmitDefaultConstructor): Register
29613         the default constructor builder with our hashtable for methodbuilders
29614         to methodcores.
29615
29616         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29617         and argument_count is 0 in which case we have a match.
29618         (Binary::ResolveOperator): More null checking and miscellaneous coding
29619         style cleanup.
29620
29621 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29622
29623         * rootcontext.cs (IsNameSpace): Compare against null.
29624
29625         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29626
29627         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29628         and Unary::Operator.
29629
29630         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29631         accordingly.
29632
29633         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29634         we have overloaded operators.
29635         (Binary::ResolveOperator): Implement the part which does the operator overload
29636         resolution.
29637
29638         * class.cs (Operator::Emit): Implement.
29639         (TypeContainer::Emit): Emit the operators we have too.
29640
29641         * expression.cs (Binary::Emit): Update to emit the appropriate code for
29642         the case when we have a user-defined operator.
29643
29644 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29645
29646         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29647
29648 2001-09-16  Ravi Pratap  <ravi@ximian.com>
29649
29650         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29651         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29652         (Constructor::Emit): Implement.
29653         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29654         if we have no work to do. 
29655         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
29656         Emit method.
29657
29658         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29659         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29660
29661         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29662         of parent.parent.
29663
29664 2001-09-15  Ravi Pratap  <ravi@ximian.com>
29665
29666         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29667         in the source.
29668         (Tree::RecordNamespace): Method to do what the name says ;-)
29669         (Tree::Namespaces): Property to get at the namespaces hashtable.
29670
29671         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
29672         keep track.
29673
29674         * rootcontext.cs (IsNamespace): Fixed it :-)
29675
29676 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29677
29678         * class.cs (TypeContainer::FindMembers): Add support for
29679         constructors. 
29680         (MethodCore): New class that encapsulates both the shared aspects
29681         of a Constructor and a Method.  
29682         (Method, Constructor): Factored pieces into MethodCore.
29683
29684         * driver.cs: Added --fatal which makes errors throw exceptions.
29685         Load System assembly as well as part of the standard library.
29686
29687         * report.cs: Allow throwing exceptions on errors for debugging.
29688
29689         * modifiers.cs: Do not use `parent', instead use the real type
29690         container to evaluate permission settings.
29691
29692         * class.cs: Put Ravi's patch back in.  He is right, and we will
29693         have to cope with the
29694
29695 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29696
29697         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
29698         FamORAssem, not FamANDAssem.
29699
29700 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29701
29702         * driver.cs: Added --parse option that only parses its input files
29703         and terminates.
29704
29705         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
29706         incorrect.  IsTopLevel is not used to tell whether an object is
29707         root_types or not (that can be achieved by testing this ==
29708         root_types).  But to see if this is a top-level *class* (not
29709         necessarly our "toplevel" container). 
29710
29711 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29712
29713         * enum.cs (Enum::Define): Modify to call the Lookup method on the
29714         parent instead of a direct call to GetType.
29715
29716 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29717
29718         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
29719         Modifiers.TypeAttr. This should just be a call to that method.
29720
29721         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
29722         object so that we can determine if we are top-level or not.
29723
29724         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
29725         TypeContainer too.
29726
29727         * enum.cs (Enum::Define): Ditto.
29728
29729         * modifiers.cs (FieldAttr): Re-write.
29730
29731         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
29732         (TypeContainer::HaveStaticConstructor): New property to provide access
29733         to precisely that info.
29734
29735         * modifiers.cs (MethodAttr): Re-write.
29736         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
29737
29738         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
29739         of top-level types as claimed.
29740
29741 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
29742
29743         * expression.cs (MemberLookup): Fruitless attempt to lookup
29744         constructors.  Maybe I need to emit default constructors?  That
29745         might be it (currently .NET emits this for me automatically).
29746         (Invocation::OverloadResolve): Cope with Arguments == null.
29747         (Invocation::EmitArguments): new function, shared by the new
29748         constructor and us.
29749         (Invocation::Emit): Handle static and instance methods.  Emit
29750         proper call instruction for virtual or non-virtual invocations.
29751         (New::Emit): Implement.
29752         (New::Resolve): Implement.
29753         (MemberAccess:Resolve): Implement.
29754         (MethodGroupExpr::InstanceExpression): used conforming to the spec
29755         to track instances.
29756         (FieldExpr::Resolve): Set type.
29757
29758         * support.cs: Handle empty arguments.
29759                 
29760         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
29761         SimpleLookup): Auxiliary routines to help parse a qualifier
29762         identifier.  
29763
29764         Update qualifier_identifier rule.
29765
29766         * codegen.cs: Removed debugging messages.
29767
29768         * class.cs: Make this a global thing, this acts just as a "key" to
29769         objects that we might have around.
29770
29771         (Populate): Only initialize method_builders_to_methods once.
29772
29773         * expression.cs (PropertyExpr): Initialize type from the
29774         PropertyType. 
29775
29776         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
29777         Resolve pattern.  Attempt to implicitly convert value to boolean.
29778         Emit code.
29779
29780         * expression.cs: Set the type for the int32/int32 argument case.
29781         (Binary::ResolveOperator): Set the return type to boolean for
29782         comparission operators
29783
29784         * typemanager.cs: Remove debugging print code.
29785
29786         (Invocation::Resolve): resolve type.
29787
29788         * class.cs: Allocate a MemberInfo of the correct size, as the code
29789         elsewhere depends on the test to reflect the correct contents.
29790
29791         (Method::) Keep track of parameters, due to System.Reflection holes
29792
29793         (TypeContainer::Populate): Keep track of MethodBuilders to Method
29794         mapping here.
29795
29796         (TypeContainer::FindMembers): Use ArrayList and then copy an array
29797         of the exact size and return that.
29798
29799         (Class::LookupMethodByBuilder): New function that maps
29800         MethodBuilders to its methods.  Required to locate the information
29801         on methods because System.Reflection bit us again.
29802
29803         * support.cs: New file, contains an interface ParameterData and
29804         two implementations: ReflectionParameters and InternalParameters
29805         used to access Parameter information.  We will need to grow this
29806         as required.
29807
29808         * expression.cs (Invocation::GetParameterData): implement a cache
29809         and a wrapper around the ParameterData creation for methods. 
29810         (Invocation::OverloadResolve): Use new code.
29811
29812 2001-09-13  Ravi Pratap  <ravi@ximian.com>
29813
29814         * class.cs (TypeContainer::EmitField): Remove and move into 
29815         (Field::Define): here and modify accordingly.
29816         (Field.FieldBuilder): New member.
29817         (TypeContainer::Populate): Update accordingly.
29818         (TypeContainer::FindMembers): Implement.
29819
29820 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
29821
29822         * statement.cs: (VariableInfo::VariableType): New field to be
29823         initialized with the full type once it is resolved. 
29824
29825 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
29826
29827         * parameter.cs (GetParameterInfo): Use a type cache to compute
29828         things only once, and to reuse this information
29829
29830         * expression.cs (LocalVariableReference::Emit): Implement.
29831         (OpcodeCast::Emit): fix.
29832
29833         (ParameterReference::Resolve): Implement.
29834         (ParameterReference::Emit): Implement.
29835
29836         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
29837         that are expressions need to stay as Expressions.
29838
29839         * typemanager.cs (CSharpName): Returns the C# name of a type if
29840         possible. 
29841
29842         * expression.cs (Expression::ConvertImplicit): New function that
29843         implements implicit type conversions.
29844
29845         (Expression::ImplicitReferenceConversion): Implements implicit
29846         reference conversions.
29847
29848         (EmptyCast): New type for transparent casts.
29849
29850         (OpcodeCast): New type for casts of types that are performed with
29851         a sequence of bytecodes.
29852
29853         (BoxedCast): New type used for casting value types into reference
29854         types.  Emits a box opcode.
29855
29856         (Binary::DoNumericPromotions): Implements numeric promotions of
29857         and computation of the Binary::Type.
29858
29859         (Binary::EmitBranchable): Optimization.
29860
29861         (Binary::Emit): Implement code emission for expressions.
29862
29863         * typemanager.cs (TypeManager): Added two new core types: sbyte
29864         and byte.
29865
29866 2001-09-12  Ravi Pratap  <ravi@ximian.com>
29867
29868         * class.cs (TypeContainer::FindMembers): Method which does exactly
29869         what Type.FindMembers does, only we don't have to use reflection. No
29870         implementation yet.
29871
29872         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
29873         typecontainer objects as we need to get at them.
29874         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
29875
29876         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
29877         typecontainer object.
29878
29879         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
29880         of just a Report object.
29881
29882 2001-09-11  Ravi Pratap  <ravi@ximian.com>
29883
29884         * class.cs (Event::Define): Go back to using the prefixes "add_" and
29885         "remove_"
29886         (TypeContainer::Populate): Now define the delegates of the type too.
29887         (TypeContainer.Delegates): Property to access the list of delegates defined
29888         in the type.
29889
29890         * delegates.cs (Delegate::Define): Implement partially.
29891
29892         * modifiers.cs (TypeAttr): Handle more flags.
29893
29894 2001-09-11  Ravi Pratap  <ravi@ximian.com>
29895
29896         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
29897         and not <=
29898         (Operator::Define): Re-write logic to get types by using the LookupType method
29899         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
29900         (Indexer::Define): Ditto.
29901         (Event::Define): Ditto.
29902         (Property::Define): Ditto.
29903
29904 2001-09-10  Ravi Pratap  <ravi@ximian.com>
29905
29906         * class.cs (TypeContainer::Populate): Now define operators too. 
29907         (TypeContainer.Operators): New property to access the list of operators
29908         in a type.
29909         (Operator.OperatorMethodBuilder): New member to hold the method builder
29910         for the operator we are defining.
29911         (Operator::Define): Implement.
29912
29913 2001-09-10  Ravi Pratap  <ravi@ximian.com>
29914
29915         * class.cs (Event::Define): Make the prefixes of the accessor methods
29916         addOn_ and removeOn_ 
29917
29918         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
29919         of the location being passed in too. Ideally, this should go later since all
29920         error reporting should be done through the Report object.
29921
29922         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
29923         (Populate): Iterate thru the indexers we have and define them too.
29924         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
29925         for the get and set accessors.
29926         (Indexer::Define): Implement.
29927
29928 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
29929
29930         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
29931         my previous implementation, did not work.
29932
29933         * typemanager.cs: Add a couple of missing types (the longs).
29934
29935         * literal.cs: Use TypeManager.bool_type instead of getting it.
29936
29937         * expression.cs (EventExpr): New kind of expressions.
29938         (Expressio::ExprClassFromMemberInfo): finish
29939
29940 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
29941
29942         * assign.cs: Emit stores to static fields differently.
29943
29944 2001-09-08  Ravi Pratap  <ravi@ximian.com>
29945
29946         * Merge in changes and adjust code to tackle conflicts. Backed out my
29947         code in Assign::Resolve ;-) 
29948
29949 2001-09-08  Ravi Pratap  <ravi@ximian.com>
29950
29951         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
29952         instead Report.Error and also pass in the location.
29953         (CSharpParser::Lexer): New readonly property to return the reference
29954         to the Tokenizer object.
29955         (declare_local_variables): Use Report.Error with location instead of plain 
29956         old error.
29957         (CheckDef): Ditto.
29958
29959         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
29960         (Operator.CheckBinaryOperator): Ditto.
29961
29962         * cs-parser.jay (operator_declarator): Update accordingly.
29963
29964         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
29965         (CheckBinaryOperator): Same here.
29966
29967         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
29968         on the name without any prefixes of namespace names etc. This is because we
29969         already might have something already fully qualified like 
29970         'System.Console.WriteLine'
29971
29972         * assign.cs (Resolve): Begin implementation. Stuck ;-)
29973
29974 2001-09-07  Ravi Pratap  <ravi@ximian.com>
29975
29976         * cs-tokenizer.cs (location): Return a string which also contains
29977         the file name.
29978
29979         * expression.cs (ElementAccess): New class for expressions of the
29980         type 'element access.'
29981         (BaseAccess): New class for expressions of the type 'base access.'
29982         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
29983         respectively.
29984
29985         * cs-parser.jay (element_access): Implement action.
29986         (base_access): Implement actions.
29987         (checked_expression, unchecked_expression): Implement.
29988
29989         * cs-parser.jay (local_variable_type): Correct and implement.
29990         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
29991
29992         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
29993
29994         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
29995         name and the specifiers.
29996
29997         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
29998
29999         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30000         making them all public ;-)
30001
30002         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30003         class anyways.
30004
30005 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30006
30007         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30008         PropertyExprs.
30009         (FieldExpr, PropertyExprs): New resolved expressions.
30010         (SimpleName::MemberStaticCheck): Perform static checks for access
30011         to non-static fields on static methods. Maybe this should be
30012         generalized for MemberAccesses. 
30013         (SimpleName::ResolveSimpleName): More work on simple name
30014         resolution. 
30015
30016         * cs-parser.jay (primary_expression/qualified_identifier): track
30017         the parameter index.
30018
30019         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30020         (EmitContext::EmitBoolExpression): Chain to expression generation
30021         instead of temporary hack.
30022         (::EmitStatementExpression): Put generic expression code generation.
30023
30024         * assign.cs (Assign::Emit): Implement variable assignments to
30025         local variables, parameters and fields.
30026
30027 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30028
30029         * statement.cs (Block::GetVariableInfo): New method, returns the
30030         VariableInfo for a variable name in a block.
30031         (Block::GetVariableType): Implement in terms of GetVariableInfo
30032
30033         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30034         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30035
30036 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30037
30038         * cs-parser.jay (operator_declaration): Continue on my quest : update
30039         to take attributes argument.
30040         (event_declaration): Ditto.
30041         (enum_declaration): Ditto.
30042         (indexer_declaration): Ditto.
30043
30044         * class.cs (Operator::Operator): Update constructor accordingly.
30045         (Event::Event): Ditto.
30046
30047         * delegate.cs (Delegate::Delegate): Same here.
30048
30049         * enum.cs (Enum::Enum): Same here.
30050
30051 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30052
30053         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30054
30055         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30056
30057         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30058         being passed around as an arraylist.
30059         (Attributes::AddAttribute): Method to add attribute sections.
30060
30061         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30062         (struct_declaration): Update accordingly.
30063         (constant_declaration): Update.
30064         (field_declaration): Update.
30065         (method_header): Update.
30066         (fixed_parameter): Update.
30067         (parameter_array): Ditto.
30068         (property_declaration): Ditto.
30069         (destructor_declaration): Ditto.
30070
30071         * class.cs (Struct::Struct): Update constructors accordingly.
30072         (Class::Class): Ditto.
30073         (Field::Field): Ditto.
30074         (Method::Method): Ditto.
30075         (Property::Property): Ditto.
30076         (TypeContainer::OptAttribute): update property's return type.
30077
30078         * interface.cs (Interface.opt_attributes): New member.
30079         (Interface::Interface): Update to take the extra Attributes argument.
30080
30081         * parameter.cs (Parameter::Parameter): Ditto.
30082
30083         * constant.cs (Constant::Constant): Ditto.
30084
30085         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30086         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30087         the attributes as a parameter.
30088         (InterfaceProperty): Update constructor call.
30089         (InterfaceEvent): Ditto.
30090         (InterfaceMethod): Ditto.
30091         (InterfaceIndexer): Ditto.
30092
30093         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30094         pass the attributes too.
30095         (interface_event_declaration): Ditto.
30096         (interface_property_declaration): Ditto.
30097         (interface_method_declaration): Ditto.
30098         (interface_declaration): Ditto.
30099
30100 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30101
30102         * class.cs (Method::Define): Track the "static Main" definition to
30103         create an entry point. 
30104
30105         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30106         EntryPoint if we find it. 
30107
30108         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30109         (EmitContext::ig): Make this variable public.
30110
30111         * driver.cs: Make the default output file be the first file name
30112         with the .exe extension.  
30113
30114         Detect empty compilations
30115
30116         Handle various kinds of output targets.  Handle --target and
30117         rename -t to --dumper.
30118
30119         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30120         methods inherited from Expression return now an Expression.  This
30121         will is used during the tree rewriting as we resolve them during
30122         semantic analysis.
30123
30124         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30125         the spec.  Missing entirely is the information about
30126         accessability of elements of it.
30127
30128         (Expression::ExprClassFromMemberInfo): New constructor for
30129         Expressions that creates a fully initialized Expression based on
30130         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30131         a Type.
30132
30133         (Invocation::Resolve): Begin implementing resolution of invocations.
30134
30135         * literal.cs (StringLiteral):  Implement Emit.
30136
30137 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30138
30139         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30140         member.
30141
30142 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30143
30144         * cs-parser.jay (attribute_arguments): Implement actions.
30145         (attribute): Fix bug in production. Implement action.
30146         (attribute_list): Implement.
30147         (attribute_target): Implement.
30148         (attribute_target_specifier, opt_target_specifier): Implement
30149         (CheckAttributeTarget): New method to check if the attribute target
30150         is valid.
30151         (attribute_section): Implement.
30152         (opt_attributes): Implement.
30153
30154         * attribute.cs : New file to handle attributes.
30155         (Attribute): Class to hold attribute info.
30156
30157         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30158         (attribute_section): Modify production to use 2 different rules to 
30159         achieve the same thing. 1 s/r conflict down !
30160         Clean out commented, useless, non-reducing dimension_separator rules.
30161
30162         * class.cs (TypeContainer.attributes): New member to hold list
30163         of attributes for a type.
30164         (Struct::Struct): Modify to take one more argument, the attribute list.
30165         (Class::Class): Ditto.
30166         (Field::Field): Ditto.
30167         (Method::Method): Ditto.
30168         (Property::Property): Ditto.
30169
30170         * cs-parser.jay (struct_declaration): Update constructor call to
30171         pass in the attributes too.
30172         (class_declaration): Ditto.
30173         (constant_declaration): Ditto.
30174         (field_declaration): Ditto.
30175         (method_header): Ditto.
30176         (fixed_parameter): Ditto.
30177         (parameter_array): Ditto.
30178         (property_declaration): Ditto.
30179
30180         * constant.cs (Constant::Constant): Update constructor similarly.
30181         Use System.Collections.
30182
30183         * parameter.cs (Parameter::Parameter): Update as above.
30184
30185 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30186
30187         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30188         (TypeContainer.delegates): New member to hold list of delegates.
30189
30190         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30191         this time as I seem to be on crack ;-)
30192
30193 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30194
30195         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30196         tell whether an identifier represents a namespace.
30197
30198         * expression.cs (NamespaceExpr): A namespace expression, used only
30199         temporarly during expression resolution.
30200         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30201         utility functions to resolve names on expressions.
30202
30203 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30204
30205         * codegen.cs: Add hook for StatementExpressions. 
30206
30207         * class.cs: Fix inverted test for static flag in methods.
30208
30209 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30210
30211         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30212         to make it coincide with MS' number.
30213         (Operator::CheckBinaryOperator): Ditto.
30214
30215         * ../errors/errors.txt : Remove error numbers added earlier.
30216
30217         * ../errors/cs1019.cs : Test case for error # 1019
30218
30219         * ../errros/cs1020.cs : Test case for error # 1020
30220
30221         * cs-parser.jay : Clean out commented cruft.
30222         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30223         used anywhere - non-reducing rule.
30224         (namespace_declarations): Non-reducing rule - comment out.
30225
30226         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30227         with TypeContainer::AddEnum.
30228
30229         * delegate.cs : New file for delegate handling classes.
30230         (Delegate): Class for declaring delegates.
30231
30232         * makefile : Update.
30233
30234         * cs-parser.jay (delegate_declaration): Implement.
30235
30236 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30237
30238         * class.cs (Event::Define): Implement.
30239         (Event.EventBuilder): New member.
30240
30241         * class.cs (TypeContainer::Populate): Update to define all enums and events
30242         we have.
30243         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30244         readonly fields for all these cases ?
30245
30246 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30247
30248         * class.cs (Property): Revamp to use the convention of making fields readonly.
30249         Accordingly modify code elsewhere.
30250
30251         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30252         the Define method of the Property class.
30253
30254         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30255         trivial bug.
30256         (TypeContainer::Populate): Update to define all the properties we have. Also
30257         define all enumerations.
30258
30259         * enum.cs (Define): Implement.
30260
30261 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30262
30263         * cs-parser.jay (overloadable_operator): The semantic value is an
30264         enum of the Operator class.
30265         (operator_declarator): Implement actions.
30266         (operator_declaration): Implement.
30267
30268         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30269         validity of definitions.
30270         (Operator::CheckBinaryOperator): Static method to check for binary operators
30271         (TypeContainer::AddOperator): New method to add an operator to a type.
30272
30273         * cs-parser.jay (indexer_declaration): Added line to actually call the
30274         AddIndexer method so it gets added ;-)
30275
30276         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30277         already taken care of by the MS compiler ?  
30278
30279 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30280
30281         * class.cs (Operator): New class for operator declarations.
30282         (Operator::OpType): Enum for the various operators.
30283
30284 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30285
30286         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30287         ostensibly handle this in semantic analysis.
30288
30289         * cs-parser.jay (general_catch_clause): Comment out
30290         (specific_catch_clauses, specific_catch_clause): Ditto.
30291         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30292         (catch_args, opt_catch_args): New productions.
30293         (catch_clause): Rewrite to use the new productions above
30294         (catch_clauses): Modify accordingly.
30295         (opt_catch_clauses): New production to use in try_statement
30296         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30297         and re-write the code in the actions to extract the specific and
30298         general catch clauses by being a little smart ;-)
30299
30300         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30301         Hooray, try and catch statements parse fine !
30302
30303 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30304
30305         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30306         string from the hashtable of variables.
30307
30308         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30309         I end up making that mistake ;-)
30310         (catch_clauses): Fixed gross error which made Key and Value of the 
30311         DictionaryEntry the same : $1 !!
30312
30313 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30314
30315         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30316
30317         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30318         when the add and remove accessors are specified. 
30319
30320 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30321
30322         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30323         information about indexer_declarator.
30324         (indexer_declarator): Implement actions.
30325         (parsing_indexer): New local boolean used to keep track of whether
30326         we are parsing indexers or properties. This is necessary because 
30327         implicit_parameters come into picture even for the get accessor in the 
30328         case of an indexer.
30329         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30330
30331         * class.cs (Indexer): New class for indexer declarations.
30332         (TypeContainer::AddIndexer): New method to add an indexer to a type.
30333         (TypeContainer::indexers): New member to hold list of indexers for the
30334         type.
30335
30336 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30337
30338         * cs-parser.jay (add_accessor_declaration): Implement action.
30339         (remove_accessor_declaration): Implement action.
30340         (event_accessors_declaration): Implement
30341         (variable_declarators): swap statements for first rule - trivial.
30342
30343         * class.cs (Event): New class to hold information about event
30344         declarations.
30345         (TypeContainer::AddEvent): New method to add an event to a type
30346         (TypeContainer::events): New member to hold list of events.
30347
30348         * cs-parser.jay (event_declaration): Implement actions.
30349
30350 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30351
30352         * cs-parser.jay (dim_separators): Implement. Make it a string
30353         concatenating all the commas together, just as they appear.
30354         (opt_dim_separators): Modify accordingly
30355         (rank_specifiers): Update accordingly. Basically do the same
30356         thing - instead, collect the brackets here.
30357         (opt_rank_sepcifiers): Modify accordingly.
30358         (array_type): Modify to actually return the complete type string
30359         instead of ignoring the rank_specifiers.
30360         (expression_list): Implement to collect the expressions
30361         (variable_initializer): Implement. We make it a list of expressions
30362         essentially so that we can handle the array_initializer case neatly too.
30363         (variable_initializer_list): Implement.
30364         (array_initializer): Make it a list of variable_initializers
30365         (opt_array_initializer): Modify accordingly.
30366
30367         * expression.cs (New::NType): Add enumeration to help us
30368         keep track of whether we have an object/delegate creation
30369         or an array creation.
30370         (New:NewType, New::Rank, New::Indices, New::Initializers): New
30371         members to hold data about array creation.
30372         (New:New): Modify to update NewType
30373         (New:New): New Overloaded contructor for the array creation
30374         case.
30375
30376         * cs-parser.jay (array_creation_expression): Implement to call
30377         the overloaded New constructor.
30378
30379 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
30380
30381         * class.cs (TypeContainer::Constructors): Return member
30382         constructors instead of returning null.
30383
30384 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
30385
30386         * typemanager.cs (InitCoreTypes): Initialize the various core
30387         types after we have populated the type manager with the user
30388         defined types (this distinction will be important later while
30389         compiling corlib.dll)
30390
30391         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30392         on Expression Classification.  Now all expressions have a method
30393         `Resolve' and a method `Emit'.
30394
30395         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30396         generation from working.     Also add some temporary debugging
30397         code. 
30398
30399 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
30400
30401         * codegen.cs: Lots of code generation pieces.  This is only the
30402         beginning, will continue tomorrow with more touches of polish.  We
30403         handle the fundamentals of if, while, do, for, return.  Others are
30404         trickier and I need to start working on invocations soon.
30405
30406         * gen-treedump.cs: Bug fix, use s.Increment here instead of
30407         s.InitStatement. 
30408
30409         * codegen.cs (EmitContext): New struct, used during code
30410         emission to keep a context.   Most of the code generation will be
30411         here. 
30412
30413         * cs-parser.jay: Add embedded blocks to the list of statements of
30414         this block.  So code generation proceeds in a top down fashion.
30415
30416 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
30417
30418         * statement.cs: Add support for multiple child blocks.
30419
30420 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
30421
30422         * codegen.cs (EmitCode): New function, will emit the code for a
30423         Block of code given a TypeContainer and its ILGenerator. 
30424
30425         * statement.cs (Block): Standard public readonly optimization.
30426         (Block::Block constructors): Link children. 
30427         (Block::Child): Child Linker.
30428         (Block::EmitVariables): Emits IL variable declarations.
30429
30430         * class.cs: Drop support for MethodGroups here, delay until
30431         Semantic Analysis.
30432         (Method::): Applied the same simplification that I did before, and
30433         move from Properties to public readonly fields.
30434         (Method::ParameterTypes): Returns the parameter types for the
30435         function, and implements a cache that will be useful later when I
30436         do error checking and the semantic analysis on the methods is
30437         performed.
30438         (Constructor::GetCallingConvention): Renamed from CallingConvetion
30439         and made a method, optional argument tells whether this is a class
30440         or a structure to apply the `has-this' bit.
30441         (Method::GetCallingConvention): Implement, returns the calling
30442         convention. 
30443         (Method::Define): Defines the type, a second pass is performed
30444         later to populate the methods.
30445
30446         (Constructor::ParameterTypes): implement a cache similar to the
30447         one on Method::ParameterTypes, useful later when we do semantic
30448         analysis. 
30449
30450         (TypeContainer::EmitMethod):  New method.  Emits methods.
30451
30452         * expression.cs: Removed MethodGroup class from here.
30453
30454         * parameter.cs (Parameters::GetCallingConvention): new method.
30455
30456 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
30457
30458         * class.cs (TypeContainer::Populate): Drop RootContext from the
30459         argument. 
30460
30461         (Constructor::CallingConvention): Returns the calling convention.
30462         (Constructor::ParameterTypes): Returns the constructor parameter
30463         types. 
30464
30465         (TypeContainer::AddConstructor): Keep track of default constructor
30466         and the default static constructor.
30467
30468         (Constructor::) Another class that starts using `public readonly'
30469         instead of properties. 
30470
30471         (Constructor::IsDefault): Whether this is a default constructor. 
30472
30473         (Field::) use readonly public fields instead of properties also.
30474
30475         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30476         track of static constructors;  If none is used, turn on
30477         BeforeFieldInit in the TypeAttributes. 
30478
30479         * cs-parser.jay (opt_argument_list): now the return can be null
30480         for the cases where there are no arguments. 
30481
30482         (constructor_declarator): If there is no implicit `base' or
30483         `this', then invoke the default parent constructor. 
30484
30485         * modifiers.cs (MethodAttr): New static function maps a set of
30486         modifiers flags into a MethodAttributes enum
30487         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
30488         MethodAttr, TypeAttr to represent the various mappings where the
30489         modifiers are used.
30490         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
30491
30492 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
30493
30494         * parameter.cs (GetParameterInfo): Fix bug where there would be no
30495         method arguments.
30496
30497         * interface.cs (PopulateIndexer): Implemented the code generator
30498         for interface indexers.
30499
30500 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
30501
30502         * interface.cs (InterfaceMemberBase): Now we track the new status
30503         here.  
30504
30505         (PopulateProperty): Implement property population.  Woohoo!  Got
30506         Methods and Properties going today. 
30507
30508         Removed all the properties for interfaces, and replaced them with
30509         `public readonly' fields. 
30510
30511 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
30512
30513         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30514         initialize their hashtables/arraylists only when they are needed
30515         instead of doing this always.
30516
30517         * parameter.cs: Handle refs and out parameters.
30518
30519         * cs-parser.jay: Use an ArrayList to construct the arguments
30520         instead of the ParameterCollection, and then cast that to a
30521         Parameter[] array.
30522
30523         * parameter.cs: Drop the use of ParameterCollection and use
30524         instead arrays of Parameters.
30525
30526         (GetParameterInfo): Use the Type, not the Name when resolving
30527         types. 
30528
30529 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
30530
30531         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30532         and instead use public readonly fields.
30533
30534         * class.cs: Put back walking code for type containers.
30535
30536 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
30537
30538         * class.cs (MakeConstant): Code to define constants.
30539
30540         * rootcontext.cs (LookupType): New function.  Used to locate types 
30541
30542
30543 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
30544
30545         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
30546         this System.Reflection code is.  Kudos to Microsoft
30547
30548         * typemanager.cs: Implement a type cache and avoid loading all
30549         types at boot time.  Wrap in LookupType the internals.  This made
30550         the compiler so much faster.  Wow.  I rule!
30551
30552         * driver.cs: Make sure we always load mscorlib first (for
30553         debugging purposes, nothing really important).
30554
30555         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
30556         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
30557
30558         * rootcontext.cs: Lookup types on their namespace;  Lookup types
30559         on namespaces that have been imported using the `using' keyword.
30560
30561         * class.cs (TypeContainer::TypeAttr): Virtualize.
30562         (Class::TypeAttr): Return attributes suitable for this bad boy.
30563         (Struct::TypeAttr): ditto.
30564         Handle nested classes.
30565         (TypeContainer::) Remove all the type visiting code, it is now
30566         replaced with the rootcontext.cs code
30567
30568         * rootcontext.cs (GetClassBases): Added support for structs. 
30569
30570 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
30571
30572         * interface.cs, statement.cs, class.cs, parameter.cs,
30573         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30574         Drop use of TypeRefs, and use strings instead.
30575
30576 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
30577
30578         * rootcontext.cs: 
30579
30580         * class.cs (Struct::Struct): set the SEALED flags after
30581         checking the modifiers.
30582         (TypeContainer::TypeAttr): new property, returns the
30583         TypeAttributes for a class.  
30584
30585         * cs-parser.jay (type_list): Oops, list production was creating a
30586         new list of base types.
30587
30588         * rootcontext.cs (StdLib): New property.
30589         (GetInterfaceTypeByName): returns an interface by type name, and
30590         encapsulates error handling here.
30591         (GetInterfaces): simplified.
30592         (ResolveTree): Encapsulated all the tree resolution here.
30593         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30594         types. 
30595
30596         * driver.cs: Add support for --nostdlib, to avoid loading the
30597         default assemblies.
30598         (Main): Do not put tree resolution here. 
30599
30600         * rootcontext.cs: Beginning of the class resolution.
30601
30602 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
30603
30604         * rootcontext.cs: Provide better error reporting. 
30605
30606         * cs-parser.jay (interface_base): set our $$ to be interfaces.
30607
30608         * rootcontext.cs (CreateInterface): Handle the case where there
30609         are no parent interfaces.
30610
30611         (CloseTypes): Routine to flush types at the end.
30612         (CreateInterface): Track types.
30613         (GetInterfaces): Returns an array of Types from the list of
30614         defined interfaces.
30615
30616         * typemanager.c (AddUserType): Mechanism to track user types (puts
30617         the type on the global type hash, and allows us to close it at the
30618         end). 
30619
30620 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
30621
30622         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30623         RecordInterface instead.
30624
30625         * cs-parser.jay: Updated to reflect changes above.
30626
30627         * decl.cs (Definition): Keep track of the TypeBuilder type that
30628         represents this type here.  Not sure we will use it in the long
30629         run, but wont hurt for now.
30630
30631         * driver.cs: Smaller changes to accomodate the new code.
30632
30633         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30634         when done. 
30635
30636         * rootcontext.cs (CreateInterface):  New method, used to create
30637         the System.TypeBuilder type for interfaces.
30638         (ResolveInterfaces): new entry point to resolve the interface
30639         hierarchy. 
30640         (CodeGen): Property, used to keep track of the code generator.
30641
30642 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
30643
30644         * cs-parser.jay: Add a second production for delegate_declaration
30645         with `VOID'.
30646
30647         (enum_body): Put an opt_comma here instead of putting it on
30648         enum_body or enum_member_declarations so we can handle trailing
30649         commas on enumeration members.  Gets rid of a shift/reduce.
30650
30651         (type_list): Need a COMMA in the middle.
30652
30653         (indexer_declaration): Tell tokenizer to recognize get/set
30654
30655         * Remove old targets.
30656
30657         * Re-add the parser target.
30658
30659 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30660
30661         * cs-parser.jay: Add precendence rules for a number of operators
30662         ot reduce the number of shift/reduce conflicts in the grammar.
30663
30664 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
30665
30666         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30667         and put it here.
30668
30669         Get rid of old crufty code.
30670
30671         * rootcontext.cs: Use this to keep track of the parsed
30672         representation and the defined types available to the program. 
30673
30674         * gen-treedump.cs: adjust for new convention.
30675
30676         * type.cs: Split out the type manager, and the assembly builder
30677         from here. 
30678
30679         * typemanager.cs: the type manager will live here now.
30680
30681         * cil-codegen.cs: And the code generator here. 
30682
30683 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
30684
30685         * makefile: Fixed up for easy making.
30686
30687 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30688
30689         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
30690         the 
30691
30692         (unary_expression): Expand pre_increment_expression and
30693         post_decrement_expression to reduce a shift/reduce.
30694
30695 2001-07-11  Simon Cozens
30696
30697         * cs-tokenizer.cs: Hex numbers should begin with a 0.
30698
30699         Improve allow_keyword_as_indent name.
30700
30701 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
30702
30703         * Adjustments for Beta2. 
30704
30705 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
30706
30707         * decl.cs: Added `Define' abstract method.
30708         (InTransit): new property, used to catch recursive definitions. 
30709
30710         * interface.cs: Implement `Define'. 
30711
30712         * modifiers.cs: Map Modifiers.constants to
30713         System.Reflection.TypeAttribute flags.
30714
30715         * class.cs: Keep track of types and user-defined types.
30716         (BuilderInit): New method for creating an assembly
30717         (ResolveType): New function to launch the resolution process, only
30718         used by interfaces for now.
30719
30720         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
30721         that are inserted into the name space. 
30722
30723 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
30724
30725         * ARGH.  I have screwed up my tree so many times due to the use of
30726         rsync rather than using CVS.  Going to fix this at once. 
30727
30728         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
30729         load types.
30730
30731 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
30732
30733         * Experiment successful: Use System.Type rather that our own
30734         version of Type.  
30735
30736 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
30737
30738         * cs-parser.jay: Removed nsAliases from here.
30739
30740         Use new namespaces, handle `using XXX;' 
30741
30742         * namespace.cs: Reimplemented namespace handling, use a recursive
30743         definition of the class.  Now we can keep track of using clauses
30744         and catch invalid using clauses.
30745
30746 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
30747
30748         * gen-treedump.cs: Adapted for all the renaming.
30749
30750         * expression.cs (Expression): this class now has a Type property
30751         which returns an expression Type.
30752
30753         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
30754         `Type', as this has a different meaning now in the base
30755
30756 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
30757
30758         * interface.cs, class.cs: Removed from all the sources the
30759         references to signature computation, as we can not do method
30760         signature computation during the parsing time, as we are not
30761         trying to solve at that point distinguishing:
30762
30763         class X {
30764                 void a (Blah x) {}
30765                 void a (NS.Blah x) {}
30766         }
30767
30768         Which depending on the context might be valid or not, as we do not
30769         know if Blah is the same thing as NS.Blah at that point.
30770
30771         * Redid everything so the code uses TypeRefs now instead of
30772         Types.  TypeRefs are just temporary type placeholders, that need
30773         to be resolved.  They initially have a pointer to a string and the
30774         current scope in which they are used.  This is used later by the
30775         compiler to resolve the reference to an actual Type. 
30776
30777         * DeclSpace is no longer a CIR.Type, and neither are
30778         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
30779         are all DeclSpaces, but no Types. 
30780
30781         * type.cs (TypeRefManager): This implements the TypeRef manager,
30782         which keeps track of all the types that need to be resolved after
30783         the parsing has finished. 
30784
30785 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
30786
30787         * ARGH.  We are going to have to store `foreach' as a class rather
30788         than resolving it, as we need to verify error 1579 after name
30789         resolution.   *OR* we could keep a flag that says `This request to
30790         IEnumerator comes from a foreach statement' which we can then use
30791         to generate the error.
30792
30793 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
30794
30795         * class.cs (TypeContainer.AddMethod): we now add methods to the
30796         MethodGroup instead of the method hashtable.  
30797
30798         * expression.cs: Add MethodGroup abstraction, which gets us one
30799         step closer to the specification in the way we handle method
30800         declarations.  
30801
30802         * cs-parser.jay (primary_expression): qualified_identifier now
30803         tried to match up an identifier to a local variable reference or
30804         to a parameter reference.
30805
30806         current_local_parameters is now a parser global variable that
30807         points to the current parameters for the block, used during name
30808         lookup.
30809
30810         (property_declaration): Now creates an implicit `value' argument to
30811         the set accessor.
30812
30813 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
30814
30815         * parameter.cs: Do not use `param' arguments as part of the
30816         signature, per the spec.
30817
30818 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
30819
30820         * decl.cs: Base class for classes, structs and interfaces.  This
30821         is the "Declaration Space" 
30822
30823         * cs-parser.jay: Use CheckDef for checking declaration errors
30824         instead of having one on each function.
30825
30826         * class.cs: Factor out some code for handling error handling in
30827         accordance to the "Declarations" section in the "Basic Concepts"
30828         chapter in the ECMA C# spec.
30829
30830         * interface.cs: Make all interface member classes derive from
30831         InterfaceMemberBase.
30832
30833 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
30834
30835         * Many things: all interfaces are parsed and generated in
30836         gen-treedump.  Support for member variables, constructors,
30837         destructors, properties, constants is there.
30838
30839         Beginning of the IL backend, but very little done, just there for
30840         testing purposes. 
30841
30842 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
30843
30844         * cs-parser.jay: Fix labeled statement.
30845
30846         * cs-tokenizer.cs (escape): Escape " and ' always.
30847         ref_line, ref_name: keep track of the line/filename as instructed
30848         by #line by the compiler.
30849         Parse #line.
30850
30851 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
30852
30853         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
30854         to match the values in System.CodeDOM.
30855
30856         Divid renamed to Divide.
30857
30858         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
30859         statements. 
30860         (Statements.set): remove.
30861
30862         * System.CodeDOM/CodeCatchClause.cs: always have a valid
30863         statements. 
30864
30865         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
30866         falseStatements always have valid values. 
30867
30868         * cs-parser.jay: Use System.CodeDOM now.
30869