afc19562ab2a98c8e9619072cea7157009dc4193
[mono.git] / mcs / mcs / ChangeLog
1 2008-09-15  Miguel de Icaza  <miguel@novell.com>
2
3         * namespace.cs: Do not report CS0246 (name
4
5 2008-09-12  Marek Safar  <marek.safar@gmail.com>
6
7         A fix for bug #425669
8         * generic.cs: Don't cache generic static anonymous method 
9         containers.
10
11 2008-09-12  Marek Safar  <marek.safar@gmail.com>
12
13         * generic.cs, class.cs, delegate.cs: Check recursive inherited
14         conflicting constraints.
15
16 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
17
18         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
19         mcs too.
20
21 2008-09-12  Marek Safar  <marek.safar@gmail.com>
22
23         * literal.cs, convert.cs, expression.cs, statement.cs: More null
24         to null pointer conversion fixes.
25
26 2008-09-11  Marek Safar  <marek.safar@gmail.com>
27
28         * cs-parser.jay, expression.cs: An implicitly typed local variable
29         declarator cannot use an array initializer.
30
31 2008-09-11  Marek Safar  <marek.safar@gmail.com>
32
33         * cs-parser.jay: Reduced number of printed tokens, add sorting.
34
35 2008-09-11  Marek Safar  <marek.safar@gmail.com>
36
37         * generic.cs (InflatedConstraints): Don't crash when constraints
38         are different.
39         
40         * cs-parser.jay: const_declarator is a block.
41
42         * constant.cs: Check for not allowed NaN conversions.
43
44 2008-09-10  Miguel de Icaza  <miguel@novell.com>
45
46         * driver.cs: Drop --shell argument, the compiler is no longer a
47         REPL. 
48
49         * eval.cs: Move most of the code that deals with evaluation into
50         this file and document the public API from repl.cs
51
52         * repl.cs: Remove from here.
53         
54 2008-09-10  Marek Safar  <marek.safar@gmail.com>
55
56         A fix for bug #424684
57         * generic.cs: Generic class constraints must come first.
58
59 2008-09-09  Miguel de Icaza  <miguel@novell.com>
60
61         * cs-parser.jay: Improve error reporting for syntax errors in
62         statements and expressions, we now report the expected tokens
63         instead of reporting the useless "; expected".
64
65         Drop the strings from the token declaration, it turns out that
66         they did not do what I thought they did.  Instead they were adding
67         two sets of tokens to the tables.
68
69 2008-09-09  Marek Safar  <marek.safar@gmail.com>
70
71         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
72         delegate.cs: Share special type check.
73
74 2008-09-09  Marek Safar  <marek.safar@gmail.com>
75
76         A fix for bug #423981
77         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
78
79 2008-09-09  Marek Safar  <marek.safar@gmail.com>
80
81         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
82         ConvertImplicitly.
83
84 2008-09-09  Marek Safar  <marek.safar@gmail.com>
85
86         A fix for bugs: #324750, #335946
87         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
88         lookup rule to determine ?-based tokens.
89
90 2008-09-08  Miguel de Icaza  <miguel@novell.com>
91
92         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
93         expressions (like event adding or removing) end up here, so we
94         need to treat those as statements.
95
96         Add LoadAssembly method.
97
98 2008-09-04  Miguel de Icaza  <miguel@novell.com>
99
100         * repl.cs: Add Time method.
101
102 2008-09-05  Marek Safar  <marek.safar@gmail.com>
103
104         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
105
106 2008-09-05  Miguel de Icaza  <miguel@novell.com>
107
108         * repl.cs: Add workaround for old compilers.
109
110 2008-09-04  Jb Evain  <jbevain@novell.com>
111
112         * repl.cs (PrettyPrint): pretty print everything that
113         implements IDictionary, as well as IEnumerables. Also,
114         add a quit helper property.
115
116 2008-09-04  Marek Safar  <marek.safar@gmail.com>
117
118         * constant.cs: Better error reporting for decimal literals.
119         
120         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
121         field attributes.
122         
123 2008-09-04  Marek Safar  <marek.safar@gmail.com>
124                         Miguel de Icaza  <miguel@novell.com>
125
126         A fix for bug #422951
127         * assign.cs (Assign.DoResolve): Perform the type conversions
128         checks before we attempt to initialize `New' initializers. 
129
130 2008-09-04  Marek Safar  <marek.safar@gmail.com>
131
132         A fix for bug #422853
133         * delegate.cs (DelegateCreation): Add special handling for
134         EmptyExpression.Null instance expression which is just another
135         hack for undecided member instance exression.
136
137 2008-09-04  Marek Safar  <marek.safar@gmail.com>
138
139         * expression.cs, ecore.cs: Emit full expression tree for reduced
140         binary expressions.
141
142 2008-09-04  Marek Safar  <marek.safar@gmail.com>
143
144         * expression.cs (This): Guard against multi-resolving.
145         
146         * ecore.cs, statement.cs (Throw): Simplified.
147         
148         * flowanalysis.cs: Also verify event fields.
149
150 2008-09-04  Miguel de Icaza  <miguel@novell.com>
151
152         * assign.cs (Assign.DoResolve): Perform the type conversions
153         checks before we attempt to initialize `New' initializers. 
154
155         * repl.cs (PrettyPrint): Add Hashtable prettyprint
156
157         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
158         public. 
159
160         * repl.cs: Update help.
161
162 2008-09-03  Miguel de Icaza  <miguel@novell.com>
163
164         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
165         handling of the default config handling, including the special
166         treatment of System.Core assembly. 
167
168         Fixes the REPL processing for LINQ.
169
170 2008-09-03  Marek Safar  <marek.safar@gmail.com>
171
172         A fix for bug #422507
173         * expression.cs (UnboxCast): Add missing child expression mutator.
174
175 2008-09-03  Marek Safar  <marek.safar@gmail.com>
176
177         * driver.cs: Don't self reference System.Core assembly.
178
179 2008-09-03  Marek Safar  <marek.safar@gmail.com>
180
181         A fix for bug #422507
182         * expression.cs (StringConcat): Add missing type mutator.
183
184 2008-09-03  Marek Safar  <marek.safar@gmail.com>
185
186         * generic.cs (TypeInferenceContext): Follow equality rule for
187         constructed type lower bound type inference.
188
189 2008-09-02  Miguel de Icaza  <miguel@novell.com>
190
191         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
192         <dblank@cs.brynmawr.edu> which updates the cursor position on
193         refresh.
194         
195 2008-09-02  Marek Safar  <marek.safar@gmail.com>
196
197         A fix for bug #367145
198         * driver.cs: Fixed import of extension methods when using -noconfig
199         option.
200
201 2008-09-02  Marek Safar  <marek.safar@gmail.com>
202
203         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
204         version from non-generic implementation instead.
205
206 2008-09-01  Marek Safar  <marek.safar@gmail.com>
207
208         A fix for bug #418908
209         * class.cs: Use AddScopeStatement for field initializers.
210
211 2008-09-01  Marek Safar  <marek.safar@gmail.com>
212
213         A fix for bug #415385
214         * ecore.cs, convert.cs: Do method group conversion for equal group types.
215
216 2008-09-01  Marek Safar  <marek.safar@gmail.com>
217
218         A fix for bug #421736
219         * iterators.cs: Don't crash on unreachable iterators.
220
221 2008-09-01  Marek Safar  <marek.safar@gmail.com>
222
223         A fix for bug #421628
224         * parameter.cs, attribute.cs: Clone also parameter attributes.
225
226 2008-08-30  Miguel de Icaza  <miguel@novell.com>
227
228         * namespace.cs (LookupType): In EvalMode, try to replace
229         the TypeBuilder from our cache with a Type as Reflection.Emit does
230         not  like to mix code from older assemblies emitted and new
231         assemblies emitted. 
232
233         This sounds like a serious Mono bug that prevents multiple
234         assemblies to be generated and consumed at the same time.
235
236         * cs-parser.jay (push_current_class): Do not make interactive
237         classes internal or private, make them public as we currently
238         generate each new class in a new assembly.   
239
240 2008-08-29  Miguel de Icaza  <miguel@novell.com>
241
242         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
243         remove types that are entered into the global namespace during
244         parsing so that we can remove them on failure.
245  
246         * cs-parser.jay: Parsing: we now keep track of types that are
247         entered into global variables and queue those in case the parsing
248         or resolution fail.
249  
250         This happens in a few situations: during partial-input, we invoke
251         the parser repeatedly for example with the string "class X", this
252         would cause X to be registed, and we need to remove this
253         registration so that another parse attempt later with say "class X {"
254         would actually work.
255  
256         Additionally, if there is an error in the resolution phase, for
257         example: "class X : NonExistant {}" th
258         
259         * cs-parser.jay: Be more precise with the errors being raised,
260         instead of flagging all exceptions during parsing to be attributed
261         to the parsing process, distinguish those from errors happening in
262         the actions and hint that using -v would produce the actual
263         exception. 
264
265         * repl.cs: Do not load all compiler references on each reset,
266         doing the partial reset takes care of this.
267         
268 2008-08-28  Miguel de Icaza  <miguel@novell.com>
269
270         * repl.cs: Add support for loading all the files from
271         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
272         as shell libraries.
273
274         Introduce a micro-parser that is able to deambiguate on its input
275         whether we are dealing with a compilation unit (namespace, class,
276         interface, struct, delegate) declaration or a statement.   This
277         allows both declarations and statements to be entered. 
278
279         Set history size by default to 300 lines.
280
281         Instead of distinguishing based on the parser.InteractiveResult,
282         have only two cases: statements were parsed, or a compilation unit
283         was.   Always pull the Using statement additions from the
284         compilation unit parse.
285         
286         * cs-tokenizer.cs: Rename tokens to better describe their intent
287         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
288         
289         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
290         EvalMode is used to trigger the lookup of global variables while
291         StatementMode is used turn variable declarations into static
292         fields.
293
294         * getline.cs: Allow history size to be set.
295         
296 2008-08-29  Marek Safar  <marek.safar@gmail.com>
297
298         A fix for bug #360755
299         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
300
301 2008-08-29  Marek Safar  <marek.safar@gmail.com>
302
303         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
304         
305         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
306         member name, it is too confusing
307         
308         * decl.cs, class.cs: Don't report unused fields with attached attribute.
309         
310         * rootcontext.cs: Finally default to warning level 4.
311
312 2008-08-28  Marek Safar  <marek.safar@gmail.com>
313
314         * class.cs (CheckBase): Ignore overloaded operators.
315
316 2008-08-28  Marek Safar  <marek.safar@gmail.com>
317
318         A fix for bug #420830
319         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
320
321 2008-08-28  Marek Safar  <marek.safar@gmail.com>
322
323         A fix for bug #420832
324         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
325
326 2008-08-28  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #420386
329         * nullables.cs: Fixed logic of nullable user comparison operators involving
330         null values.
331
332 2008-08-28  Marek Safar  <marek.safar@gmail.com>
333         
334         * attribute (IsClsCompliant): Use FALSE value for pointer types.
335
336 2008-08-27  Miguel de Icaza  <miguel@novell.com>
337
338         * repl.cs: Add support for aborting the running code with C-c. 
339
340 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
341
342         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
343
344 2008-08-27  Miguel de Icaza  <miguel@novell.com>
345
346         * cs-parser.jay (interactive_statement_list): A new set of rules
347         for hosting statements that uses the "interactive_" prefix.   
348
349         * repl.cs: Add support for parsing `using' as a statement or as a
350         directive.  Deambiguating before passing this to the parser.
351
352         We need to distinguish statement_expressions that occur at the
353         toplevel vs those that occur embedded into expressions.
354
355         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
356         that fixes the cursor key handling, and a history bug.
357         
358 2008-08-26  Miguel de Icaza  <miguel@novell.com>
359
360         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
361         limitations in Console, instead the 2.0 bootstrap libraries now
362         include the Console bits.
363
364         Also, remove the use of Nullables from getline.cs
365
366         ------------
367         
368         Interactive support for the C# compiler.   Use gmcs --shell to
369         enter a read-eval-print loop shell.
370
371         Docs: http://www.mono-project.com/CsharpRepl
372         
373         * sources: include repl.cs here and getline.cs for gmcs.exe,
374         everything else is getline.cs impaired.
375
376         * Makefile: when bootstrapping pass a special flag
377         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
378         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
379         This distinguishes those two cases.
380
381         * repl.cs: Support for a read-eval-print loop.   Will be soon
382         refactored into eval support and then REPL on top of it.
383
384         * ecore.cs: If a simplename lookup fails, before erroring out,
385         if we are in EvalMode to resolve the name to a declaration in the
386         Eval-land.    
387
388         This means that variable declarations that happened in previous
389         classes (as repl puts every statement in a separate class) are
390         made visible in this way.
391
392         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
393         triggered an error due to the end of file being reached.   This is
394         used to do multi-line input, and notify the caller that the user
395         needs to provide more text before a successful parse.
396
397         Add new grammar rules after the INTERACTIVE_PARSER token is seen
398         to drive the evaluation with a custom wrapper. 
399
400         * driver.cs: Add support for --shell, and refactor some code to be
401         reused from repl.cs
402         
403         * namespace.cs: Add support for serializing the contents of the
404         namespaces and reloading them.  
405
406         * getline.cs: A managed implementation of ReadLine under
407         X11/Apache2 license terms.  Easy to embed in other applications as
408         well.
409
410         * namespace.cs: Add some functions to save and restore the
411         namespace state.
412
413         * rootcontext.cs: New public field.
414
415         * cs-tokenizer.cs: Add support for one of the possible characters
416         we introduce into the token stream.  
417
418         This patch does not affect the regular tokenization process, the
419         only performance hit would happen if there is an invalid character
420         on the input string.
421
422         * support.cs: Move isatty helper routine here.
423
424         * codegen.cs: Small cleanup, and add a mechanism to initialize the
425         code generator for in-memory assemblies.
426
427 2008-08-26  Marek Safar  <marek.safar@gmail.com>
428
429         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
430         parameter cannot be always used as a type.
431
432 2008-08-21  Marek Safar  <marek.safar@gmail.com>
433
434         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
435
436 2008-08-21  Marek Safar  <marek.safar@gmail.com>
437
438         * convert.cs: Implement explicit array to IList<T> conversion.
439
440 2008-08-20  Marek Safar  <marek.safar@gmail.com>
441
442         A fix for bug #362740
443         * cs-tokenizer.cs: Handle UTF-16 surrogates.
444
445 2008-08-20  Marek Safar  <marek.safar@gmail.com>
446         
447         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
448         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
449         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
450         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
451         handling to use just one type of infrastructure and deal with generics
452         more effectivelly.
453
454 2008-07-23  Martin Baulig  <martin@ximian.com>
455
456         *** Merged this from trunk revision 108527 ***
457
458         * statement.cs
459         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
460         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
461         scope variable.
462
463 2008-08-15  Marek Safar  <marek.safar@gmail.com>
464         
465         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
466         error checks.
467
468 2008-08-15  Marek Safar  <marek.safar@gmail.com>
469         
470         * delegate.cs: Fixed compiler crash when creating delegate using partial
471         method.
472         
473         * typemanager.cs: MulticastDelegate is not a delegate.
474
475 2008-08-14  Marek Safar  <marek.safar@gmail.com>
476         
477         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
478         checks.
479
480 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
481
482         * cs-parser.jay (type): Allow 'var' in mcs too.
483         (local_variable_type): Likewise.
484
485 2008-08-14  Marek Safar  <marek.safar@gmail.com>
486         
487         * driver.cs: Removed broken -noconfig variants.
488
489 2008-08-14  Marek Safar  <marek.safar@gmail.com>
490         
491         A fix for bug #417078
492         * expression.cs: Emit correctly left side pointer operators.
493
494 2008-08-13  Marek Safar  <marek.safar@gmail.com>
495
496         * generic.cs, lambda.cs: Inflate method generic arguments only.
497
498 2008-08-12  Marek Safar  <marek.safar@gmail.com>
499
500         * class.cs: Fixed struct layout check regression.
501
502 2008-08-12  Marek Safar  <marek.safar@gmail.com>
503
504         * cs-parser.jay, enum.cs: Simplified enum parsing.
505         
506         * decl.cs: Check all type parameters conflicts.
507         
508         * expression.cs, statement.cs, attribute.cs: More expression checks.
509
510 2008-08-11  Marek Safar  <marek.safar@gmail.com>
511
512         * generic.cs: Add type inference types restriction.
513         
514         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
515         anonymous.cs, expression.cs: Allocate less accessor parameters.
516
517 2008-08-08  Marek Safar  <marek.safar@gmail.com>
518
519         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
520         classes.
521
522 2008-08-08  Marek Safar  <marek.safar@gmail.com>
523
524         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
525
526 2008-08-07  Marek Safar  <marek.safar@gmail.com>
527
528         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
529         Also fixes #362146 and #381592.
530
531 2008-08-07  Marek Safar  <marek.safar@gmail.com>
532
533         * ecore.cs: Reduced constant cannot be used as an attribute value.
534         
535         * cs-parser.jay: Base expression has to be a type.
536         
537         * expression.cs (Conditional): Uses ReducedExpression.
538
539 2008-08-06  Marek Safar  <marek.safar@gmail.com>
540
541         A fix for bug #376826
542         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
543         address of hoisted local variable or parameter cannot be taken.
544
545 2008-08-05  Marek Safar  <marek.safar@gmail.com>
546
547         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
548         anonymous method inside checked/unchecked expression.
549
550 2008-08-05  Marek Safar  <marek.safar@gmail.com>
551
552         * typemanager.cs (IsEqual): Guard against null.
553         
554         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
555         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
556         routine. Fixed few misleading conversion errors.
557
558 2008-08-04  Marek Safar  <marek.safar@gmail.com>
559
560         * class.cs: Consider generics when checking cycles in struct layout.
561
562 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
563
564         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
565
566 2008-08-04  Marek Safar  <marek.safar@gmail.com>
567
568         A fix for bug #414165
569         * anonymous.cs: Use same anonymous implementation method for all anonymous
570         method emits.
571
572 2008-08-04  Marek Safar  <marek.safar@gmail.com>
573
574         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
575         constraints.
576
577 2008-08-04  Marek Safar  <marek.safar@gmail.com>
578
579         * cs-parser.jay: Typeof argument has to be a type expression.
580         
581         * namespace.cs: Check alias and namespace definitions collisions.
582         
583         * class.cs, pending.cs: Moved explicit interface accessor implementation
584         check.
585         
586         * delegate.cs, expression.cs: Verify special name invocations.
587         
588 2008-08-01  Marek Safar  <marek.safar@gmail.com>
589
590         * cs-parser.jay: Don't choke on empty generic type arguments.
591         
592         * cs-tokenizer.cs: Handle escaped preprocessor directives.
593         
594         * expression.cs, ecore.cs: Minor expressions bugs.
595
596 2008-08-01  Marek Safar  <marek.safar@gmail.com>
597
598         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
599         and added more error handling.
600         
601         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
602         
603         *  modifiers.cs, enum.cs: Fixed.
604
605 2008-07-31  Jb Evain  <jbevain@novell.com>
606
607         * driver.cs: remove -pkg ability of smcs.
608
609 2008-07-30  Marek Safar  <marek.safar@gmail.com>
610
611         * statement.cs (Switch): Correctly set empty default target for single
612         blocks.
613
614 2008-07-30  Marek Safar  <marek.safar@gmail.com>
615
616         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
617         string switch statement implementation to use string dictionary which
618         significantly (2-8x) improves performance of generated code.
619
620 2008-07-29  Marek Safar  <marek.safar@gmail.com>
621
622         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
623         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
624         
625 2008-07-29  Marek Safar  <marek.safar@gmail.com>
626
627         A fix for bug #412595
628         * typemanager.cs, convert.cs, expression.cs: Some types are never
629         convertible to each other.
630
631 2008-07-29  Marek Safar  <marek.safar@gmail.com>
632
633         * nullable.cs (CreateNullConstant): An error messages update.
634
635 2008-07-29  Marek Safar  <marek.safar@gmail.com>
636
637         A fix for bug #412595
638         * cfold.cs: Don't cast undefined bool constant.
639
640 2008-07-29  Martin Baulig  <martin@ximian.com>
641
642         * symbolwriter.cs
643         (SymbolWriter.Reset): New public static method.
644
645         * driver.cs
646         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
647
648 2008-07-28  Marek Safar  <marek.safar@gmail.com>
649
650         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
651         
652         * expression.cs (ElementAccess): Exact size allocation.
653
654 2008-07-26  Marek Safar  <marek.safar@gmail.com>
655
656         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
657
658 2008-07-25  Marek Safar  <marek.safar@gmail.com>
659
660         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
661         
662         * class.cs: Removed $PRIVATE$ field hack which caused problems during
663         flow analysis.
664
665 2008-07-25  Marek Safar  <marek.safar@gmail.com>
666
667         A fix for bug #412217
668         * assign.cs: Mutate also assignment type.
669
670 2008-07-25  Marek Safar  <marek.safar@gmail.com>
671
672         A fix for bug #323644
673         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
674         indexers.
675
676 2008-07-25  Marek Safar  <marek.safar@gmail.com>
677
678         A fix for bug #412134
679         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
680         non-enumerable operands when overloading equality or bitwise operators.
681
682 2008-07-25  Marek Safar  <marek.safar@gmail.com>
683
684         * anonymous.cs: Cache closed generic anonymous method delegates.
685
686 2008-07-24  Marek Safar  <marek.safar@gmail.com>
687
688         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
689         anonymous.cs, statement.cs: Always emit anonymous method as static method
690         when is instance free. Use nesting for nested anynomous methods blocks.
691         
692 2008-07-23  Marek Safar  <marek.safar@gmail.com>
693
694         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
695         types.
696
697 2008-07-23  Marek Safar  <marek.safar@gmail.com>
698
699         * expression.cs: Removed MakeSimpleCall.
700
701 2008-07-23  Marek Safar  <marek.safar@gmail.com>
702
703         A fix for bug #323012
704         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
705         Base method implementing interface has to be public.
706
707 2008-07-23  Marek Safar  <marek.safar@gmail.com>
708
709         * cs-parser.jay: Don't break on missing argument.
710
711 2008-07-22  Marek Safar  <marek.safar@gmail.com>
712
713         A fix for bug #320993
714         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
715           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
716
717 2008-07-22  Marek Safar  <marek.safar@gmail.com>
718
719         A fix for bug #320748
720         * convert.cs: Implicit user operators cannot convert to interfaces
721
722 2008-07-22  Marek Safar  <marek.safar@gmail.com>
723
724         A fix for bug #312686
725         * driver.cs: Ignore empty assembly references.
726
727 2008-07-22  Marek Safar  <marek.safar@gmail.com>
728
729         A fix for bug #387040
730         * ecore.cs: Skip constrains check for an explicit implementation.
731
732 2008-07-21  Marek Safar  <marek.safar@gmail.com>
733
734         A fix for bug #409045
735         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
736           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
737           identifiers are file specific unless passed as input arguments.
738
739 2008-07-21  Marek Safar  <marek.safar@gmail.com>
740
741          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
742          to emit UnmanagedMarshal data under 2.0 profile.
743
744 2008-07-21  Marek Safar  <marek.safar@gmail.com>
745
746         A fix for bug #410369
747         * parameter.cs: Clone correctly ParamsParameter.
748
749 2008-07-21  Marek Safar  <marek.safar@gmail.com>
750
751         * expression.cs (Argument): Always report type for type based expressions
752         errors.
753
754 2008-07-18  Marek Safar  <marek.safar@gmail.com>
755
756         A fix for bug #410666
757         * anonymous.cs: Correctly initialize generic storey reference.
758
759 2008-07-18  Marek Safar  <marek.safar@gmail.com>
760
761         * convert.cs: Don't box same type arguments.
762
763 2008-07-18  Marek Safar  <marek.safar@gmail.com>
764
765         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
766         Finished missing generic type mutators.
767
768 2008-07-18  Marek Safar  <marek.safar@gmail.com>
769
770         * iterators.cs, statement.cs: Finished statements CloneTo.
771
772 2008-07-18  Marek Safar  <marek.safar@gmail.com>
773
774         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
775         
776         * expression.cs: Emit optimized default value expressions in expression tree
777         array initializer.
778
779 2008-07-18  Marek Safar  <marek.safar@gmail.com>
780
781         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
782
783 2008-07-17  Marek Safar  <marek.safar@gmail.com>
784
785         A fix for bug #367536
786         * cs-parser.jay: Check static constructor of generic types for an access
787         modifier.
788
789 2008-07-17  Marek Safar  <marek.safar@gmail.com>
790
791         A fix for bug #353800
792         * lambda.cs: Emit ret for contextual statements.
793         
794         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
795         up emitting redundant ret for all anonymous methods with return.
796
797 2008-07-17  Marek Safar  <marek.safar@gmail.com>
798
799         A fix for bug #365188
800         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
801         create anonymous method storey in unreachable block.
802
803 2008-07-17  Marek Safar  <marek.safar@gmail.com>
804
805         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
806         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
807         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
808         statement.cs: Fixed relevant defects found by Gendarme.
809
810 2008-07-17  Marek Safar  <marek.safar@gmail.com>
811
812         A fix for bug #325291
813         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
814         statement.cs: Replaced IAnonymousHost with top level block flag.
815
816 2008-07-17  Marek Safar  <marek.safar@gmail.com>
817
818         * cs-parser.jay: Clean up unused open_parens.
819
820 2008-07-17  Marek Safar  <marek.safar@gmail.com>
821
822         * ecore.cs: Custom error message for a range variable assignment.
823
824 2008-07-16  Marek Safar  <marek.safar@gmail.com>
825
826         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
827         load.
828
829 2008-07-16  Marek Safar  <marek.safar@gmail.com>
830
831         * literal.cs: Null literal is of object type.
832
833 2008-07-16  Marek Safar  <marek.safar@gmail.com>
834
835         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
836         expression of nullable equality comparison.
837
838 2008-07-15  Marek Safar  <marek.safar@gmail.com>
839
840         * expression.cs(PointerArithmetic): Removed redundant assignment.
841
842 2008-07-15  Marek Safar  <marek.safar@gmail.com>
843
844         * decl.cs (GetSignatureForError): Report full namespace name for containers.
845
846 2008-07-14  Marek Safar  <marek.safar@gmail.com>
847
848         A fix for bug #408361
849         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
850         they are replaced by GetMethod.
851
852 2008-07-14  Marek Safar  <marek.safar@gmail.com>
853
854         A fix for bug #408721 by jeremie.laval@gmail.com
855         * expression.cs (Indirection): Implemented CloneTo.
856
857 2008-07-14  Marek Safar  <marek.safar@gmail.com>
858
859         * statement.cs (AssignableSlots): Temporary disabled variable initialization
860         assert check.
861
862 2008-07-14  Marek Safar  <marek.safar@gmail.com>
863
864         * report.cs (EnableReporting): Don't reinitialize 0-based values.
865
866 2008-07-11  Marek Safar  <marek.safar@gmail.com>
867
868         * linq.cs: Reset tranparent parameter counter in probing mode.
869
870 2008-07-11  Marek Safar  <marek.safar@gmail.com>
871
872         * anonymous.cs: Mutate anonymous method type.
873
874 2008-07-11  Marek Safar  <marek.safar@gmail.com>
875
876         * ecore.cs, anonymous.cs: Mutate field expressions.
877
878 2008-07-10  Marek Safar  <marek.safar@gmail.com>
879
880         A fix for bug #369670
881         * linq.cs, statement.cs: Use explicit block for query expressions variables.
882
883 2008-07-10  Marek Safar  <marek.safar@gmail.com>
884
885         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
886
887 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
888
889         Fix bug #314902
890         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
891         only one '>', and finds a '>>', abort the generic lookahead.
892
893 2008-07-10  Marek Safar  <marek.safar@gmail.com>
894
895         A fix for bug #319902
896         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
897
898 2008-07-10  Marek Safar  <marek.safar@gmail.com>
899
900         A fix for bug #406371
901         * statement.cs: Moved EmitSymbolInfo to Block.
902
903 2008-07-09  Marek Safar  <marek.safar@gmail.com>
904
905         * ecore.cs: Report better error for extension method overload failures.
906
907 2008-07-09  Marek Safar  <marek.safar@gmail.com>
908
909         * expression.cs (Is): No need to box reference values.
910
911 2008-07-09  Marek Safar  <marek.safar@gmail.com>
912
913         * class.cs: Use event resolve context when initializing CreateEmitContext.
914
915 2008-07-09  Marek Safar  <marek.safar@gmail.com>
916
917         A fix for bug #394436
918         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
919         method used inside expression trees. Added more LINQ to expression tree
920         conversions.
921
922 2008-07-08  Marek Safar  <marek.safar@gmail.com>
923
924         A fix for bug #378189, #370577
925         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
926         from expression.
927
928 2008-07-08  Marek Safar  <marek.safar@gmail.com>
929
930         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
931         hierarchically.
932
933 2008-07-08  Marek Safar  <marek.safar@gmail.com>
934
935         A fix for bug #406702
936         * anonymous.cs: Always park anonymous method in the nearest parent storey.
937
938 2008-07-07  Marek Safar  <marek.safar@gmail.com>
939
940         A fix for bug #406648
941         * cs-parser.jay: Report nullable use in mcs for some cases.
942
943 2008-07-07  Marek Safar  <marek.safar@gmail.com>
944
945         * ecore.cs: Improved argument mismatch error messages.
946
947 2008-07-07  Marek Safar  <marek.safar@gmail.com>
948
949         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
950
951 2008-07-07  Marek Safar  <marek.safar@gmail.com>
952
953         * expression.cs (TypeOf): Mutate type argument.
954
955 2008-07-04  Marek Safar  <marek.safar@gmail.com>
956
957         * class.cs: Report missing partial modifier for correct type.
958
959 2008-07-04  Marek Safar  <marek.safar@gmail.com>
960
961         * ecore.cs, expression.cs (VariableReference): Variable property is 
962         protected.
963
964 2008-07-04  Marek Safar  <marek.safar@gmail.com>
965
966         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
967         
968 2008-07-04  Marek Safar  <marek.safar@gmail.com>
969
970         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
971         method delegates.
972
973 2008-07-04  Marek Safar  <marek.safar@gmail.com>
974
975         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
976         anonymous method storey to an instance method when only "this" is hoisted.
977
978 2008-07-03  Marek Safar  <marek.safar@gmail.com>
979
980         A fix for bug #321615
981         * expression.cs: Pointer comparisons use unsigned operator.
982
983 2008-07-03  Marek Safar  <marek.safar@gmail.com>
984
985         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
986
987 2008-07-02  Marek Safar  <marek.safar@gmail.com>
988
989         A fix for bug #404905
990         * class.cs: Always initialize local unsafe variables.
991
992 2008-06-30  Marek Safar  <marek.safar@gmail.com>
993
994         A fix for bug #396987
995         * expression.cs (NewInitialize): Clear local temporary variable for next run
996
997 2008-06-27  Marek Safar  <marek.safar@gmail.com>
998
999         A fix for bug #401020
1000         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1001
1002 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1003
1004         A fix for bug #398319
1005         * cs-parser.jay: Implemented undocumented base access expression inside
1006         anonymous types.
1007
1008 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1009
1010         A fix for bug #404227
1011         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1012
1013 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1014
1015         A fix for bug #404227
1016         * convert.cs: Fixed explicit array to interface cast.
1017
1018 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1019
1020         A fix for bug #403894
1021         * delegate.cs: Mutate DelegateInvocation type.
1022
1023 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1024
1025         A fix for bug #379348
1026         * delegate.cs: Box a load of generic parameters.
1027
1028 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1029
1030         * expression.cs: Add an array creation arguments mutate.
1031
1032 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1033
1034         A fix for bug #386068
1035         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1036         parameter.
1037
1038 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1039
1040         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1041         CloneTo.
1042
1043 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1044
1045         A fix for bug #403518
1046         * delegate.cs: Type correctly anonymous method new invocation.
1047
1048 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1049
1050         A fix for bug #394826
1051         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1052         calls.
1053
1054 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1055
1056         A fix for bug #394826
1057         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1058         needed.
1059
1060 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1061
1062         * class.cs: Clone indexer parameters for localized capturing.
1063
1064 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1065
1066         A fix for bug #402379
1067         * expression.cs: Don't crash when an object initializer resolve fails.
1068
1069 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1070
1071         A fix for bug #402888
1072         * expression.cs: Mutate conditional expression.
1073
1074 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1075
1076         A fix for bug #401012
1077         * class.cs: Keep StructLayout in shared container.
1078
1079 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1080
1081         A fix for bug #400438
1082         * decl.cs, class.cs: Only properties can be automatically implemented.
1083
1084 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1085
1086         * statement.cs (ChangeToIterator): Copy also labels.
1087
1088 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1089
1090         * ecore.cs: Pass type argument details to parent extension method.
1091
1092 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1093
1094         A fix for bug #375966
1095         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1096
1097 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1098
1099         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1100
1101 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1102
1103         A fix for bug #394347
1104         * anonymous.cs: Cache compatible delegates as compatibility check produces
1105         a new method every time.
1106
1107 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1108
1109         * anonymous.cs: Propagate storey reference for single references.
1110
1111 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1112
1113         A fix for bug #387615
1114         * assign.cs, expression.cs: Correctly clone compound assignment.
1115
1116 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1117
1118         A fix for bug #359611, #359604
1119         * anonymous.cs: Mutate all types of hoisted parameters.
1120
1121 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1122
1123         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1124         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1125         expression.cs, codegen.cs, statement.cs
1126         
1127         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1128         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1129         
1130         ** Anonymous methods, lambda expressions rewrite **
1131         
1132         Anonymous expressions are now resolved when an explicit block is resolved 
1133         and they don't require any registration procedure anymore. Further,
1134         anonymous methods are defined when explicit block is emitted which allows
1135         better control of whole process and opens possibilities for more
1136         optimizations as well as alternative to reverse whole process.
1137         
1138         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1139         process consistent and to correctly emit hoisted generic methods when they
1140         have at least 1 hoisted variable.
1141         
1142 2008-06-17  Martin Baulig  <martin@ximian.com>
1143
1144         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1145         iterator method.
1146         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1147         virtual property; check it in Emit().
1148         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1149         an iterator.
1150         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1151         an iterator.
1152         (Indexer.Define): Likewise.
1153
1154 2008-06-17  Marek Safar  <marek.safar@gmail.com>
1155
1156         * convert.cs: Don't use IsInterface on type arguments.
1157         
1158         * delegate.cs: DelegateInvocation uses MethodInfo.
1159         
1160         * parameter.cs: Removed IsTypeParameter.
1161         
1162         * generic-mcs.cs: More missing stuff.
1163
1164 2008-06-16  Martin Baulig  <martin@ximian.com>
1165
1166         * modifiers.cs
1167         (Modifiers.DEBUGGER_HIDDEN): New public const.
1168
1169         * typemanager.cs
1170         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1171
1172         * class.cs
1173         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1174         (AbstractPropertyEventMethod): Likewise.
1175         (Constructor.Emit): Likewise.
1176         (SourceMethod.SetCompilerGenerated): Removed.
1177
1178         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1179         on MoveNext().
1180
1181         * anonymous.cs
1182         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1183         if we're an `IteratorHost'.
1184         (AnonymousMethodMethod..ctor): Don't set
1185         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1186         not on the method.
1187
1188 2008-06-16  Marek Safar  <marek.safar@gmail.com>
1189
1190         * statement.cs: Clean-up foreach statements.
1191
1192 2008-06-12  Marek Safar  <marek.safar@gmail.com>
1193
1194         * class.cs: Stop using public method which should not exist
1195         (MethodBuilder.SetGenericMethodSignature).
1196
1197 2008-06-11  Martin Baulig  <martin@ximian.com>
1198
1199         * location.cs
1200         (Location.LookupFile): Add `CompilationUnit' argument; when given
1201         a relative file name, make it relative to the directory the .cs
1202         file is located in instead of using the current directory.
1203
1204 2008-06-11  Martin Baulig  <martin@ximian.com>
1205
1206         * class.cs
1207         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1208         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1209         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1210         (SourceMethod.SetCompilerGenerated): Likewise.
1211
1212 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1213
1214         * codegen.cs, driver: Only write symbol file when it's asked for.
1215
1216 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1217
1218         * codegen.cs: Don't use assembly writer error handling for symbol writer.
1219
1220 2008-06-10  Martin Baulig  <martin@ximian.com>
1221
1222         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1223
1224 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1225
1226         A fix for bug #316290
1227         * expression.cs: Include decimal operators in predefined table.
1228         
1229         * parameters.cs: More readonlyness.
1230
1231 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1232
1233         A fix for bug #397213
1234         * cs-parser.jay: One more missing current_local_parameters reset.
1235
1236 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1237
1238         A fix for bug #396633
1239         * class.cs: Host backing field in partial container.
1240
1241 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1242
1243         A fix for bug #397068
1244         * expression.cs: Check both operand types when predefined operator is used.
1245
1246 2008-06-05  Martin Baulig  <martin@ximian.com>
1247
1248         Merged the `debugger-kahalo' branch.
1249
1250         * class.cs
1251         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1252         we're an iterator method.
1253         (SourceMethod): Reflect latest symbol writer changes;
1254         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1255         now `start_row' and `end_row'.
1256         (Constructor.Emit): Fix the logic whether to emit symbol information.
1257
1258         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1259         generated methods.
1260
1261         * location.cs
1262         (CompilationUnit): New public class; derives from `SourceFile'.
1263         (SourceFileEntry.DefineSymbolInfo): New public method.
1264         (SourceFileEntry.SetChecksum): New public method.
1265         (Location): Encode hidden line numbers by using `column == 255';
1266         the .ctor now accepts `column == -1' to mark a hidden line number.
1267         (Location.Hidden): New public property.
1268         (Location.CheckPoint): Add `CompilationUnit'.
1269         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1270         (Location.Push): Add `CompilationUnit compile_unit' argument.
1271         (Location.CompilationUnit): New public property.
1272
1273         * statement.cs
1274         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1275
1276         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1277
1278         * driver.cs: `SourceFile' -> `CompilationUnit'.
1279
1280         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1281
1282         * namespace.cs: `SourceFile' -> `CompilationUnit'.
1283
1284         * cs-tokenizer.cs: Add support for `#pragma checksum' and
1285         `#line hidden'.
1286
1287         * symbolwriter.cs
1288         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1289         new symbol writer API to also pass the file.
1290
1291 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1292
1293         * statement.cs: Emit catch variable assignment using variable expression.
1294         
1295 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1296
1297         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1298         with other variable types.
1299
1300 2008-06-04  Marek Safar  <marek.safar@gmail.com>
1301
1302         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1303         GetLength method emit, it breaks resolve rules.
1304         
1305 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
1306             Marek Safar  <marek.safar@gmail.com>
1307                         
1308         A fix for bug #395542
1309         * cs-parser.jay: The trailing comma is allowed in anonymous type member
1310         declaration.
1311         
1312 2008-06-02  Marek Safar  <marek.safar@gmail.com>
1313
1314         A fix for bug #395287
1315         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1316
1317 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1318
1319         A fix for bug #395845
1320         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1321         non-nullable parameter type.
1322         
1323 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1324
1325         * class.cs: Handle contructor initializer as a statement in top-level block.
1326
1327 2008-05-30  Marek Safar  <marek.safar@gmail.com>
1328
1329         * attribute.cs: Don't mix old and new corlib types when emitting corlib
1330         security attributes.
1331
1332 2008-05-24  Marek Safar  <marek.safar@gmail.com>
1333
1334         * ecore.cs, expression.cs: Small IVariable refactoring.
1335
1336 2008-05-22  Marek Safar  <marek.safar@gmail.com>
1337
1338         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1339
1340 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1341
1342         * cs-parser.jay: Removed redundant catch type check.
1343
1344 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1345
1346         A fix for bug #390372
1347         * nullable.cs: Set correct return type.
1348
1349 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1350
1351         A fix for bug #391062
1352         * typemanager.cs: Fixed crash when comparing null types.
1353
1354 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1355
1356         A fix for bug #391871
1357         * cs-parser.jay: Better error handling for invalid catch type.
1358
1359 2008-05-20  Marek Safar  <marek.safar@gmail.com>
1360
1361         A fix for bug #392155
1362         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1363
1364 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1365
1366         A fix for bug #390666
1367         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1368         expressions.
1369
1370 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1371
1372         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1373         in getter.
1374
1375 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1376
1377         A fix for bug #389625
1378         * delegate.cs, generic.cs: Some progress on method group return type
1379         inference.
1380
1381 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1382
1383         A fix for bug #378419
1384         * namespace.cs: Inspect also parent namespaces not only namespace entries.
1385
1386 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1387
1388         * class.cs (Constructor): Added IsCompilerGenerated.
1389
1390 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1391
1392         * expression.cs: Enum binary operators can accept non-enum operand only when
1393         is implicitly convertible to underlying type.
1394
1395 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1396
1397         A fix for bug #389272
1398         * support.cs: Workaround System.InvalidOperationException for enums.
1399
1400 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1401
1402         A fix for bug #389073
1403         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1404
1405 2008-05-10  Marek Safar  <marek.safar@gmail.com>
1406
1407         * driver.cs: Split Parse.
1408         
1409         * location.cs (LookupFile): Uses string.Empty.
1410
1411 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1412
1413         * expression.cs, parameter.cs: Small ParameterReference clean up.
1414
1415 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1416
1417         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1418         hack. Fixes #387502.
1419
1420 2008-05-06  Martin Baulig  <martin@ximian.com>
1421
1422         * class.cs (Constructor.Emit): Fix the logic whether to emit
1423         symbol information.
1424
1425 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
1426
1427         Fix #385503
1428         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1429         InvalidOperationException when the iterator is before the start or
1430         after the end.
1431
1432 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1433
1434         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1435         when left is nullable type.
1436
1437 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1438
1439         A fix for bug #386628
1440         * expression.cs (LocalVariableReference): Continue in resolving when
1441         variable is not assigned.
1442
1443 2008-05-05  Marek Safar  <marek.safar@gmail.com>
1444
1445         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1446         nullable operations.
1447
1448 2008-05-04  Marek Safar  <marek.safar@gmail.com>
1449
1450         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1451         it saves many redundant temporary variables for nullable operations.
1452
1453 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1454
1455         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1456         
1457         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1458         method.
1459         
1460         * nullable.cs: Constant coalescing operator optimizations.
1461
1462 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1463
1464         * constant.cs: Use unsigned conversion for values which are unsigned only.
1465
1466 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1467
1468         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
1469         coalescing operator as it should be.
1470
1471 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1472
1473         A fix for bug #371016
1474         * expression.cs: All predefined delegate operators require implicit method
1475         group conversion.
1476         
1477 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1478
1479         * constant.cs: Emit long constant as uint when fits the range.
1480         
1481         * convert.cs, expression.cs: Fixed few unsafe conversions.
1482
1483 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1484
1485         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1486
1487 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
1488
1489         Fix #385758
1490         * convert.cs (ImplicitNumericConversion): Don't modify the type of
1491         'expr'.
1492         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
1493
1494 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1495
1496         * constant.cs, literal.cs: IsLiteral property for error reporting.
1497         
1498         * ecore.cs, expression.cs: Implemented Property expression.
1499
1500 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1501
1502         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
1503         
1504         * nullable.cs: Implemented nullable coalescing null operator.
1505
1506         * ecore.cs, expression.cs: Expression trees work.
1507
1508 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1509
1510         * ecore.cs: CreateExpressionTree is finally abstract.
1511
1512         * expression.cs, linq.cs: Updated.
1513
1514 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1515
1516         * expression.cs, ecore.cs: Block base access expression inside expression
1517         tree.
1518
1519 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1520
1521         A fix for bug #385058
1522         * expression.cs: User-defined operator implementations always take
1523         precedence over predefined operator implementations.
1524
1525 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1526
1527         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
1528         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
1529         expression tree conversions.
1530         
1531 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1532
1533         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
1534         operators method details to Operator class.
1535
1536 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1537
1538         * anonymous.cs: Pass unsafe flags to anonymous container.
1539         
1540         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
1541         inside expression tree.
1542
1543 2008-04-29  Martin Baulig  <martin@ximian.com>
1544
1545         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
1546         (Tokenizer.PopPosition): Also restore the `line'.
1547
1548 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1549
1550         * delegate.cs: Implemented Invoke expression.
1551
1552 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1553
1554         * expression.cs: Fixed equality reference comparison regression.
1555
1556 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1557
1558         * ecore.cs: Clean up EmptyCast hack.
1559         
1560         * expression.cs, nullable.cs: Implemented enum binary and unary operations
1561         using correct conversion rules. Also fixes #383993.
1562
1563 2008-04-28  Martin Baulig  <martin@ximian.com>
1564
1565         * class.cs (Constructor.Emit): Don't emit debugging information
1566         for generated default .ctor's.
1567
1568 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1569
1570         * convert.cs: Empty-cast ushort to int conversion.
1571
1572 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1573
1574         A fix for bug #384191
1575         * ecore.cs, expression.cs: Fixed expression cloning.
1576
1577 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1578
1579         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
1580
1581 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
1582
1583         Fix #381559, test-638.cs, test-639.cs
1584         * assign.cs (CompoundAssign.Helper): New wrapper.
1585         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
1586         access.
1587         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
1588         Pass unconverted expressions to the params array creation expression.
1589         (FieldExpr.EmitAssign): Don't special-case StringConcat.
1590         (PropertyExpr.EmitAssign): Likewise.
1591         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
1592         element if it is of kind CompoundAssign.Helper.
1593         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
1594         first before anything else.
1595         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
1596         (ArrayAccess.LoadArrayAndArguments): Simplify.
1597
1598 2008-04-27  Marek Safar  <marek.safar@gmail.com>
1599
1600         * expression.cs: Fixed cloning of typeof(void).
1601
1602 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
1603
1604         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
1605         (Assign.Emit): Likewise.  Move it to ...
1606         (CompoundAssign.DoResolve): ... here and ...
1607         (CompoundAssign.Emit): ... here.
1608         (EventAddOrRemove): New helper to handle += and -= on events, and
1609         avoid the use of BinaryDelegates.
1610         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
1611         (EventExpr.EmitAddOrRemove): Improve.
1612         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
1613
1614         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
1615         create VarExprs for 'foo.bar.var'.
1616         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
1617         is a highly inappropriate name for its functionality.
1618
1619 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
1620
1621         Simplify handling of multiple assignments
1622         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
1623         inheritable-only.
1624         (SimpleAssign): New.  Class to be used for normal assignments.
1625         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
1626         * expression.cs, parameter.cs, statement.cs: Likewise.
1627
1628 2008-04-25  Marek Safar  <marek.safar@gmail.com>
1629
1630         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
1631         for incompatible underlying types, more to come, uff.
1632
1633 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
1634
1635         Fix gtest-388.cs
1636         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
1637         Handle 'leave_copy'.
1638
1639 2008-04-25  Marek Safar  <marek.safar@gmail.com>
1640
1641         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
1642
1643 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
1644
1645         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
1646         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
1647         * statement.cs (While, Do, For): Allow test to have side effects.
1648         (For.DoEmit): Always emit InitStatement.
1649
1650         Fix test-635.cs
1651         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
1652         Always create SideEffectConstant.
1653         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
1654         of type EnumConstant.
1655
1656         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1657         Handle 'right' being SideEffectConstant of type 'bool'.
1658
1659         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1660         Use left.EmitBranchable instead of open coding it, so as to
1661         improve optimization opportunities.
1662
1663         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
1664
1665         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
1666         assumptions.
1667         (Expression.EmitSideEffect): Document.
1668
1669 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1670
1671         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
1672
1673 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1674
1675         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
1676
1677 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1678
1679         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
1680         conversion to expression tree.
1681
1682 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1683
1684         * ecore.cs: Removed unused expression.
1685
1686 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1687
1688         * expression.cs: Implemented NegateChecked and New expressions.
1689
1690 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1691
1692         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
1693
1694 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
1695
1696         Fix #351102
1697         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
1698         needing final 'ret' instruction.
1699
1700 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1701
1702         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
1703
1704 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1705
1706         * expression.cs: Emit ldnull and not null expression as an instance argument
1707          of static method expression calls.
1708
1709 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1710
1711         A fix for bug #378200
1712         * expression.cs: Fixed crash when creating parameterless expression tree
1713         method call.
1714
1715 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1716
1717         A fix for bug #375297
1718         * anonymous.cs: Fixed crash when inferring from null argument anonymous
1719         method.
1720
1721 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #377596
1724         * decl.cs, class.cs: Emit delegate type argument attributes.
1725
1726 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1727
1728         A fix for bug #365314
1729         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
1730         
1731 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1732
1733         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
1734         only.
1735
1736 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1737
1738         * generic.cs (TypeParameter): Removed redundant location.
1739
1740 2008-04-19  Marek Safar  <marek.safar@gmail.com>
1741
1742         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
1743         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
1744         FullNamedExpression in all declaration type expression, statements will come
1745         later.
1746
1747 2008-04-18  Marek Safar  <marek.safar@gmail.com>
1748
1749         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
1750         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
1751
1752 2008-04-18  Marek Safar  <marek.safar@gmail.com>
1753
1754         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
1755         code.
1756
1757 2008-04-17  Marek Safar  <marek.safar@gmail.com>
1758
1759         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
1760         constraints.
1761
1762 2008-04-17  Marek Safar  <marek.safar@gmail.com>
1763
1764         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
1765         name expressions.
1766         Also fixes #340463.
1767
1768 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
1769
1770         Hook up 'EmitSideEffect'
1771         * constant.cs (Constant.EmitSideEffect): New.
1772         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
1773         (SideEffectConstant.EmitSideEffect): New.
1774         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
1775         unconditional branch in EmitBranchable.
1776         (FieldExpr.EmitBranchable): New.
1777         * expression.cs (Unary.EmitSideEffect): New.
1778         (Binary.EmitSideEffect): New.
1779         (VariableReference.EmitSideEffect): New.  Do nothing.
1780
1781 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
1782
1783         Introduce 'EmitSideEffect'
1784         * ecore.cs (Expression.EmitSideEffect): New.
1785         (TypeCast): Rename from EmptyCast.
1786         (EmptyCast): New.
1787         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
1788         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
1789         * convert.cs, nullable.cs: Update to changes.
1790
1791 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1792
1793         * class.cs, cs-parser.jay: Early check for base types expression.
1794
1795 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1796
1797         * decl.cs (MemberName): Declare PrettyName as obsolete.
1798
1799 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1800
1801         * namespace.cs: Use MemberName comparison.
1802
1803 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
1804
1805         Fix build break
1806         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
1807         FullName.
1808         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
1809         (MemberName.FullyQualifiedName): New.  Provides the functionality
1810         that users assume FullName would have.
1811         * ecore.cs, namespace.cs: Update to changes.
1812
1813         * statement.cs (Using.assign): Make into ExpressionStatement.
1814         (Using.EmitPreTryBody): Simplify.
1815
1816 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1817
1818         * report.cs: ColorFormat is protected.
1819         
1820         * rootcontext.cs: Unused fields clean-up.
1821         
1822         * namespace.cs: Made UsingEntry name private.
1823
1824 2008-04-16  Marek Safar  <marek.safar@gmail.com>
1825
1826         * cs-tokenizer.cs, location.cs: Removed unused field.
1827
1828 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
1829             Raja R Harinath  <harinath@hurrynot.org>
1830
1831         Fix #379822
1832         * constant.cs (SideEffectConstant.value): Rename from 'left'.
1833         (SideEffectConstant.side_effect): Rename from 'right'.
1834         (SideEffectConstant..ctor): Normalize 'side_effect'.
1835         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
1836         value of this constant.
1837         * cfold.cs: Update to changes.
1838
1839 2008-04-15  Marek Safar  <marek.safar@gmail.com>
1840
1841         * cs-paser.jay: Removed unused variable.
1842         
1843         * driver.cs: Made Compile instance method.
1844
1845 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
1846
1847         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
1848
1849 2008-04-15  Marek Safar  <marek.safar@gmail.com>
1850
1851         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
1852
1853 2008-04-13  Jb Evain  <jbevain@novell.com>
1854
1855         * namespace.cs: update the System.Core fullname for 2.1
1856         * driver.cs: update the list of required assemblies for 2.1.
1857         Merged from the Moonlight 2 branch.
1858
1859 2008-04-11  Marek Safar  <marek.safar@gmail.com>
1860
1861         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
1862         types and user defined operators. User operators arguments has to be checked
1863         for null value before invocation, which also means no operator is called
1864         when any argument is not convertible to unwrapped nullable type.
1865         
1866 2008-04-09  Marek Safar  <marek.safar@gmail.com>
1867
1868         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
1869         of Unary expressions to follow operator overloading rules precisely.
1870         Also fixes #321794, #323794
1871         
1872 2008-04-08  Marek Safar  <marek.safar@gmail.com>
1873
1874         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
1875         expression.
1876         
1877 2008-04-08  Marek Safar  <marek.safar@gmail.com>
1878
1879         * expression.cs, ecore.cs: Implemented MemberInit expression.
1880         
1881 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
1882
1883         Fix mono/tests/exception4.cs
1884         * statement.cs (ExceptionStatement, TryCatch): Revert to using
1885         ec.NeedReturnLabel () rather emitting a 'nop'.
1886
1887         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
1888         simple heuristic.
1889         (TryCatch.SomeCodeFollows): Likewise.
1890         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
1891         for 'break', 'continue' and 'return' statements inside a try.
1892         We're fairly sure that the generated IL stream will have more
1893         instructions textually following the try.
1894         (FlowBranchingTryCatch): Likewise.
1895
1896         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
1897         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
1898         overrides.
1899
1900         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
1901         wrapper -- forward everything to CollectionForeach.
1902         (CollectionForeach.NonDisposableWrapper): New.
1903         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
1904         instead of a pop + branch to end.
1905
1906 2008-04-07  Marek Safar  <marek.safar@gmail.com>
1907
1908         A fix for bug #377485
1909         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
1910         Propagate location for extension method groups. Report conversion failure at
1911         right place.
1912
1913 2008-04-07  Marek Safar  <marek.safar@gmail.com>
1914
1915         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
1916         ListInit and Field expressions.
1917
1918 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
1919
1920         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
1921         Since $PC is always -1 inside the body of MoveNext, the fault
1922         handler is a no-op.
1923         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
1924         * statement.cs (ExceptionStatement.emit_finally): Likewise.
1925         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
1926
1927         The denouement!  Fix #324708
1928         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
1929         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
1930         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
1931         'finally' inside the finally clause.
1932
1933         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
1934         inside an iterator.  Don't emit the body of the 'finally' inside
1935         the finally clause yet.
1936
1937         Use the ResumableStatement infrastructure for MoveNext ()
1938         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1939         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
1940         'old_resume_points'.  Move dispatcher upfront.
1941         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1942         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1943         in an enumerator.  This encodes the main fix in this patch series
1944         -- we can only jump into the first instruction of a try from the
1945         outside, but we want to emit try/finally regions in iterators and
1946         resume in the middle of them.
1947
1948 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
1949
1950         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1951         of NeedReturnLabel here.
1952
1953         Introduce a common point for emitting try/finally to IL
1954         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
1955         features of the various subclasses, which are now driven by ...
1956         (ExceptionStatement.EmitPreTryBody): ... this and ...
1957         (ExceptionStatement.EmitTryBody): ... this and the original
1958         EmitFinallyBody.
1959         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1960         Remove DoEmit and update to follow above protocol.
1961
1962         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1963         of the dispatcher are the same, skip emitting the 'switch'.
1964         * iterator.cs (Iterator.EmitDispose): Update to changes.
1965
1966         Clean up handling of 'using' statement
1967         * statement.cs (UsingTemporary): New.  Carved out of ...
1968         (Using): ... this.  Simplify drastically.  Handle exactly
1969         one variable.
1970         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
1971         or Using as appropriate.  If there are multiple variable declared,
1972         create nested Using statements.
1973         (resource_acquisition): Kill.
1974
1975         * statement.cs (ExceptionStatement.EmitForDispose): Use
1976         EmitFinallyBody, not EmitFinally.
1977
1978         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1979         * iterator.cs: Update to changes.
1980
1981         Start using the ResumableStatement infrastructure
1982         * statement.cs (ResumeableStatement.PrepareForDispose): New.
1983         (ResumableStatement.EmitForDispose): New.
1984         (ExceptionStatement): Override them.
1985         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1986         EmitForDispose to create the body of the Dispose method.  Don't
1987         use OldResumePoint.
1988
1989         * iterator.cs (Iterator.AddResumePoint): Move here from ...
1990         * statement.cs (Toplevel.AddResumePoint): ... here.
1991         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1992         * flowanalysis.cs (FlowBranchingIterator): New.
1993         * codegen.cs (EmitContext): Update to changes.
1994
1995         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1996         (Iterator.old_resume_points): Rename from 'resume_points'.
1997         (Iterator.MoveNextStatement): Remove unused class.
1998
1999         New infrastructure for try/finally in iterators (still unused)
2000         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2001         (FlowBranchingToplevel.AddResumePoint): Hook into
2002         ToplevelBlock.AddResumePoint.
2003         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2004         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2005         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2006         resume points and assign program-counter values.
2007         (ExceptionBlock.AddResumePoint): Collect resume points for
2008         de-muxer at the top of try block.
2009         * iterators.cs (Yield.CheckContext): Simplify.
2010         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2011
2012 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2013
2014         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2015         argument to an ExitStatement.
2016         (FlowBranchingException): Refactor saved origins code.
2017         * statement.cs (ExitStatement): Update to cahges.
2018         * iterator.cs (YieldBreak): Likewise.
2019
2020         * statement.cs (ResumableStatement): New.  Common base class for
2021         YieldReturn and ExceptionStatement.
2022         (ExitStatement): New.  Common base class for Return and YieldBreak.
2023         (Return): Update to changes.
2024         * iterator.cs (YieldBreak): Likewise.
2025         * lambda.cs (ContextualReturn): Likewise.
2026
2027         Fix #377028
2028         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2029         emit a meaningful error message.
2030
2031         Fix #324765, #319508
2032         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2033         (VariableInfo.SetAssigned): Set it.
2034         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2035         determine if CS0219 or CS0168 is appropriate.  Don't use
2036         flow-analysis information.
2037         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2038         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2039         (EmitContext.EndFlowBranching): ... this.
2040
2041 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2042
2043         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2044
2045 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2046
2047         A fix for bug #376508
2048         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2049         ImplicitConversionExists.
2050
2051 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2052
2053         * expression.cs (Binary): Added remaining binary operators to expression
2054         tree builder.
2055
2056         * nullable.cs: Optimize shift with null argument.
2057
2058 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2059
2060         Fix minor IL regression
2061         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2062         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2063         * cs-parser.jay (try_statement): Update to changes.
2064
2065         * statement.cs (TryFinally.need_exc_block): Delete.
2066         (TryFinally): Update to changes.
2067
2068         Now all ExceptionStatements are unconditional
2069         * statement.cs (CollectionForeach.DisposableWrapper): New.
2070         Extract out the try/finally code into a new wrapper.
2071         (CollectionForeach.Resolve): Use it to simplify the code.
2072
2073 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2074
2075         Start at simplifying ExceptionStatement semantics a bit
2076         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2077         * cs-parser.jay (try_statement): Update to changes.
2078         (opt_catch_clauses): Remove.
2079         * flowanalysis.cs: Update to changes.
2080         (FlowBranching.BranchingType.TryCatch): New.
2081         (FlowBranchingTryCatch): New.
2082
2083         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2084         (FlowBranching.CreateBranching): Update to changes.
2085         (FlowBranchingBlock.AddSibling): Add sanity check.
2086         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2087         Update to changes.
2088
2089         * iterators.cs (Iterator.MarkFinally): Remove.
2090         * statement.cs (ExceptionStatement): Update to changes.
2091
2092         Add support for skipping over finally blocks at runtime.  First
2093         in a series to fix #324708
2094         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2095         (Iterator.EmitMoveNext): Initialize it.
2096         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2097         branch over the body of the 'finally' clause.
2098
2099 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2100
2101         Avoid lopsided use of Foo/DoFoo names
2102         * statement.cs (ExpressionStatement.EmitFinallyBody):
2103         Rename from EmitFinally.
2104         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2105         * iterator.cs: Update to changes.
2106
2107 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2108
2109         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2110         based on UserOperatorCall. More binary nullable operators clean up.
2111
2112 2008-04-02  Martin Baulig  <martin@ximian.com>
2113
2114         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2115
2116 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2117
2118         * nullable.cs: Merge user and empty conversions when lifting expression
2119         trees.
2120         
2121         * expression.cs (StringConcat): Implemented expression tree representation.
2122
2123 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2124
2125         * nullable.cs: When lifting null literal and a user operator exists, no call 
2126         is made.
2127         
2128 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2129
2130         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2131         null.
2132
2133 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2134
2135         * nullable.cs, expression.cs: Use namespace instead heavily nested
2136         monster abstract class.
2137
2138 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2139
2140         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2141         lifting of null literal and user operators. Clean up of some temporary
2142         nullable hacks.
2143
2144 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
2145
2146         Fix #368224, test-629.cs
2147         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2148         if it crossed an unwind-protect boundary.
2149         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2150         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2151         inside an unwind-protected region.
2152         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2153         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
2154         'leave' instead of a 'br' if unwind-protected.
2155         (Iterator.EmitYieldBreak): Likewise.
2156
2157 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
2158
2159         * driver.cs: Only define versioninfo resources if no win32 resource
2160         file was specified.
2161
2162 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2163
2164         A fix for bug #372375
2165         * convert.cs: Fixed boxing of nullable types.
2166
2167 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2168
2169         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2170         type.
2171
2172 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2173
2174         A fix for bug #374619
2175         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2176         
2177 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2178
2179         * lambda.cs: Check return type only for invocation.
2180         
2181 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2182
2183         A fix for bug #374214
2184         * ecore.cs: Correctly report argument type mismatch.
2185
2186 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2187
2188         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2189         and not rely on broken IsEnum.
2190
2191 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2192
2193         * nullable.cs: New file, extracted from generic.cs.
2194         
2195         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2196
2197 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2198
2199         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2200         predefined comparison operators and null literals.
2201         
2202         * report.cs: New warning ID.
2203         
2204 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2205
2206         A fix for bug #370577
2207         * lambda.cs: Check return type too.
2208
2209 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2210
2211         A fix for bug #372846
2212         * class.cs: Automatic properties can be declared as unsafe.
2213
2214 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2215
2216         * location.cs: Use string based concatenation.
2217         
2218         * expression.cs: LiftedBinaryOperator is gmcs only.
2219         
2220 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2221
2222         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2223         conversions rules and expression trees.
2224
2225 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2226
2227         * delegate.cs: Use extension method source as delegate target.
2228
2229 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2230
2231         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2232         binary operations to be purely based on binary operations and optimized
2233         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2234         and other ET refactoring.
2235         
2236         * typemanager.cs: Fixed warning.
2237         
2238 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2239
2240         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2241         
2242         * symbolwriter.cs: Fixed.
2243
2244 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2245
2246         * anonymous.cs, driver.cs: Reset anonymous types counters.
2247
2248 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2249
2250         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2251         
2252         * class.cs: Use fullname for all type member definitions.
2253         
2254 2008-02-19  Martin Baulig  <martin@ximian.com>
2255
2256         * class.cs
2257         (IMethodData.EmitExtraSymbolInfo): New interface method.
2258         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2259         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2260         interface method here as an empty public virtual method.
2261
2262         * anonymous.cs
2263         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2264         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2265         CodeGen.SymbolWriter.SetRealMethodName().       
2266
2267 2008-02-18  Martin Baulig  <martin@ximian.com>
2268
2269         * anonymous.cs
2270         (ScopeInfo.EmitType): Override this and emit debugging
2271         information for captured variables.
2272         (RootScopeInfo.EmitType): Override this and emit symbol
2273         information for a captured `this'.
2274
2275 2008-02-15  Martin Baulig  <martin@ximian.com>
2276
2277         * iterators.cs: Emit debugging info.
2278
2279         * codegen.cs
2280         (EmitContext.Flags): Add `OmitDebuggingInfo'.
2281         (EmitContext.OmitDebuggingInfo): New public property.
2282
2283         * statement.cs
2284         (While): Override Emit() and don't emit symbol info there; do it
2285         inside DoEmit() instead.
2286         (Block.Emit): Omit symbol information while emitting the scope
2287         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
2288         block logic.
2289         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2290         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2291         .ctor to make `IsIterator' work.
2292
2293 2008-03-14  Martin Baulig  <martin@ximian.com>
2294
2295         * symbolwriter.cs: Added the new symbol writer function from the
2296         debugger's `terrania' branch; temporarily enclose them inside
2297         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2298         my vacations.
2299
2300 2008-03-14  Martin Baulig  <martin@ximian.com>
2301
2302         * symbolwriter.cs
2303         (SymbolWriter): Make this a public static class.
2304
2305         * codegen.cs
2306         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2307         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2308
2309 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2310
2311         A fix for bug #370577
2312         * statement.cs, lambda.cs: Added extra limitations when dealing with void
2313         return type.
2314         
2315 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2316
2317         * typemanager.cs (CSharpName): Made 250 times faster.
2318
2319 2008-03-13  Marek Safar  <marek.safar@gmail.com>
2320
2321         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2322         
2323 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2324
2325         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2326         crash when predefined field does not exist.
2327         
2328 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2329
2330         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2331         
2332 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2333
2334         * class.cs (FixedField): Don't crash when contructors are missing.
2335
2336 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2337
2338         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2339         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2340         check internal types accessibility for internal and external types.
2341         Replaced EnumToUnderlying by GetEnumUnderlyingType.
2342
2343 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2344
2345         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2346         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2347         attribute.cs, statement: Use corect instance of predefined types (work
2348         related to #364674).
2349
2350 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2351
2352         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2353         
2354 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2355
2356         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
2357         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2358         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2359         predefined types clean up, delayed predefined types members initialization
2360         (work related to #364674).
2361
2362 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2363
2364         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2365         
2366 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2367
2368         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2369         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2370         predefined types clean up (work related to #364674).
2371
2372 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2373
2374         * ecore.cs: Print an error message instead of throwing exception.
2375         
2376 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2377
2378         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2379         expression.cs, statement.cs: Unififed null literal representation.
2380
2381 2008-03-03  Marek Safar  <marek.safar@gmail.com>
2382
2383         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2384         expression.cs: Refactored binary operators resolve phase and improved speed.
2385         The nullable code is still missing and won't work correctly, more fixes
2386         required.
2387
2388         It also fixes #323726, #324312, #324248, and many other unreported issues.
2389
2390 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
2391
2392         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
2393         instead of 'gmcs'.
2394
2395 2008-02-27  Marek Safar  <marek.safar@gmail.com>
2396
2397         * ecore.cs: Clean-up and split BetterConversion.
2398         
2399 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
2400
2401         Fix #363791
2402         * enum.cs (EnumMember.Value): Only access 'value' if
2403         ResolveValue says it's ok.
2404         (EnumMember.DoResolveValue): Don't set prev_member.value.
2405         (Enum.GetDefinition): Reverse arguments of Equals --
2406         EnumMember.Value can return 'null'.
2407
2408         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2409
2410 2008-02-22  Marek Safar  <marek.safar@gmail.com>
2411
2412         * generic.cs, expression.cs: More ongoing work on expression trees.
2413         
2414 2008-02-21  Marek Safar  <marek.safar@gmail.com>
2415
2416         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2417         handle missing matches when mutiple operators exist.
2418         
2419 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2420
2421         A fix for bug #363218
2422         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2423         initializers.
2424         
2425 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2426
2427         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2428         update. This time to deal correctly with SideEffectConstant expression used
2429         as an argument for another constant folding.
2430
2431 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
2432
2433         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2434         MethodBuilder.
2435
2436 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2437
2438         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2439
2440 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2441
2442         A fix for bug #328136
2443         * expression.cs: Do not fold immediately LogicalAnd operators when the left
2444         side is a false constant, because we still need to evaluate the right-hand
2445         side.
2446
2447         * statement.cs (If): Emit two types of boolean constants (simple constant,
2448         side-effect constant).
2449
2450 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2451
2452         * constant.cs (SideEffectConstant): Don't emit boolean constant.
2453
2454         * expression.cs: Fold immediately LogicalAnd operators when both sides are
2455         constants.
2456
2457 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2458
2459         A fix for bug #361457
2460         * ecore.cs (IsApplicable): Params methods have lower priority.
2461
2462         * support.cs: Return correct parameter modifier for params types.
2463
2464 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2465
2466         * generic.cs (TypeParameter): Cache attribute target name.
2467
2468         * support.cs: Removed unused variable.
2469
2470         * typemanager.cs: Removed debugging leftover.
2471
2472         * ecore.cs: Use local type instead of a property;
2473
2474         * class.cs (VerifyMembers): Consider also parent to test whether type member
2475         is local or public.
2476
2477         * expression.cs (FullMethodDesc): Removed.
2478
2479         * attribute.cs (IsValidArgumentType): Made static.
2480
2481 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
2482
2483         Cleanup to be more readable.
2484         * Makefile (GMCS_PROFILE): Remove.
2485         (COMPILER_NAME): New helper.
2486
2487 2008-02-15  Miguel de Icaza  <miguel@novell.com>
2488
2489         * cs-tokenizer.cs: if a conditional expression happens inside a
2490         (...) this also means that we do not need to de-ambiguate between
2491         an parenthesized expression and a cast.
2492
2493         Fixes 346484.
2494
2495         * constant.cs (SideEffectConstant): a constant value that happens
2496         to have a side effect.
2497
2498         Fixes the build regressions introduced by the fix for #359789
2499
2500 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
2501
2502         * expression.cs (Conditional.Emit): when emitting the ternary
2503         operator, use local variables to generate code verifiable code.
2504
2505         The verifier cannot infer that the type on stack before the
2506         stloc.0 is executed is of type ParentB. This happens because the
2507         stack merge algorithm uses only parent types when deciding which
2508         is the common type.  This is described in Part III 1.8.1.3 of ECMA
2509         335.
2510
2511         This code compiled with mcs is not verifiable under MS. The MS
2512         verifier picks the first common interface of Foo and Bar, which is
2513         wrong, but doesn't use a full join type of the 2 interfaces.
2514
2515         CSC uses a clever hack to compile such code in a verifiable
2516         way. It stores the intermediate values in a local variable with
2517         the expected type.
2518
2519         Fixes: #358102
2520
2521 2008-02-14  Miguel de Icaza  <miguel@novell.com>
2522
2523         * expression.cs: Do not fold BitwiseAnd operators when the left
2524         side is a false constant, because we still need to evaluate the
2525         right-hand side.
2526
2527         Fixes #359789
2528
2529         * support.cs: Instead of throwing an InternalErrorException when
2530         the position of the stream is outside the boundary of our buffer,
2531         reset the state of the reader, and restart the reading from the
2532         beginning of the file.
2533
2534 2008-02-14  Marek Safar  <marek.safar@gmail.com>
2535
2536         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
2537
2538 2008-02-14  Marek Safar  <marek.safar@gmail.com>
2539
2540         A fix for bug #361686
2541         * decl.cs: A protected types used inside a private class which parents
2542         derives from the protected class are accessible.
2543
2544 2008-02-13  Marek Safar  <marek.safar@gmail.com>
2545
2546         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
2547         the parameterless constructor.
2548
2549 2008-02-13  Marek Safar  <marek.safar@gmail.com>
2550
2551         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
2552         lookup methods to use standard member cache when doing member lookup.
2553
2554 2008-02-12  Marek Safar  <marek.safar@gmail.com>
2555
2556         * driver.cs: Don't report full path for referenced module as assembly error.
2557
2558 2008-02-12  Marek Safar  <marek.safar@gmail.com>
2559
2560         * Makefile: Fixed `qh' target to work on all machines.
2561
2562         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
2563         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
2564         and HasElementType with TypeManager implementation.
2565
2566 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2567
2568         A fix for bugs #325134, #359749
2569         * expression.cs, ecore.cs: Try to resolve an extension method even if the
2570         first binds point to non-method member expression.
2571
2572 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2573
2574         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
2575
2576 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2577
2578         A fix for bugs #321394, #323028
2579         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
2580         Reworked naive IsAccessibleAs implementation to handle nested types.
2581
2582 2008-02-05  Jb Evain  <jbevain@novell.com>
2583
2584         * class.cs: use generic type comparison for parameters
2585         as well.
2586
2587 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2588
2589         A fix for bug #325372
2590         * class.cs: Use generic type comparison when testing method signatures.
2591
2592 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2593
2594         A fix for bug #357047
2595         * ecore.cs: Applied C# 3.0 changes to better conversion.
2596
2597 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2598
2599         A fix for bug #358374
2600         * cs-parser.jay: Correctly set modifiers for all constructor types.
2601
2602 2008-02-04  Marek Safar  <marek.safar@gmail.com>
2603
2604         A fix for bug #355251
2605         * generic.cs: Added base class constraint based type inference.
2606
2607 2008-02-01  Marek Safar  <marek.safar@gmail.com>
2608
2609         A fix for bug #357255
2610         * decl.cs: One more missing visibility check.
2611
2612 2008-02-01  Marek Safar  <marek.safar@gmail.com>
2613
2614         * support.cs: Fixed broken return.
2615
2616 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2617
2618         * report.cs: Correctly reset warnings count after probing.
2619
2620 2008-01-25  Martin Baulig  <martin@ximian.com>
2621
2622         * namespace.cs
2623         (NamespaceEntry.SymbolFileID): Make this work again after
2624         MemberName.ToString() is gone.
2625
2626 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2627
2628         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
2629         expressions.
2630
2631 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2632
2633         * generic.cs: Use full implicit conversion for type inference fixing.
2634
2635 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2636
2637         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
2638         Fixed user operator conversions.
2639
2640 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2641
2642         * generic.cs: Do nullable type to null comparison optimization during
2643         resolve phase.
2644
2645 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2646
2647         A fix for bug #355163
2648         * generic.cs: Enabled l-value resolve on nullable expressions.
2649
2650 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2651
2652         A fix for bug #353986
2653         * class.cs: Ingore static ctors with parameters for any further checks.
2654
2655 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2656
2657         A fix for bug #354310
2658         * namespace.cs: Removed redundant check.
2659
2660 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2661
2662         A fix for bug #354928
2663         * expression.cs: ElementInitializers can be resolved only once.
2664
2665 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2666
2667         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
2668         Condition expressions.
2669
2670 2008-01-23  Marek Safar  <marek.safar@gmail.com>
2671
2672         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
2673
2674 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2675
2676         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
2677         not allowed.
2678
2679         * generic.cs: Implemented coalesce expression.
2680
2681 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2682
2683         A fix for bug #355145
2684         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
2685         expression tree type inference.
2686
2687 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
2688
2689         Fix #354663
2690         * expression.cs (Binary.IsUnsignedType): Fix typo.
2691
2692 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2693
2694         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
2695
2696 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2697
2698         A fix for bug #355161
2699         * ecore.cs, expression.cs: Wider range of extension method supported
2700         expressions.
2701
2702 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
2703
2704         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
2705         AssemblyBuilder to operate in compiler context. Fixes mcs part of
2706         bug #354970.
2707
2708 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2709
2710         A fix for bug #355148
2711         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
2712
2713 2008-01-22  Miguel de Icaza  <miguel@novell.com>
2714
2715         * expression.cs (CreateExpressionTree): Add support for or and
2716         logical or, and indent following the coding conventions.
2717
2718         * typemanager.cs (LinqExpression): renamed from
2719         ExpressionTreeManager, for a shorter name.
2720
2721         Use TypeManager.CoreLookupType to lookup types from our core
2722         assemblies and turn those into "Type" variables.
2723
2724         Consumers that previously used "Namespace" and "Type" from this
2725         class should instead use the TypeExpression which is a type that
2726         is fully resolved (without involving the regular C# resolution
2727         rules). 
2728
2729         This typically looks like this:
2730
2731         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
2732         new MemberAccess (texpr, name, type_arguments, loc)
2733
2734         This avoids the problem in: #355178
2735
2736 2008-01-21  Marek Safar  <marek.safar@gmail.com>
2737
2738         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
2739         feature in parser only as we do in other cases.
2740         
2741 2008-01-21  Marek Safar  <marek.safar@gmail.com>
2742
2743         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
2744         typemanager.cs: A refactoring of params arguments to reuse existing
2745         expressions (params -> array initializer) to emit params argument instead
2746         of specialized handling.
2747         It was required by expression tree implementation and it has other benefits
2748         as well, we now apply same optimization for params arguments as we do for
2749         array initializers.
2750         
2751 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2752
2753         A fix for bug #353526
2754         * generic.cs: A type inference of params arguments may not required any
2755         temporary array creation.
2756         
2757 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2758
2759         A fix for bug #353534
2760         * generic.cs, ecore.cs, expression.cs: A method group type inference is
2761         supported for delegates only.
2762         
2763 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2764
2765         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
2766         type for more than 1 candidates.
2767         
2768 2008-01-18  Marek Safar  <marek.safar@gmail.com>
2769
2770         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
2771         expressions.
2772         
2773 2008-01-16  Marek Safar  <marek.safar@gmail.com>
2774
2775         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
2776         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
2777         operator) expressions. 
2778                 
2779 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
2780
2781         * statement.cs: Avoid declaring an IL variable for this_variable since it is
2782         not accessed from the generated IL.
2783
2784 2008-01-14  Marek Safar  <marek.safar@gmail.com>
2785
2786         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
2787         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
2788         statement.cs: The first expression tree implementation drop, mostly
2789         infrastructure work.
2790
2791 2008-01-14  Marek Safar  <marek.safar@gmail.com>
2792
2793         * ecore.cs (IsNestedChild): Refactored.
2794
2795 2008-01-11  Marek Safar  <marek.safar@gmail.com>
2796
2797         * lambda.cs: Don't use a cast on unknown expression statement.
2798
2799 2008-01-10  Geoff Norton  <gnorton@novell.com>
2800
2801         * cs-tokenizer.cs: One more token to distinguish between method and lambda
2802         arguments
2803
2804 2008-01-09  Marek Safar  <marek.safar@gmail.com>
2805
2806         * doc.cs: Report better /doc crash details.
2807         
2808 2008-01-09  Marek Safar  <marek.safar@gmail.com>
2809
2810         A fix for bug #352536
2811         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
2812
2813 2008-01-08  Marek Safar  <marek.safar@gmail.com>
2814
2815         A fix for bug #352287
2816         * ecore.cs, expression.cs: Do `this' access checking in all member access
2817         expressions.
2818         
2819 2008-01-08  Marek Safar  <marek.safar@gmail.com>
2820
2821         * rootcontext.cs, driver.cs: Switch to linq mode by default.
2822         
2823         * report.cs: Reset message stacks.
2824         
2825 2008-01-08  Marek Safar  <marek.safar@gmail.com>
2826
2827         * generic.cs (InferInPhases): Correctly calculate params position.
2828         
2829 2008-01-08  Marek Safar  <marek.safar@gmail.com>
2830
2831         * cs-tokenizer.cs: No need to parse full string when parsing lambda
2832         arguments.
2833
2834 2008-01-07  Marek Safar  <marek.safar@gmail.com>
2835
2836         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
2837         
2838         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
2839         
2840         * driver.cs: Updated --help option.
2841         
2842 2008-01-07  Marek Safar  <marek.safar@gmail.com>
2843
2844         * generic.cs (InferParamsTypeArguments): Removed.
2845         (InferInPhases): Add params type inference.
2846         (LowerBoundInference): Fixed scoring mechanism.
2847         
2848         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
2849         
2850 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
2851
2852         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
2853         byte array for unsigned "baked" assemblies.
2854
2855 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
2856
2857         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
2858         array for assemblies that are not strongnamed.
2859
2860 2008-01-04  Marek Safar  <marek.safar@gmail.com>
2861
2862         A fix for bug #351481
2863         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
2864         declaring type for nested generic types.
2865         
2866 2008-01-04  Marek Safar  <marek.safar@gmail.com>
2867
2868         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
2869         instead of ToString.
2870         
2871 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2872
2873         A fix for bug #351047
2874         * expression.cs (Binary.ResolveOperator): Allow equality operators between
2875         null and structs only when equality and inequality operators are defined
2876         either as an user-operators or predefined operators.
2877         
2878 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2879
2880         A fix for bug #351047
2881         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
2882         
2883 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2884
2885         A fix for bug #351257
2886         * cs-tokenizer.cs: Advance line number for '\r' correctly.
2887         
2888 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2889
2890         A fix for bug #351157
2891         * class.cs (Using): Fixed yet another broken cloning.
2892         
2893         (Block): Put back more sensible default value for statements.
2894         
2895 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
2896
2897         * codegen.cs: Allow AssemblyVersion with only major version component.
2898         Fixes bug #351055.
2899
2900 2007-12-29  Marek Safar  <marek.safar@gmail.com>
2901
2902         A fix for bug #324654
2903         * class.cs: Use FullName property as member name.
2904
2905 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2906
2907         A fix for bug #342117
2908         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
2909         constructor constraint.
2910
2911 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2912
2913         A fix for bug #338273
2914         * class.cs (ProbertyBase): Access modifier checks are required for overrides
2915         only.
2916
2917 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2918
2919         A fix for bug #350839
2920         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
2921
2922 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2923
2924         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2925         GHOP:
2926         
2927         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2928
2929         * statement.cs: Changed some Hashtables to use HybridDictionaries
2930         instead. It was observed that some HashTables only contained a few
2931         items in the vast majority of cases. Since HybridDictionary is
2932         more efficient on small sets (<10 elements), "known_variables"
2933         from class ExplicitBlock as well as "labels" and "constants " from
2934         class Block were changed to HybridDictionaries. 
2935
2936         Atsai results: (56216kb->54987kb)
2937
2938         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2939
2940
2941 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2942
2943         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2944         GHOP:
2945         
2946         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2947         
2948         * expression.cs: foreach loop to for loop, saved on allocation of
2949         enumerator (59333kb->59141kb)
2950
2951         * statement.cs. Changed foreach loops to for loops, saved on
2952         allocation of enumerator (59141kb->59006kb)
2953
2954         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2955         when constructed with no specified capacity. This was causing a
2956         few ArrayLists to allocate more memory than they would potentially
2957         need in the Block class and MemberCache class. Setting the
2958         ArrayLists to construct with a capacity of 1 saves some
2959         memory. (56216kb->55585kb)
2960
2961 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2962
2963         A fix for bug #347189 (2nd issue)
2964         * expression.cs (MemberAccess): Nested type can be found in base non-generic
2965         type.
2966
2967 2007-12-27  Miguel de Icaza  <miguel@novell.com>
2968         
2969         * report.cs: Do not use colors if stdout and stderr are not a
2970         terminal.
2971
2972 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2973
2974         A fix for bug #346998
2975         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2976         overloads.
2977
2978 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2979
2980         A fix for bug #343465
2981         * class.cs: Explicit method name for nested types uses dots only.
2982
2983 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2984
2985         A fix for bug #343707
2986         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2987
2988 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2989
2990         * ecore.cs: Report type inference errors only when arguments count matches
2991         parameter count.
2992         
2993         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2994         
2995         * expression.cs, report.cs: New warning.
2996         
2997         * typemanager.cs: Catch anonymous method type too.
2998
2999 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3000
3001         A fix for bug #346379
3002         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3003
3004 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3005
3006         A fix for bug #347359
3007         * expression.cs (Invocation): Don't resolve already resolved expression.
3008
3009 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3010
3011         A fix for bug #347189
3012         * class.cs (FixedField): Use non-dependent code only in the define phase.
3013
3014 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3015
3016         A fix for bug #348076
3017         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3018
3019 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3020
3021         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3022         discovered extension methods.
3023
3024 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3025
3026         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3027         method.
3028
3029 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3030
3031         * report.cs (ErrorMessage): Add support for using colors on
3032         terminals that support it. 
3033
3034 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3035
3036         * ecore.cs: Use information about expanded params for error reporting.
3037
3038 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3039
3040         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3041         and logic for params overloads.
3042         
3043 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3044
3045         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3046         as this is also created from the parser.  Fixes #349034
3047
3048 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3049
3050         * statement.cs (Throw.CloneTo): it is valid to have empty
3051         expressions for throw. 
3052
3053 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3054
3055         * cs-parser.jay: Set delegate constraint parsing region correctly.
3056
3057 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3058
3059         A fix for bug #345467
3060         * typemanager.cs (IsEqual): Compare generic parameters position only.
3061         
3062 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3063
3064         * expression.cs (BaseAccess): Type arguments can be null.
3065
3066 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3067
3068         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3069         consistent even when an error has occured.
3070         (Switch.Resolve): Likewise.
3071
3072 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3073
3074         A fix for bug #334505
3075         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3076         overrides.
3077         
3078 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3079
3080         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3081         refactorings required to resolve extension methods correctly when mixing
3082         generics and non-generics members.
3083         
3084 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3085
3086         A fix for bug #342584
3087         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3088         conversion.
3089         
3090 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3091
3092         A fix for bug #342512
3093         * delegate.cs: Use delegate argument expression when is available. Don't
3094         emit virtual call when class is sealed.
3095         
3096 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3097
3098         A fix for bug #325423
3099         * assign.cs (FieldInitializer): Use resolved expression for emit.
3100         
3101         * class.cs: Print less confusing error message.
3102         
3103 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3104
3105         * cs-tokenizer.cs: Removed GMCS ifdefs.
3106         
3107         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3108         mcs.
3109         
3110         * cs-parser.jay: Disabled nullable check.
3111         
3112         * generic-mcs: Copied more generic stuff.
3113                 
3114 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3115
3116         * gcs-parser.jay: Merged to cs-parser.jay.
3117         
3118         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3119         * *.csproj, *.sources: Updated to use only jay parser file.
3120
3121 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3122
3123         * gcs-parser.jay: Added nullable and default expression feature checks.
3124         
3125 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3126
3127         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
3128         it fixes many TODOs and hidden bugs.
3129         
3130         * expression: Removed duplicate error check.
3131
3132 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3133
3134         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3135         implicitly type local variable only when it is used in a declaration.
3136
3137 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3138
3139         * attribute.cs: Use CS0612 for empty strings.
3140
3141 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3142
3143         * lambda.cs, statement.cs: Contextual return may act as a statement.
3144
3145 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3146
3147         A fix for a regression cause by #324222
3148         * class.cs: Don't report unused even when it implements an interface.
3149         
3150 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3151
3152         A fix for bug #341205
3153         * ecore.cs, expression.cs: Method group expression cannot do static
3154         method access with an instance reference check before overloading takes
3155         a place.
3156         
3157 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3158
3159         A fix for bug #325359
3160         * class.cs: Use predictable name for automatically generated property.
3161         
3162 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3163
3164         A fix for bug #324996
3165         * expression.cs (Is): Handle case where D is nullable and T is not
3166         correctly.
3167         
3168         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3169         
3170 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3171
3172         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3173         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3174         Flush small error reporting changes.
3175         
3176 2007-11-09  Marek Safar  <marek.safar@gmail.com>
3177
3178         A fix for bug #324996
3179         * expression.cs: Rewrote Is expression implementation to work with
3180         generics, nullable types, anonymous method. A const result expression 
3181         uses existing infrastructure instead of custom not fully-featured one.
3182         
3183 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3184
3185         A fix for bug #340202
3186         * class.cs: Consider generics for volatile field.
3187
3188 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3189
3190         A fix for bug #335594
3191         * expression.cs: Use conversion rules when handling string addition.
3192         
3193 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3194
3195         A fix for bug #336651
3196         * expression.cs: Fixed a crash when probing is on.
3197         
3198 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3199
3200         A fix for bug #324242
3201         * covert.cs: Added a conversion from any nullable-type with an 
3202         underlying enum-type to the type System.Enum.
3203         
3204 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3205
3206         A fix for bug #324222
3207         * class.cs: Report all non-used event fields.
3208         
3209 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3210
3211         A fix for bug #325161
3212         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3213         qualifier for generic types.
3214         
3215 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3216
3217         A fix for bug #322971
3218         * expression.cs, ecore.cs: Added intermediate result value check for
3219         indexers. 
3220         
3221 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3222
3223         A fix for bug #324754
3224         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3225         when it was requested.
3226
3227 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3228
3229         A fix for bug #325101
3230         * expression.cs: Do type not value comparison for `is' expression.
3231
3232 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3233
3234         A fix for bug #320236
3235         * convert.cs: Don't apply user conversion on underlying target type.
3236
3237 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3238
3239         * expression.cs: Don't use unresolved expression for error reporting.
3240  
3241 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3242
3243         A fix for bugs #337712, #324490
3244         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3245         overloading resolution too.
3246         
3247         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3248         the process consistent and more robust.
3249         
3250         * expression.cs, linq.cs, report.cs: Update.
3251
3252 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3253
3254         A fix for bug #332909
3255         * attribute.cs: Resolve attributes in correct context using error
3256         handling procedure.
3257         
3258         * rootcontext.cs: Define Obsolete attribute members as core members.
3259         
3260 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3261
3262         * statement.cs: Removed unused methods.
3263         
3264 2007-10-31  Wade Berrier  <wberrier@novell.com>
3265
3266         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
3267         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3268         during 'make dist')
3269
3270 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3271
3272         A fix for bug #338102
3273         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3274         methods registered as non-generics.
3275         
3276 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3277
3278         A fix for bugs #337712, #324490
3279         * delegate.cs: Delegate covariance and contravariance is not allowed for
3280         value types.
3281         
3282 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3283
3284         A fix for bug #337719 
3285         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3286         `from' keyword.
3287         
3288 2007-10-30  Marek Safar  <marek.safar@gmail.com>
3289  
3290         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3291
3292 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3293  
3294         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3295         query expressions.
3296
3297 2007-10-29  Raja R Harinath  <rharinath@novell.com>
3298
3299         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3300
3301 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3302  
3303         A fix for bug #334652
3304         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3305         extension methods when we have not found the best candidate in normal
3306         container.
3307
3308 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3309
3310         * AssemblyInfo.cs: Keep up-to-date.
3311
3312 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3313
3314         * Makefile: Fixed generics compiler name.
3315         
3316 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3317
3318         * lambda.test: removed, lambda parsing is done differently.
3319         
3320         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3321
3322 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
3323
3324         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3325
3326 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3327
3328         * Makefile, *.sources : All C# compilers are in mcs folder.
3329         
3330         * *.cs: Use existing 2_1 define for smcs.
3331
3332 2007-10-26  Marek Safar  <marek.safar@gmail.com>
3333
3334         A fix for bug #335847
3335         * assign.cs, expression.cs: Couple of changes to avoid creating a
3336         temporary variable for each object initializer assignment statement. It
3337         simplifies struct initialization too, otherwise two temporary variables
3338         would be required.
3339         Implemented optimization of redundant default element initializers.
3340         
3341 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3342
3343         A fix for bug #336766
3344         * expression.cs (Class.CheckBase): Use generic name when method is
3345         generic.
3346         
3347 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3348
3349         A fix for bug #334737
3350         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3351         variable and not variable argument for prepared copies.
3352
3353 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3354
3355         A fix for bug #325110
3356         * class.cs, expression.cs, attribute.cs: Use open generic method when
3357         checking conditional attribute.
3358         
3359 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3360
3361         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
3362         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3363         FeatureIsNotAvailable.
3364
3365 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3366
3367         ** C# 3.0 Partial methods
3368         
3369         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3370         methods support. Because of member cache issue with generics only
3371         non-generics partial methods are fully supported.
3372         
3373 2007-10-23  Marek Safar  <marek.safar@gmail.com>
3374         
3375         * class.cs, decl.cs: Rewrote member overloads check to cope with 
3376         generics and to use member cache for member checking. It also improves
3377         performance and fixes remaining overloads issues.
3378         
3379 2007-10-20  Marek Safar  <marek.safar@gmail.com>
3380         
3381         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3382         roottypes.cs, typemanager.cs:
3383                 
3384         A member cache creation logic changed to add members immediately and
3385         not rely on fallback. The member cache is now only prefered way
3386         how to access and find type declaration members. It saves 5 MB of memory
3387         during MWF compilation and makes code ready for more optimizations and
3388         clean-ups, it's also a pre-requirement for partial methods.
3389         
3390 2007-10-18  Raja R Harinath  <harinath@gmail.com>
3391
3392         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3393         handling for generic parameters.
3394
3395 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3396         
3397         * class.cs (FixedField): Removed redundant volatile check.
3398         
3399 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3400         
3401         * class.cs, decl.cs: Fixed overload members verification to do only one
3402         check per possible collision.
3403         
3404 2007-10-13  Marek Safar  <marek.safar@gmail.com>
3405         
3406         A fix for bug #325478
3407         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3408         and create only one disposable flags container.
3409         
3410 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3411         
3412         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3413         * statement.cs (Fixed): Fixed variables cloning.
3414         
3415 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3416         
3417         A fix for bug #333342
3418         * class.cs (EventField): Don't mark value type event as synchronized. 
3419         
3420 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3421         
3422         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3423         inference to identify best candidate method correctly.
3424         (ProperyExpr): A range variable is read only and cannot be modified.
3425         
3426 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3427         
3428         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3429         logic to identify best candidate method correctly.
3430         
3431 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3432         
3433         * location.cs (Equals, GetHashCode): Removed.
3434         
3435 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3436         
3437         * report.cs: Implemented message recorder. It is used mainly for lambda
3438         expressions to capture otherwise swallowed error messages.
3439         
3440         * anonymous.cs, lambda.cs.cs: Do full parameters check.
3441
3442         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3443         and not at the top.
3444         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3445                 
3446         * expression.cs (MemberAccess): Always report lookup failure.
3447         
3448         * location.cs: Implemented Equals, GetHashCode.
3449         
3450         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3451         
3452 2007-10-10  Jb Evain  <jbevain@novell.com>
3453
3454         * codegen.cs: re-enable assembly version check.
3455
3456 2007-10-09  Marek Safar  <marek.safar@gmail.com>
3457         
3458         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3459         checks.
3460         
3461         * namespace.cs (UsingAlias): Do correct version check.
3462         
3463 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3464         
3465         * expresison.cs, ecore.cs: Issue extension method error message when
3466         appropriate.
3467         
3468         * rootcontext.cs: Added ISO_2 compiler mode option.
3469
3470 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3471         
3472         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3473          message.
3474         
3475 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3476         
3477         * attribute.cs (GetString, GetBoolean): Work with both literal and
3478         constant.
3479         
3480         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3481         Moved method overload specific methods to MethodGroupExpr.
3482         
3483         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3484         it should be less memory consuming.
3485         
3486 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
3487
3488         * codegen.cs: remove the assembly version check until the buildbot is
3489         fixed.
3490
3491 2007-10-07  Jb Evain  <jbevain@novell.com>
3492
3493         * attribute.cs (Attribute.GetString): if the value
3494         expression is a StringConstant, return its string value.
3495
3496 2007-10-07  Jb Evain  <jbevain@novell.com>
3497
3498         * typemanager.cs: add `assembly_version_attribute_type`.
3499         * codegen.cs: on attribute emission, check that the
3500         AssemblyVersionAttribute doesn't overflow.
3501
3502 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3503         
3504         A fix for bug #324677
3505         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
3506         parent container of a scope container with currently resolved one. 
3507         
3508 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3509         
3510         A fix for bug #325534
3511         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
3512         only.
3513         
3514 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3515         
3516         A fix for bug #327504
3517         * class.cs (Operator.Define): Refactored implicit and explicit user
3518         operator conversion rules.
3519         
3520 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3521         
3522         A fix for bug #327520
3523         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
3524         
3525 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3526         
3527         A fix for bug #328022
3528         * class.cs (MethodData.Define): Use correct method to check whether
3529         a method implementents an accessor.
3530         
3531 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3532         
3533         A fix for bug #330069
3534         * statement.cs (Fixed.Resolve): Read the first array element only when
3535         an array is instantiated. 
3536         
3537 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3538         
3539         * expression.cs, assign.cs, generics.cs: Print correct operator when
3540         compound assignment is used.
3541         
3542 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3543         
3544         A fix for bug #325841
3545         * expression.cs (ArrayAccess): Use full argument cloning only for
3546         string compound concatenation.
3547         
3548 2007-10-03  Marek Safar  <marek.safar@gmail.com>
3549         
3550         A fix for bug #328774
3551         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
3552         assignment.
3553         (PropertyExpr.EmitAssign): Fixed string concatenation compound
3554         assignment.
3555
3556 2007-10-03  Raja R Harinath  <rharinath@novell.com>
3557
3558         Fix #328490
3559         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
3560         Event accessibility checks here.  Remove some bogus code that
3561         accidently made GenericMethods work.
3562         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
3563
3564 2007-09-25  Marek Safar  <marek.safar@gmail.com>
3565         
3566         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
3567         
3568         * statement.cs (Block): Refactored AddVariable to allow error handling
3569         customization.
3570         
3571         * generic.cs: New stub.
3572         
3573 2007-09-23  Marek Safar  <marek.safar@gmail.com>
3574         
3575         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
3576         flag.
3577         
3578 2007-09-17  Marek Safar  <marek.safar@gmail.com>
3579
3580         * class.cs: Use partial container to record whether any partial part
3581         contains static field initializer and therefore default contructor has
3582         to be defined.
3583         
3584 2007-09-14  Marek Safar  <marek.safar@gmail.com>
3585
3586         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
3587         mono-list when only one of two partial parts has defined accessibility
3588         modifier.
3589         
3590 2007-09-14  Marek Safar  <marek.safar@gmail.com>
3591
3592         A fix for bug #82845
3593         
3594         * class.cs (TypeContainer): Set correct resolve context for all field
3595         initializers.
3596         
3597 2007-09-13  Marek Safar  <marek.safar@gmail.com>
3598
3599         * assign.cs: Fixed a crash when field is resolved twice with an error.
3600         
3601         * codegen.cs: Changed InFieldInitializer to be flag.
3602         
3603         * anonymous.cs, ecore.cs, expression.cs: Update after
3604         IsInFieldInitializer rename.
3605         
3606         * const.cs: Removed unused parameter.
3607         
3608         * class.cs: Changed the way how we resolve and emit field initializers.
3609         The field initilizers have to have access to contructor block to emit
3610         compiler generated code.
3611
3612 2007-09-13  Marek Safar  <marek.safar@gmail.com>
3613
3614         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
3615         generics use TypeContainer instead.
3616         
3617 2007-09-12  Marek Safar  <marek.safar@gmail.com>
3618         
3619         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
3620
3621         * lambda.cs (ResolveParameters): Use more powerful
3622         InflateGenericArgument.
3623         
3624         * parameters.cs: Better exception message.
3625                 
3626 2007-09-10  Marek Safar  <marek.safar@gmail.com>
3627
3628         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
3629         correct expression block type. 
3630         
3631         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
3632         
3633         * expression.cs (Invocation): Extracted method group resolve to
3634         DoResolveOverload.
3635         
3636 2007-09-07  Marek Safar  <marek.safar@gmail.com>
3637
3638         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
3639         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
3640         
3641         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
3642         generic extension methods.
3643
3644 2007-09-06  Marek Safar  <marek.safar@gmail.com>
3645
3646         A fix for bug #82676 (Do I get it right now?)
3647         * convert.cs (Binary.ResolveOperator): An interface is converted to the
3648         object before a standard conversion is applied.
3649         
3650 2007-09-06  Marek Safar  <marek.safar@gmail.com>
3651
3652         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
3653         #82676.
3654         
3655 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3656
3657         A fix for bug #82676
3658         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
3659         non-generic interface types.
3660         
3661 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3662
3663         A fix for bug #82690
3664         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
3665         
3666 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3667
3668         A fix for bug #82571
3669         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
3670         modifier for container based methods.
3671         
3672 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3673
3674         A fix for bug #82676
3675         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
3676         any interface-type T means to any of interface type T.
3677
3678 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3679
3680         * namespace.cs: We have 2 versions of System.Core assembly.
3681
3682 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3683
3684         A fix for bug #82652
3685         * class.cs (Class.GetClassBases): Compare types and not expressions.
3686
3687 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3688
3689         A fix for bug #82620
3690         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
3691         actually never worked before.
3692         (IndexerAccess): Emit prepared arguments before they are modified.
3693         
3694 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3695
3696         A fix for bug #82563
3697         * assign.cs: Revert wrong fix.
3698         
3699         * expression.cs (VariableReference.EmitAssign): Handle ref reference
3700         correctly.
3701         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
3702         Instead of ldelema/stdind we have to use temporary variables to handle
3703         cases like String.Concat (params string[]).
3704         
3705 2007-08-31  Marek Safar  <marek.safar@gmail.com>
3706
3707         * class.cs: EmitAttributes to Emit rename.
3708         
3709         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
3710         null.
3711         (MemberCore.HasClsCompliantAttribute): Don't depend on 
3712         GetClsCompliantAttributeValue execution.
3713         
3714 2007-08-31  Marek Safar  <marek.safar@gmail.com>
3715
3716         * anonymous.cs: Use shorter type prefix.
3717         
3718         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
3719         when exist.
3720         
3721         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
3722         variables when probing is on.
3723         
3724         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
3725         unresolved variables.
3726         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
3727         handle transparent identifiers.
3728         
3729 2007-08-26  Marek Safar  <marek.safar@gmail.com>
3730
3731         * attribute.cs (IsClsCompliant): Add nullable types test.
3732         
3733 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3734
3735         * doc.cs : catch other types of exception than XmlException to
3736           report CS1570. Fixed bug #82565.
3737
3738 2007-08-23  Marek Safar  <marek.safar@gmail.com>
3739
3740         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
3741         The number of delegate parameters has to match.
3742         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
3743         arrays.
3744
3745 2007-08-21  Marek Safar  <marek.safar@gmail.com>
3746
3747         * anonymous.cs (AnonymousMethod): Generate private anonymous method
3748         to fix problem with private arguments.
3749
3750 2007-08-20  Marek Safar  <marek.safar@gmail.com>
3751
3752         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
3753         
3754         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
3755         
3756         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
3757         empty. Add cloning suport.
3758         
3759         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
3760
3761 2007-08-20  Marek Safar  <marek.safar@gmail.com>
3762
3763         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
3764         to create EmptyCast. It handles EmptyConstantCast specialization for
3765         constants.
3766         
3767 2007-08-18  Marek Safar  <marek.safar@gmail.com>
3768
3769         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
3770         (EmitArrayArgument): One routine for array arguments.
3771         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
3772         
3773 2007-08-17  Marek Safar  <marek.safar@gmail.com>
3774
3775         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
3776
3777 2007-08-17  Marek Safar  <marek.safar@gmail.com>
3778
3779         * anonymous.cs: MemberLookupFinal update.
3780
3781         * class.cs (ConstructorInitializer): Is expression based.
3782         
3783         * delegate.cs: MethodGroupExpr update.
3784         
3785         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
3786         messages.
3787         (Error_MemberLookupFailed): Customizable error override.
3788         (MethodGroupExpr): Keep queried type for later usage.
3789         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
3790         resolve.
3791         
3792         * expression.cs: Error_MemberLookupFailed refactoring.
3793         (New.DoResolve): Resolve as much as possible.
3794         (ElementInitializer.Error_MemberLookupFailed): Object initializer
3795         customization for invalid member types.
3796
3797         * statement.cs: MethodGroupExpr update.
3798         
3799 2007-08-16  Marek Safar  <marek.safar@gmail.com>
3800
3801         * modifier.cs (Check): Check all modifiers and not only accessibility
3802         ones.
3803
3804 2007-08-16  Marek Safar  <marek.safar@gmail.com>
3805
3806         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
3807         type and not an expression.
3808
3809 2007-08-16  Marek Safar  <marek.safar@gmail.com>
3810
3811         * statement.cs (Catch.Clone): Type and variable can be null.
3812
3813 2007-08-16  Marek Safar  <marek.safar@gmail.com>
3814
3815         A fix for bug #81979
3816         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
3817         I am really not sure whether this is the best fix.
3818         
3819         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
3820         only once.
3821         
3822 2007-08-14  Marek Safar  <marek.safar@gmail.com>
3823
3824         ** C# 3.0 Object and collection initializers (major re-write)
3825         
3826         * assign.cs (DoResolve): Initializers are not assign related.
3827         
3828         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
3829         used during collection or object initialization.
3830         
3831         * expression.cs (Error_InvalidArguments): Add initializers specific
3832         messages. More will come later because it requires some general
3833         refactoring.
3834         (New.DoResolve): Better error handling for unsafe types.
3835         (EmptyExpressionStatement): New class.
3836         (ElementInitializer): An object initializer expression.
3837         (CollectionElementInitializer): A collection initializer expression.
3838         (CollectionOrObjectInitializers): A block of object or collection
3839         initializers.
3840         (NewInitialize): New expression with element/object initializers.
3841         
3842         * statement.cs: Reverted object/collection initializer hacks.
3843         
3844         * typemanager.cs (CSharpName): Filter __arglist type.
3845         
3846 2007-08-09  Marek Safar  <marek.safar@gmail.com>
3847
3848         ** C# 3.0 Anonymous Types (update to the latest standard)
3849         
3850         * expression.cs (Binary.ResolveOperator): Threat all null based types
3851         same.
3852         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
3853         (AnonymousTypeParameter): Updated.
3854         
3855         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
3856         (AnonymousTypeClass): New anonymous type container.
3857         
3858         * class.cs (AddField): Return operation result.
3859         
3860         * generic.cs: Another empty TypeArguments overload.
3861         
3862         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
3863         are stored at top of normal hierarchy.
3864         
3865         * typemanager.cs (CSharpName): Filter anonymous types.
3866         
3867 2007-08-09  Marek Safar  <marek.safar@gmail.com>
3868
3869         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
3870         as single Concat call. How could we miss that :-(
3871         
3872 2007-08-08  Marek Safar  <marek.safar@gmail.com>
3873
3874         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
3875         
3876 2007-08-07  Miguel de Icaza  <miguel@novell.com>
3877
3878         * expression.cs: Fix the previous commit, the creation of the
3879         arguments array list needs also to be conditional on the arguments
3880         not being null.
3881
3882         * class.cs: Add a little bit of help to help narrow down problems.
3883
3884         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
3885         not try to copy in that case. 
3886
3887         * driver.cs: When building SMCS, include a new different set of
3888         default assemblies here.   Do this here so we can control whether
3889         to include the default assemblies with /noconfig.
3890
3891 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3892
3893         A fix for bug #81979
3894         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
3895         only.
3896
3897 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3898
3899         A fix for bug #82300
3900
3901         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
3902         we are in probing scope.
3903
3904 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3905
3906         A fix for bug #82301
3907
3908         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
3909         (Statement.CloneTo): Clone and not map children blocks.
3910
3911 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3912
3913         A fix for bug #82299
3914
3915         * expression.cs (LocalVariableReference.CloneTo): Remap local info
3916         variable too.
3917         
3918         * statement.cs (Statement.CloneTo): Clone variables before statements
3919         to allow remaping of local variables.
3920
3921 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3922
3923         A fix for bug #82296
3924
3925         * anonymous.cs,
3926         * report.cs: Log crash details for future clone problems.
3927         
3928         * statement.cs (Return.Clone): Don't clone non-existent expression.
3929
3930 2007-08-03  Raja R Harinath  <harinath@gmail.com>
3931
3932         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
3933         (Class.AddBasesForPart): Move CS0537 check here from ...
3934         * cs-parser.jay (class_declaration): ... here.  Move calling of
3935         'AddBasesForPart' to ...
3936         (class_bases): ... here.
3937         (struct_declaration, interface_declaration): Update to changes.
3938
3939 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3940
3941         A fix for bug #81923
3942
3943         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3944         conversion is allowed.
3945
3946 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3947
3948         A fix for bug #81564
3949
3950         * ecore.cs (EventExpr): Add IsBase handling.
3951
3952         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3953         too.    
3954         
3955 2007-08-02  Raja R Harinath  <harinath@gmail.com>
3956
3957         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3958         * cs-parser.jay: Some whitespace cleanups.
3959         (current_delegate): New.
3960         (type_name): New.
3961         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3962         a dummy code block, and use 'type_name' instead of 'member_name'.
3963         (interface_declaration, class_declaration): Likewise.
3964         (delegate_declaration): Likewise.  Rearrange slightly and use
3965         'current_delegate'.
3966         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3967         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
3968
3969 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3970
3971         A fix for bug #82039
3972
3973         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3974         available.
3975
3976         * typemanager.cs (CSharpName): Split to string overload.
3977
3978 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3979
3980         * expression.cs,
3981         * report.cs: Updated warning CS0472.
3982
3983 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3984
3985         A fix for bug #82181
3986         * cs-parser.jay,
3987         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3988
3989 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3990
3991         A fix for bug #82277
3992         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3993
3994 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3995
3996         ** C# 3.0 Type Inference (major bits are working)
3997         
3998         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3999         (.ImplicitStandardConversionExists): Uses compatible.
4000         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4001         (.InferReturnType): New method.
4002         (.Compatible): Refactored.
4003         (.ResolveParameters): Uses factory to create resolved parameters.
4004         (.CompatibleMethod): Add probing mode support.
4005         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4006         clearly distinguish between 2 different operations.
4007         (LambdaMethod): Moved to lambda.cs.
4008         (AnonymousMethod): Removed unused fields and methods.
4009         (AnonymousDelegate): Simplified.
4010         
4011         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4012         
4013         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4014         
4015         * delegate.cs (Delegate): New mehods to reduce code duplication.
4016         (.GetConstructor): New method.
4017         (.GetInvokeMethod): New method.
4018         (DelegateCreation): Updated.
4019         
4020         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4021         does not exist.
4022         (OverloadResolve): Made probing little bit faster.
4023         
4024         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4025         when probing is on.
4026         
4027         * generic.cs (TypeInferenceContext): Dummy implementation.
4028         
4029         * iterators.cs: Updated after Resolve/Define rename.
4030         
4031         * lambda.cs (LambdaExpression)
4032         (.ResolveParameters): Handles both type of arguments and type inference too.
4033         
4034         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4035         (InflateTypes): Updated.
4036         
4037         * support.cs (InflateTypes): Changed signature and updated.
4038         
4039         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4040         (MemberLookup_FindMembers): More MS tricks.
4041         (GetParameterData): Ditto.
4042         (GetDelegateParameters): Uses quick path for dynamic types.
4043         
4044 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4045
4046         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4047         only.
4048
4049 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4050
4051         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4052         syntax.
4053         
4054 2007-07-26  Jb Evain  <jbevain@novell.com>
4055
4056         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4057         which takes a boolean 'report_errors', similar to the GetMethod.
4058         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4059         in .net 2.1, do not report errors here.
4060
4061         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4062         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4063         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4064         in .net 2.1.
4065
4066         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4067         of the type InternalsVisibleToAttribute before the first call
4068         to CoreLookupType which is allowed to fail (third boolean parameter
4069         to true). Because, during the resolution for a type that is not
4070         immediately found, we try to check if the type is not defined in
4071         a friend assembly, and to do so, we need the
4072         InternalVisibleToAttribute.
4073
4074 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4075
4076         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4077         feature that allows structs to be compared against null and inline
4078         the result as true or false.
4079
4080         Notice that the same code is not permitted inside a generic block
4081         of code that would do:
4082
4083         class Foo<T> where T : struct {
4084             bool Eval (T x)
4085             {
4086                  return x == null;
4087             }
4088         }
4089
4090         It is only allowed if the type of T is not bound (no where
4091         clause).   In my opinion, this CSC 2 behavior is broken but people
4092         seem to be using it (IronRuby does, a few bug reports on bugzilla
4093         have it and some people have complained about it).
4094
4095         All of the users that depend on this behavior have code that is
4096         very likely broken. 
4097         
4098         * report.cs (Warning, Error): make these take object arguments,
4099         not strings, as that allows us to take advantage of Format.
4100
4101 2007-07-20  William Holmes  <billholmes54@gmail.com>
4102
4103         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4104           Left member variable for the Count.
4105         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4106           MemberName.CountTypeArguments to avoid a NRE. 
4107
4108         This code is contributed under the MIT X11 license
4109
4110 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4111
4112         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4113
4114 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4115
4116         * doc.cs : generic method arguments are written as ``x while generic
4117           type arguments are `x. Combined with the previous change, fixed bug
4118           #79706.
4119
4120 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4121
4122         Fix #82120
4123         * expression.cs (Binary.ResolveOperator): When converting
4124         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4125
4126 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4127
4128         * doc.cs : when T: or whatever x: is specified, it does not really
4129           check the doc comment's syntax correctness. Fixed bug #82006.
4130
4131 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4132
4133         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4134         LambdaExpression better.
4135         
4136         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4137         
4138         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4139         
4140         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4141         as it can be generated.
4142         
4143         * expression.cs (Invocation.Error_InvalidArguments): Show correct
4144         modifiers.
4145         
4146         * lambda.cs (LambdaExpression): Refactored to share same code with
4147         AnonymousMethodExpression.
4148         
4149 2007-07-17  Marek Safar  <marek.safar@gmail.com>
4150
4151         * anonymous.cs (MakeName): Include host name for easier debugging.
4152         (LambdaMethod): New class for lambda spcecific stuff.
4153         
4154         * attribute.cs: Set EmitContext return type.
4155
4156         * class.cs: Set EmitContext return type.
4157         
4158         * codegen.cs (EmitContext): Return type cannot be null to stop messing
4159         with null/void meaning.
4160         
4161         * iterators.cs (ContainerType): Implemented.
4162         
4163         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4164         
4165         * statement.cs (Return): Updated to lambda expressions.
4166         (Block.CloneTo): Parent can be null.
4167                 
4168 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4169
4170         A fix for bug #81917
4171         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4172         
4173         * class.cs (FixedField): Check whether field is in unsafe scope.
4174
4175         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4176         (FieldExpr.Emit): Fixed buffers cannot be volatile.
4177
4178         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4179         FieldExpr.
4180         
4181         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4182                 
4183 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4184
4185         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4186         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4187         from Report class.
4188
4189 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4190
4191         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4192         
4193 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4194
4195         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4196         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4197         
4198         * codegen.cs(EmitContext): Add ProbingMode flag.
4199         
4200         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4201         
4202         * driver.cs: For now set both warning values.
4203         
4204         * ecore.cs (SimpleName): Name is readonly.
4205         (MethodGroup.OverloadResolve): One quick path for probing.
4206         
4207         * expression.cs (Unary): Set Oper r/o.
4208         (Binary): Set Oper r/o.
4209         (ParameterReference): Set few instance variables as r/o.
4210         (ParameterReference.DoResolveBase): Don't capture aruments when 
4211         the probing is on.
4212         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4213         (Arglist): arguments are private.
4214         (SizeOf): type is private and r/o.
4215         (MemberAccess): arguments are private.
4216
4217         * report.cs: Enhanced reporting on/off capabilities.
4218         
4219         * lambda.cs: Uses ec.IsInProbingMode.
4220         (ContextualReturn): Derives from return.
4221         
4222         * rootcontext.cs: For now set both warning values.
4223         
4224         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4225         copy if one exists.
4226         (Return.Resolve): Don't die immediately.
4227         (Block.Resolve): Speed-up probing.
4228         (Block.CloneTo): Clone only child blocks.
4229
4230 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4231
4232         * iterators.cs: reverted Miguel's latest change (r81925) as it
4233         breaks the build in System.
4234
4235 2007-07-13  Miguel de Icaza  <miguel@novell.com>
4236
4237         * iterators.cs (Yield.CheckContext): Check for the iterator type
4238         also here as we can call into Yield even in codepaths that are not
4239         directly checked by
4240         (MethodOrOperator is the only path that was checked).
4241
4242         In addition to the standard check, use a more specific check for
4243         constructors to report a more verbose error. 
4244
4245 2007-07-12  Miguel de Icaza  <miguel@novell.com>
4246
4247         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4248         report the warning and continue 
4249
4250         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4251         values on the stack on the call to Emit.   Use EmitStatement if
4252         possible, or using Emit + Pop if not possible.   Fixes #82064
4253
4254 2007-07-12  Raja R Harinath  <rharinath@novell.com>
4255
4256         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4257         avoid try...finally in some cases.
4258
4259 2007-07-10  Marek Safar  <marek.safar@gmail.com>
4260
4261         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4262         
4263         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4264         instead of method. Re-use standard error handling.
4265         (ConstructorInitializer.Emit): Simplified.
4266         
4267         * delegate.cs: Updated after Invocation.EmitCall change.
4268         
4269         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4270         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4271         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4272         method and don't permanently changing input arguments.
4273         (MethodGroupExpr): Introduced resolved best_candidate, when method group
4274         is resolved it has one of the candidates is the best one which is later
4275         used to emit. Removed a few unused method.
4276         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4277
4278         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4279         (Binary.ResolveOperator): Ditto.
4280         (ConditionalLogicalOperator.DoResolve): Ditto.
4281         (Invocation): Uses method group.
4282         (Invocation.DoResolve): Simplified.
4283         (Invocation.EmitCall): Removed useless is_static.
4284         (Invocation.Emit): Delegate to method group.
4285         (Invocation.EmitStatement): Simplified.
4286         (New): Uses method group.
4287         (MemberAccess.DoResolve): Don't destroy original expression.
4288         
4289         * statement.cs (ForEach.Resolve): Use null for no method arguments.
4290         
4291 2007-07-04  Marek Safar  <marek.safar@gmail.com>
4292
4293         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4294         
4295         * anonymous.cs,
4296         * lambda.cs: Add custom error message type.
4297
4298 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4299
4300         * lambda.cs: Simplified little bit.
4301         
4302         * parameter.cs: Introduced ImplicitLambdaParameter.
4303         (Parameters.CreateFullyResolved): New factory instead of ctor.
4304         
4305         * anonymous.cs,
4306         * class.cs,
4307         * delegate.cs: Updated parameter creation.
4308         
4309 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4310
4311         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4312         arguments.
4313         
4314         * generic.cs: Synchronized with gmcs.
4315         
4316 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4317
4318         * class.cs (Indexer): Check return type as soon as possible.
4319         
4320         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4321         members too.
4322         
4323         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4324         
4325         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4326         
4327         * parameter.cs (Parameter): Use expression type when it is available.
4328         
4329         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4330         method modifier for the first parameter only.
4331
4332 2007-06-24  Marek Safar  <marek.safar@gmail.com>
4333
4334         A fix for bug #81938
4335         * typemanager.cs (ChangeType): Fixed couple of char conversions.
4336         
4337         * constant.cs: Tide up an exception message.
4338
4339 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4340
4341         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4342         an uninitialized variable is used.
4343         
4344         * expression.cs (LocalVariableReference.DoResolve): Ditto.
4345
4346 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4347
4348         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4349         not found error handling.
4350
4351         * expression.cs (ArrayCreation): Removed redundant fields and little bit
4352         simplified.
4353         (ArrayCreation.ResolveArrayElement): To be ready to customization.
4354         (ArrayCreation.DoResolve): Simplified.
4355         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4356         its own resolve process.
4357         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4358
4359 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4360
4361         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4362         more error details.
4363         
4364 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4365
4366         * cs-tokenizer.cs: Removed var related stuff.
4367         
4368         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4369         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4370         a type and a keyword at same time.
4371         
4372         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4373         matches to "var".
4374         
4375         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4376         implicitly typed arrays, more changes will follow.
4377         
4378         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4379         
4380 2007-06-19  Marek Safar  <marek.safar@gmail.com>
4381
4382         * ecore.cs (VarExpr): Removed Handled field.
4383         
4384         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4385         build-in assign functionality.
4386         (ForEach.Resolve): Removed all implicitly typed local variable code and
4387         simplified.
4388         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4389         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4390
4391 2007-06-18  Marek Safar  <marek.safar@gmail.com>
4392
4393         * assign.cs: Removed implicitly typed local variable check.
4394         
4395         * expression.cs (LocalVariableReference.DoResolve): Add check for self
4396         referencing implicitly typed local variable.
4397         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4398         variable here.
4399         
4400         * statement.cs (Fixed): Removed unsupported implicitly typed local
4401         variable code.
4402
4403 2007-06-15  Marek Safar  <marek.safar@gmail.com>
4404
4405         * decl.cs (MemberName): Moved all Unbound stuff to parser.
4406
4407 2007-06-14  Marek Safar  <marek.safar@gmail.com>
4408
4409         A fix for bugs #81855 and #76274
4410         * attribute.cs (AttachTo): Always set owner for global attributes to
4411         prefined owner.
4412         
4413         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4414         usefull too.
4415         
4416         * cs-parser.jay: Assembly and module attributes must precede all other
4417         elements except using clauses and extern alias declarations.
4418
4419 2007-06-13  Marek Safar  <marek.safar@gmail.com>
4420
4421         A fix for bug #81748
4422         * cs-tokenizer.cs,
4423         * expression.cs: More checks for non ISO-1 features.
4424
4425 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4426
4427         A fix for bug #81807
4428         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4429         present inside switch statement and it is required by nullable check.
4430
4431 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4432
4433         A fix for bug #81840
4434         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4435         when type matching fails.
4436         
4437         * namespace.cs: Tiny error message change.
4438
4439 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4440
4441         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4442         reporting. Added automatic property check.
4443         
4444         * class.cs: Updated after CheckAbstractAndExtern relocation.
4445         (AEventPropertyAccessor.GetSignatureForError): Customized.
4446         
4447 2007-06-11  Marek Safar  <marek.safar@gmail.com>
4448
4449         * class.cs (DefineBaseTypes): Base type can be undefined.
4450         
4451         * ecore.cs (TypeLookup): Minor refactoring.
4452         (DoResolveAsTypeStep): Removed redundant check.
4453
4454         * namespace.cs (Lookup): Removed redundant check.
4455                 
4456         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
4457         ResolveAsTypeTerminal step.
4458         (BootstrapCorlib_*): Simplified.
4459         (PopulateCoreType): Core types can be now external.
4460
4461 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4462
4463         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4464          verification only.
4465          (InferTypeArguments): Infers anonymous expression type arguments.
4466          (Compatible): Split to Compatible and InferTypeArguments. 
4467         
4468         * lambda.cs: Updated.
4469
4470 2007-06-08  Marek Safar  <marek.safar@gmail.com>
4471
4472         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4473
4474 2007-06-07  Raja R Harinath  <harinath@gmail.com>
4475
4476         Fix #80477, cs0135-2.cs, cs0135-3.cs
4477         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4478         names to the "known" variables list.
4479         (Block.CheckInvariantMeaningInBlock): Handle the fact the
4480         parameter names are also "known".
4481         (Block.CheckError136): Remove.
4482         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
4483         null.
4484
4485 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4486
4487         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
4488
4489 2007-06-06  Marek Safar  <marek.safar@gmail.com>
4490
4491         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4492         internal error not an user error.
4493          
4494         * expression.cs (IsApplicable): Refactored to make debugging easier.
4495
4496         * support.cs: More tricks for non-mono runtimes.
4497         
4498         * typemanager.cs (CoreLookupType): Made public.
4499         (InitSystemCore): All linq specific stuff moved to linq.cs
4500
4501 2007-06-05  Marek Safar  <marek.safar@gmail.com>
4502
4503         * typemanager.cs (CSharpSignature): One more missing build-in types
4504         replacement.
4505         More tricks for non-mono runtime.
4506
4507 2007-06-05  Raja R Harinath  <harinath@gmail.com>
4508
4509         * statement.cs (Block.CheckError136_InParents): Remove.
4510         (Block.AddVariable): Use GetParameterInfo instead.
4511         (ToplevelBlock.ProcessArguments): Likewise.
4512
4513 2007-06-04  Raja R Harinath  <rharinath@novell.com>
4514
4515         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
4516         information too.
4517         (ToplevelBlock.GetParameterInfo): Split out of ...
4518         (ToplevelBlock.GetParameterRefernce): ... this.
4519         (ToplevelBlock.ParameterMap): Remove.
4520         * expression.cs (ParameterReference): Update to use
4521         ToplevelParameterInfo.
4522
4523         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
4524         regression.
4525
4526         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
4527         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
4528
4529         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
4530         (ToplevelBlock.ProcessParameters) ... here.
4531         (ToplevelBlock..ctor): Invoke it.
4532
4533         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
4534         new parameters.
4535
4536         * statement.cs (IKnownVariable): New interface.
4537         (LocalInfo): Implement it.
4538         (ToplevelParameterInfo): New class.
4539         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
4540         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
4541         GetKnownVariableInfo.
4542
4543 2007-06-03  Raja R Harinath  <harinath@gmail.com>
4544
4545         Partly speed up CS0136 error checks.
4546         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
4547         'recurse' parameter.
4548         (Block.DoCheckError136): Only check errors in parameters.  Move
4549         local variable checks ...
4550         (Block.AddVariable): ... here, and ...
4551         (ToplevelBlock.ResolveMeta): ... here.
4552
4553 2007-06-02  Raja R Harinath  <harinath@gmail.com>
4554
4555         * statement.cs (Block.IsChildOf): Remove.
4556
4557         * statement.cs (Statement.Clone): Move special case code ...
4558         (Block.CloneTo): ... here.
4559
4560 2007-05-29  Raja R Harinath  <rharinath@novell.com>
4561
4562         * statement.cs (ToplevelBlock.container): Remove field.  It's
4563         redundant with 'Parent'.
4564         (ToplevelBlock.ContainerBlock): Remove accessor.
4565         (ToplevelBlock..ctor): Update to changes.  Register anonymous
4566         child with parent here, ...
4567         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
4568         current_block.
4569         (start_anonymous): Don't save current_block.
4570         (top_current_block): Remove.
4571
4572         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
4573         (Block.Resolve): Update to changes.
4574         (Block..ctor): Move setting of "correct" 'Toplevel'
4575         and 'Explicit' fields to ...
4576         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
4577
4578 2007-05-27  Raja R Harinath  <harinath@gmail.com>
4579
4580         Kill Block.Implicit
4581         * statement.cs (Block.Implicit): Remove.
4582         (Block): Update to changes.
4583         * flowanalysis.cs: Likewise.
4584
4585         Mildly speed up CheckInvariantMeaningInBlock
4586         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
4587         Recursively call AddKnownVariable to all enclosing blocks.
4588         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
4589         Remove recursive calls.
4590         (Block): Update to changes.
4591
4592         New ExplicitBlock invariants
4593         * statement.cs (Block.Explicit): New field.  It points to the
4594         immediately enclosing non-implicit block.
4595         (Block..ctor): Maintain the invariant.
4596         * cs-parser.jay: Take advantage of invariant.
4597
4598         Introduce ExplicitBlock
4599         * statement.cs (ExplicitBlock): New.
4600         (ToplevelBlock): Derive from it.
4601         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
4602         sense of flag.
4603         (Block.Implicit): Update to changes.
4604         * cs-parser.jay: Update to changes.
4605
4606         Remove unused field
4607         * codegen.cs (EmitContext.IsLastStatement): Remove.
4608         * statement.cs (Block.DoEmit): Update to changes.
4609
4610 2007-05-25  Raja R Harinath  <rharinath@novell.com>
4611
4612         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
4613         modifying current_block directly.
4614
4615 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
4616         
4617         * class.cs: Implemented automatic properties (C# 3.0)
4618           Thanks to Marek for the help.
4619
4620 2007-05-23  Raja R Harinath  <rharinath@novell.com>
4621
4622         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
4623         variable as assigned, note also that all its components are
4624         assigned too.
4625         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
4626
4627 2007-05-19  Marek Safar  <marek.safar@gmail.com>
4628
4629         * anonymous.cs, class.cs: Emit Compiler generated attribute when
4630         member is marked as compiler generated.
4631         
4632         * decl.cs (MemberCore): Refactored ModFlags into property.
4633
4634         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
4635         (Check): Check only accessibility modifiers.
4636
4637 2007-05-18  Raja R Harinath  <rharinath@novell.com>
4638
4639         Track all assignable slots in one bit array
4640         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
4641         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
4642         logic from VariableMap constructor here.  Use the same 'offset'
4643         variable that's later used for computing offsets of local
4644         variables.
4645         * flowanalysis.cs (UsageVector.parameters): Remove.
4646         (UsageVector): Update to changes.
4647         (VariableMap): Remove.
4648
4649         Avoid creating ParameterMap in every block
4650         * statement.cs (Block.ParameterMap): Move ...
4651         (ToplevelBlock.ParameterMap): ... here.
4652         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
4653         only once.
4654         * flowanalysis.cs (FlowBranching.param_map): Remove.
4655         (FlowBranching.UsageVector): Update to changes.
4656         (FlowBranchingToplevel.CheckOutParameters): Likewise.
4657
4658         * statement.cs (Block.CloneTo): Clone Toplevel field too.
4659
4660         * expression.cs (ParameterReference): Distinguish between block
4661         where parameter was referenced and declared.
4662
4663 2007-05-18  Marek Safar  <marek.safar@gmail.com>
4664
4665         * flowanalysis.cs, statement.cs: Put back improved error handling.
4666
4667 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
4668         
4669         * assign.cs:
4670         * expression.cs:
4671           Imporved object and collection initialization (C# 3.0).
4672
4673 2007-05-15  Marek Safar  <marek.safar@gmail.com>
4674
4675         A fix for bug #81380
4676         * expression.cs (Is.DoResolve): Only value types have constant `is'
4677         behaviour.
4678
4679 2007-05-15  Raja R Harinath  <rharinath@novell.com>
4680
4681         * statement.cs (ToplevelBlock.child): Remove.
4682
4683 2007-05-15  Raja R Harinath  <harinath@gmail.com>
4684
4685         Rationalize ResolveMeta: refactoring
4686         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
4687         out constant handling code into ...
4688         (Block.DoResolveConstants): ... this.
4689
4690         Rationalize ResolveMeta: kill local_map
4691         * statement.cs (Block.local_map, Block.LocalMap): Remove.
4692         (Block.AssignableSlots): New.
4693         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
4694         for locals -- move code from VariableMap here.  Avoid unnecessary
4695         allocations.
4696         * flowanalysis.cs (FlowBranching.local_map): Remove.
4697         (FlowBranching..ctor): Use Block.AssignableSlots.
4698         (VariableMap): Remove unused constructors.
4699
4700 2007-05-11  Raja R Harinath  <rharinath@novell.com>
4701
4702         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
4703
4704 2007-05-11  Marek Safar  <marek.safar@gmail.com>
4705
4706         * typemanager.cs (IsFriendAssembly): Should not be called for building
4707         assembly.
4708
4709 2007-05-09  Marek Safar  <marek.safar@gmail.com>
4710
4711         * literal.cs (NullConstant): Print null in all cases.
4712         
4713         * expression.cs (Binary.ResolveOperator): Implemented delegate
4714          comparison based on C# 2.0 changes.
4715
4716 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
4717
4718         This code is contributed under the MIT X11 license
4719         
4720         The following enables support for several C# 3.0 language features:
4721         
4722         * cs-tokenizer.cs: Added support for the "var" keyword.
4723         
4724         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
4725           Added VarExpr class to facilitate type inferencing.
4726         
4727         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
4728           to support anonymous types.
4729         
4730         * assign.cs: Added support for type inferencing and initialization.
4731         
4732         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
4733         
4734         * expression.cs: Added implicit array support to ArrayCreation.
4735           Added 5 types and 1 interface:
4736           
4737           IInitializable                Implementing classes can inject initializing
4738                                         statements after object instantiation.
4739           
4740           Initializer                   Stores data for object initialization.
4741           
4742           AnonymousType                 An expression for anonymous types.
4743           
4744           AnonymousTypeParameter        Stores data about an anonymous type's field.
4745           
4746           NewInitialize                 An expression for object initialization.
4747           
4748           CollectionInitialize          An expression for collection initialization.
4749         
4750         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
4751           statements.
4752
4753 2007-05-06  Marek Safar  <marek.safar@gmail.com>
4754
4755         A fix for bug #81500
4756         * cs-tokenizer.cs: Add special handling for coalescing operator.
4757
4758 2007-05-06  Marek Safar  <marek.safar@gmail.com>
4759
4760         A fix for bug #81529
4761         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
4762         its value from base class until it is redefined.
4763
4764 2007-05-02  Raja R Harinath  <rharinath@novell.com>
4765
4766         Fix regression in cs0631-3.cs
4767         * cs-parser.jay (operator_declarator): Add opt_attributes to error
4768         fallback.  Make error fallback catch more cases.
4769
4770 2007-05-01  Miguel de Icaza  <miguel@novell.com>
4771
4772         * cs-parser.jay: Allow parameters in operator declarations to have
4773         attributes. 
4774
4775 2007-04-27  Miguel de Icaza  <miguel@novell.com>
4776
4777         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
4778         exists. 
4779
4780         * lambda.cs (ContextualReturn.Resolve): An expression is valid
4781         inside the ContextualReturn, it does not have to be an
4782         ExpressionStatement. 
4783
4784 2007-04-24  Miguel de Icaza  <miguel@novell.com>
4785
4786         * lambda.cs (ContextualReturn.Resolve): if the return type is not
4787         set, set it.
4788
4789 2007-04-23  Miguel de Icaza  <miguel@novell.com>
4790
4791         * anonymous.cs (AnonymousContainer): split the virtual Resolve
4792         method in two methods: ResolveNoDefine and Resolve.
4793
4794         ResolveNoDefine will stop just after ResolveTopBlock has been
4795         called.   
4796
4797         Resolve will then continue by creating a method and issuing the
4798         call to method.Define ().
4799
4800         (AnonymousMethod): Split and implement the new Resolve and
4801         ResolveNoDefine as well.
4802
4803         * lambda.cs (LambdaExpression): Split the anonymous method
4804         resolution code into a separate routine (CoreCompatibilityTest)
4805         from DoCompatibleTest.
4806
4807         (LambdaExpression.TryBuild): New method, this method tries to
4808         build the LambdaExpression with the given set of types to be used
4809         as the types for the various parameters of the lambda expression. 
4810
4811         If the compilation succeed with the given types, the infered type
4812         of the Anonymous method is returned, otherwise null is returned.
4813
4814 2007-04-23  Marek Safar  <marek.safar@gmail.com>
4815
4816         A fix for bug #81414
4817         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
4818
4819 2007-04-22  Miguel de Icaza  <miguel@novell.com>
4820
4821         * cs-tokenizer.cs: Change various identifiers here from the
4822         camelCasing to the recommended Linux-like style for instance
4823         variables from the Coding Guidelines. 
4824
4825 2007-04-19  Martin Baulig  <martin@ximian.com>
4826
4827         * convert.cs
4828         (Convert.ImplicitReferenceConversionCore): Allow conversions from
4829         System.Enum to System.ValueType.
4830
4831 2007-04-13  Martin Baulig  <martin@ximian.com>
4832
4833         Rewrote implicit reference conversions.  We need to distinguish
4834         between implicit reference conversions (13.1.4) and implicit
4835         boxing conversions (13.1.5).
4836
4837         According to the spec, there's an an implicit conversion
4838         "From a one-dimensional array-type S[] to IList<T> and base
4839         interfaces of this interface, provided there is an implicit
4840         reference conversion from S to T."  Note that this does not
4841         include boxing conversions.
4842
4843         * convert.cs
4844         (Convert.ImplicitTypeParameterBoxingConversion): New method.
4845         (Convert.ImplicitReferenceConversion): Split into
4846         ImplicitReferenceConversionCore() and
4847         ImplicitBoxingConversionExist().
4848         (Convert.ImplicitReferenceConversionExists): Use the new
4849         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
4850
4851 2007-04-12  Martin Baulig  <martin@ximian.com>
4852
4853         * convert.cs (Convert.ImplicitReferenceConversion): Move the
4854         `TypeManager.null_type' checks up to the top of the method.
4855
4856 2007-04-11  Marek Safar  <marek.safar@gmail.com>
4857
4858         A fix for bug #81350
4859         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
4860         extension methods.
4861
4862 2007-04-11  Martin Baulig  <martin@ximian.com>
4863
4864         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
4865         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
4866         to make this work for generic classes; fixes #79561.
4867
4868 2007-04-11  Martin Baulig  <martin@ximian.com>
4869
4870         * expression.cs (As): Add support for nullable types; fixes #79371.
4871
4872 2007-04-11  Martin Baulig  <martin@ximian.com>
4873
4874         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
4875         `type.FullName' is null; fixes #80243.
4876
4877 2007-04-11  Martin Baulig  <martin@ximian.com>
4878
4879         * expression.cs (Invocation.IsApplicable): Don't modify the method
4880         if type inference succeeded, but the method was not applicable.
4881         Fixes #81250.
4882
4883 2007-04-10  Marek Safar  <marek.safar@gmail.com>
4884
4885         A fix for bug #81324
4886         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
4887         internal and external namespaces containers.
4888
4889 2007-04-10  Martin Baulig  <martin@ximian.com>
4890
4891         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
4892         TypeManager.DropGenericMethodArguments() so we also call
4893         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
4894
4895 2007-04-10  Martin Baulig  <martin@ximian.com>
4896
4897         * iterators.cs (Iterator.CreateIterator): Don't crash if
4898         `method.ReturnType' is null.  This happens if something went wrong
4899         while resolving that typ (we already reported an error in this case).
4900
4901 2007-04-10  Martin Baulig  <martin@ximian.com>
4902
4903         * expression.cs (New.DoResolve): Don't call CheckComImport() on
4904         generic interfaces; report the CS0144 directly.
4905
4906 2007-04-10  Martin Baulig  <martin@ximian.com>
4907
4908         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
4909         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
4910
4911 2007-04-10  Martin Baulig  <martin@ximian.com>
4912
4913         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
4914
4915 2007-04-09  Raja R Harinath  <rharinath@novell.com>
4916
4917         A better fix
4918         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
4919         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
4920
4921         Fix #81338
4922         * statement.cs (For.Resolve): If resolution fails, use
4923         KillFlowBranching.
4924
4925 2007-04-08  Marek Safar  <marek.safar@gmail.com>
4926
4927         * anonymous.cs (MakeName): Make faster and zero-based.
4928         (VerifyExplicitParameterCompatibility): Back to mode where generic
4929         parameter is ignored.
4930         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
4931
4932         * class.cs (EmitType): Method can emit another new method.
4933
4934         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
4935
4936         * driver.cs: Updated.
4937
4938         * lambda.cs: Reuse predefined empty parameters.
4939
4940         * parameter.cs: Updated
4941
4942         * support.cs: Implemented InflateTypes.
4943
4944         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4945         (InitSystemCore): Introduced to isolate 3.0 dependencies.
4946
4947 2007-04-03  Martin Baulig  <martin@ximian.com>
4948
4949         Fix #80632.
4950
4951         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4952         version of TypeManager.IsOverride() which also works with generic
4953         types.  
4954
4955 2007-04-03  Martin Baulig  <martin@ximian.com>
4956
4957         Fix #81044.
4958
4959         * convert.cs
4960         (Convert.ExplicitReferenceConversion): We need to cast when
4961         converting from IList<T> to S[].
4962
4963 2007-04-01  Marek Safar  <marek.safar@gmail.com>
4964
4965         * decl.cs (FindExtensionMethods): Consider all candidates with same name
4966         at this level.
4967         
4968         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4969
4970 2007-03-31  Marek Safar  <marek.safar@gmail.com>
4971
4972         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4973         argument and return type inferring.
4974
4975         * codegen.cs (InferReturnType): Flag whether return can be inferred.
4976         (ReturnType): Turned to property.
4977
4978         * statement.cs (Return): Implemented return type inferring.
4979
4980         * support.cs (ReflectionParameters): Use local types if possible.
4981
4982 2007-03-30  Raja R Harinath  <rharinath@novell.com>
4983
4984         * flowanalysis.cs (FlowBranching.Reachability): Remove.
4985         (FlowBranching.UsageVector): Update to changes.
4986
4987         Prepare to kill 'Reachability'
4988         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4989         argument of constructor.
4990
4991 2007-03-29  Raja R Harinath  <rharinath@novell.com>
4992
4993         Prepare to kill 'Reachability'
4994         * flowanalysis.cs (UsageVector.is_unreachable): New.
4995         (UsageVector): Update to maintain 'is_unreachable' in parallel to
4996         'reachability', and verify they're consistent.
4997
4998         Fix #81121
4999         * expression.cs (New.EmitStatement): Handle type parameters here too.
5000
5001 2007-03-29  Martin Baulig  <martin@ximian.com>
5002
5003         Fix #79148.
5004
5005         * anonymous.cs
5006         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5007         CompilerGeneratedClass.
5008         (ScopeInfo.EmitScopeInstance): Make this protected.
5009         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5010         `ec.CurrentAnonymousMethod.Scope == Scope'.
5011
5012         * statement.cs (Block.ScopeInfo): Make this a property.
5013
5014 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5015
5016         Prepare to kill 'Reachability'
5017         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5018         (FlowBranching.UsageVector.Reachability): Remove property.
5019         (FlowBranching.UsageVector.IsUnreachable): New property.
5020         (FlowBranching.UsageVector.ResetBarrier): New.
5021         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5022         * codegen.cs, statement.cs: Update to changes.
5023
5024 2007-03-27  Martin Baulig  <martin@ximian.com>
5025
5026         Fix #81209.
5027
5028         * decl.cs
5029         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5030         generic types.
5031
5032 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5033
5034         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5035         instead of TriState.  Remove all mention of TriState.
5036
5037         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5038         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5039         and maintain invariants.
5040
5041 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5042
5043         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5044
5045 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5046
5047         * expression.cs: Stop using obsolete 2.0 opcodes.
5048
5049 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5050
5051         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5052         one of the latests Martin's fixes.
5053
5054 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5055
5056         * expression.cs: On BigEndian systems, swap the bytes, temporary
5057         solution until we get a new bitconverter class.
5058
5059 2007-03-23  Martin Baulig  <martin@ximian.com>
5060
5061         Fix #81158.
5062
5063         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5064         "Method" and "Method`1".  Normally, a cache lookup is done on the
5065         "Method" form (ie. without the generic arity), but this one makes
5066         lookups on the full form work as well.
5067
5068 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5069
5070         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5071         unused properties.
5072
5073 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5074         * class.cs: 
5075         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5076         ordered_member_list, to TypeBuilder to store members to be defined
5077         in the order they were parsed in.
5078         - ordered_explicit_member_list contains all properties indexers
5079           and methods that are defined as explicit implementation of an
5080           interface or base class.
5081         - ordered_member_list contains all properties indexers and methods
5082           that are not defined as explicit implementation of an interface
5083           or base class.
5084
5085         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5086         functionality in these removed classes has been replaced with 
5087         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5088         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5089
5090         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5091         to CheckForDuplications inside GetMethod and SetMethod Define Method
5092         to handle method property and indexer name conflicts.
5093
5094         Fixes #79434
5095
5096         All code is contributed under the MIT/X11 license.
5097
5098 2007-03-20  Martin Baulig  <martin@ximian.com>
5099
5100         * class.cs (TypeContainer.Interfaces): Removed; they're now
5101         included in `TypeContainer.Types'.
5102
5103 2007-03-20  Martin Baulig  <martin@ximian.com>
5104
5105         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5106
5107         * class.cs (TypeContainer.CreateType): New public method.  This is
5108         now called before DefineType() to create the TypeBuilders.
5109         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5110         has already been created by CreateType().
5111         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5112         don't resolve our base classes here; this has been moved into
5113         DefineBaseTypes().  We're now called from CreateType().
5114         (TypeContainer.DefineBaseTypes): New private method; resolve our
5115         base classes here.  We're now called from DefineType().
5116
5117         * rootcontext.cs
5118         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5119         our types first to create all the TypeBuilders.  After that, call
5120         TypeContainer.DefineType() on all the types which'll resolve their
5121         base classes and setup the resolve order.
5122
5123 2007-03-20  Martin Baulig  <martin@ximian.com>
5124
5125         * class.cs (TypeContainer.Enums): Removed; they're now included in
5126         `TypeContainer.Types'.  
5127
5128 2007-03-20  Martin Baulig  <martin@ximian.com>
5129
5130         * class.cs
5131         (TypeContainer.DefineType): Don't call ResolveMembers() here.
5132         (TypeContainer.DoResolveMembers): Call DefineType() on our
5133         `compiler_generated' classes; moved here from DefineNestedTypes().
5134
5135         * rootcontext.cs
5136         (RootContext.ResolveTree): Call ResolveMembers() on all
5137         TypeContainer's in the `type_container_resolve_order'.
5138
5139 2007-03-19  Marek Safar  <marek.safar@gmail.com>
5140
5141         * class.cs: Use corlib to handle InternalMethodImplAttribute.
5142
5143 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5144
5145         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5146         implementation flags.
5147
5148 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5149
5150         * class.cs: More optimizations for type parameters.
5151
5152 2007-03-15  Marek Safar  <marek.safar@gmail.com>
5153
5154         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5155
5156         * ecore.cs, parameter.cs: More common code for both corlibs.
5157
5158         * typemanager.cs (IsGenericMethod): Simplified.
5159
5160 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5161
5162         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5163         'returns'.
5164         * statement.cs, iterators.cs, lambda.cs: Update to changes.
5165
5166         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5167         unconditionally.  Simplify explanation.
5168         (Try.Resolve, Using.Resolve): Likewise.
5169
5170 2007-03-15  Martin Baulig  <martin@ximian.com>
5171
5172         Fix #80731.
5173
5174         * decl.cs (DeclSpace): If we're a partial class, use our
5175         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5176
5177 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5178
5179         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5180         'throws'.
5181         (FlowBranching.UsageVector): Update to changes.
5182         (FlowBranching.MergeSiblings): Likewise.
5183         * statement.cs: Likewise.
5184
5185 2007-03-15  Martin Baulig  <martin@ximian.com>
5186
5187         Fix #79302.
5188
5189         * decl.cs
5190         (MemberCache): Added a special .ctor for type parameters.
5191
5192         * typemanager.cs
5193         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5194         `MemberCache'.  
5195
5196 2007-03-09  Martin Baulig  <martin@ximian.com>
5197
5198         * enum.cs (Enum): Make this a TypeContainer.
5199         (EnumMember): Derive from `Const'.
5200
5201         * const.cs
5202         (Const.DoResolveValue): New protected virtual method; move most of
5203         the functionality of ResolveValue() here so we can override it in
5204         `EnumMember'.
5205         (Const.CreateConstantReference): Make this virtual.
5206
5207         * class.cs (Kind): Add `Kind.Enum'.
5208         (TypeContainer.Emit): Don't emit the enums here; they're already
5209         in the `RootContext.typecontainer_resolve_order'.
5210
5211         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5212         here; they're already in the `typecontainer_resolve_order'.
5213
5214         * ecore.cs (EnumConstant.ConvertImplicitly): Add
5215         TypeManager.DropGenericTypeArguments().
5216
5217         * typemanager.cs
5218         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5219         (TypeManager.IsEnumType): Likewise.
5220         (TypeManager.EnumToUnderlying): Likewise.
5221         (TypeManager.IsEqual): Add support for enums.
5222
5223 2007-03-12  Raja R Harinath  <rharinath@novell.com>
5224
5225         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5226         DefaultParameterValueAttribute to be undefined, say if System.dll
5227         is not referenced.
5228
5229 2007-03-11  Marek Safar  <marek.safar@gmail.com>
5230
5231         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5232         any mscorlib.
5233
5234 2007-03-10  Marek Safar  <marek.safar@gmail.com>
5235
5236         * class.cs, parameter.cs: Unified parameters verification.
5237
5238 2007-03-08  Martin Baulig  <martin@ximian.com>
5239
5240         * cs-parser.jay (constructor_header): Pass the location to the
5241         newly created TopLevelBlock.
5242
5243 2007-03-07  Martin Baulig  <martin@ximian.com>
5244
5245         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5246
5247 2007-03-06  Miguel de Icaza  <miguel@novell.com>
5248
5249         * convert.cs (ExplicitReferenceConversionExists): Sync this method
5250         with the changes from David, fixes the build.
5251
5252 2007-03-05  David Mitchell  <dmitchell@logos.com>
5253
5254         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5255         and its base interfaces to a one-dimensional array type S[],
5256         provided there is an implicit or explicit reference conversion
5257         from S to T.
5258
5259 2007-03-03  Marek Safar  <marek.safar@gmail.com>
5260
5261         * cs-tokenizer.cs: Implemented basic linq grammar.
5262
5263         * driver.cs: Set linq lang version on demand.
5264
5265 2007-02-26  Marek Safar  <marek.safar@gmail.com>
5266
5267         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5268
5269 2007-02-25  Marek Safar  <marek.safar@gmail.com>
5270
5271         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5272         (Fixes #80455)
5273
5274         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5275         here.
5276         Check property and event extern attributes.
5277
5278         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5279         charset.
5280
5281 2007-02-24  Marek Safar  <marek.safar@gmail.com>
5282
5283         A fix for bug #80407
5284         * ecore.cs: Don't report ambiguity error when methods have same parent.
5285
5286 2007-02-23  Marek Safar  <marek.safar@gmail.com>
5287
5288         A fix for bug #80878
5289         * class.cs, cs-parser.jay: Event property can host anonymous methods.
5290
5291 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5292
5293         * attribute.cs: Enable ExtensionAttribute presence test.
5294
5295 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5296
5297         * class.cs: Warn about missing GetHashCode only when Equals is override.
5298
5299         * decl.cs: Check accessibility of type arguments.
5300
5301         * typemanager.cs: Correctly report nullable array.
5302
5303 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5304
5305         * class.cs, report.cs: Capture more details when things go wrong.
5306
5307 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5308
5309         A fix for bug #80650
5310         * cs-parser.jay: Anonymous container starts at constructor declaration
5311         and not at block beginning because it has to be usable in constructor
5312         initializer.
5313
5314         * statement.cs: Use context location and not block one for error reporting.
5315
5316 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5317
5318         A fix for bug #78712
5319         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5320         too.
5321
5322 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5323
5324         A fix for bug #80493 by Atsushi Enomoto
5325         * cs-parser.jay: Ignore invalid attribute target.
5326
5327 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5328  
5329         * cs-tokenizer.cs: Ignore '\0' as white space character.
5330
5331 2007-02-17  Miguel de Icaza  <miguel@novell.com>
5332
5333         * cs-parser.jay: Add support for lambda expressions to the mcs
5334         compiler as well.
5335
5336         * lambda.cs: Only clone when we are probing, not on the final call
5337         (Compatible is the final call). 
5338
5339         * statement.cs (CloneContext): Introduce class to provide block
5340         remapping during clone.
5341
5342         All statements Clone themselves now.
5343
5344         (Clone): special handling for blocks, when we clone a block, we
5345         register the block inside this routine, as children of the block
5346         might trigger a lookup. 
5347         
5348         * expression.cs: Add support for CloneContext in all expressions. 
5349         
5350 2007-02-17  Marek Safar  <marek.safar@gmail.com>
5351  
5352         A fix for bug #80493
5353         * statement.cs: Report ambiguous warning when interfaces are not related.
5354
5355 2007-02-15  Marek Safar  <marek.safar@gmail.com>
5356
5357         C# 3.0 extension methods.
5358
5359         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5360         cannot be used directly.
5361
5362         * class.cs (Class.Emit): Emit extension attribute if any class method
5363         is extension method.
5364         (Method.Define): Add basic extension method validation conditions.
5365         (Method.Emit): Emit extension attribute for method.
5366
5367         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5368         extension method exists. Currently we follow same approach as Microsoft
5369         does, emit even if a method or a class are private but this can change
5370         later.
5371
5372         * cs-parser.jay: Add handling of `this' keyword in method parameters
5373         context.
5374
5375         * decl.cs (DeclSpace.IsStaticClass): New property.
5376         (MemberCache.FindExtensionMethods): Looks for extension methods with
5377         defined name and extension type.
5378
5379         * doc.cs: Updated after OverloadResolve changes.
5380
5381         * driver.cs: Add new soft reference to System.Core.dll.
5382
5383         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5384         (ExtensionMethodGroupExpr): Represents group of extension methods.
5385
5386         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5387         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5388         to MethodGroupExpr and made non-static for easier customization.
5389         (Invocation.DoResolve): Add extension method lookup when no standard
5390         method was found.
5391         (MemberAccess.DoResolve): Try extension methods if no member exists.
5392
5393         * modifiers.cs: Add METHOD_EXTENSION modifier.
5394
5395         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5396         as well as candidate extension type.
5397         (ComputeNamespaces): When assembly constains extension methods registers
5398         them.
5399         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5400         extension method lookup.
5401         (Namespace.LookupExtensionMethod): Looks for extension method in this
5402         namespace.
5403         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5404         find a method which matches name and extensionType.
5405
5406         * parameter.cs (Parameter): Add This modifer.
5407         (HasExtensionMethodModifier): New property.
5408         (Resolve): Add extension parameter check.
5409         (ModFlags): turned to property to exclude this modifier as it is not real
5410         parameter modifier.
5411         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5412
5413         * support.cs (ParameterData): Add ExtensionMethodType.
5414         (ReflectionParameters): Implemented ExtensionMethodType interface property.
5415
5416         * typemanager.cs: Add type and ctor extension attribute type.
5417
5418 2007-02-15  Miguel de Icaza  <miguel@novell.com>
5419
5420         * report.cs (DisableErrors, EnableErrors): used to prevent error
5421         output when we are "trying" to compile various methods with
5422         different types. 
5423
5424         * ecore.cs (Expression): Add Clone method that calls the virtual
5425         CloneTo method.  The current CloneTo method in Expression throws
5426         an exception so we can track down all the places where this must
5427         be implemented (not using abstract, because that would be a lot of
5428         up-front-work before we can start testing the implementation
5429         idea). 
5430
5431         Important: we only need Clone capabilities for expressions created
5432         by the parser, as the expressions we will be cloning are
5433         expressions in the pre-resolved state.   This vastly simplifies
5434         the work required. 
5435         
5436         (SimpleName): Add CloneTo that does nothing.
5437         (EmptyCast): Add CloneTo.
5438         
5439         * expression.cs (Binary): Implement CloneTo.
5440         (Invocation.IsApplicable): Store the current ec in
5441         EmitContext.TempEc and restore it on return.  This is used so we
5442         do not have to sprinkle hundres of methods with an extra
5443         EmitContext, we know that the only user is the lambda expression
5444         ImplicitConversionExists code. 
5445         
5446         (Argument): Add Cloning capabilities.
5447         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5448         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5449         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5450         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5451         IndexerAccess): Add Clone capability.
5452
5453         (LocalVariableReference, This): TODO: needs cloned Block mapping.
5454
5455         (Argument): Add cloning capability.
5456
5457         * assign.cs (Assign): Implement CloneTo.
5458
5459         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5460         
5461         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5462         version by calling Convert with the EmitContext (that we are
5463         currently storing in ec, this is not great, but will do for now,
5464         to avoid passing EmitContext parameters to hundreds of functions
5465         that do not need them now).
5466
5467         (SetExpression): Remove, it is not needed.
5468         
5469         (ContextualReturn): Implement CloneTo.
5470
5471         * statement.cs (Statement): Implement cloning infrastructure,
5472         similar to expressions.
5473
5474         (Block): Partial implementation of Clone for statements.
5475
5476         (Return): Implement clone.
5477         
5478         * constant.cs (Constant.CloneTo): New method, does nothing.
5479
5480         * codegen.cs (TempEc): Add a static EmitContext as a temporary
5481         solution, until we decide how to exactly do this.  
5482         
5483 2007-02-14  Marek Safar  <marek.safar@gmail.com>
5484  
5485         A fix for bug #80493
5486         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
5487         a property is override we need to use second accessor.
5488
5489 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5490  
5491         A fix for bug #80418
5492         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
5493         methods.
5494
5495 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5496
5497         Another fix for bug #80749
5498         * pending.cs: Abstract class has priority over interfaces.
5499
5500 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5501
5502         Another fix for bug #80749
5503         * pending.cs: Abstract class has priority over interfaces.
5504
5505 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5506
5507         Another fix for bug #80749
5508         * pending.cs: Abstract class has priority over interfaces.
5509
5510 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5511
5512         Another fix for bug #80749
5513         * pending.cs: Abstract class has priority over interfaces.
5514
5515 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5516
5517         * class.cs Better error message.
5518
5519         * driver.cs: Add shorter versions of -optimize option.
5520
5521 2007-02-13  Martin Baulig  <martin@ximian.com>
5522
5523         * class.cs (Constructor.Emit): Check the return value of
5524         ec.ResolveTopBlock() and return on error.
5525
5526 2007-02-13  Raja R Harinath  <rharinath@novell.com>
5527
5528         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
5529         message to fix error message regression.
5530
5531 2007-02-12  Marek Safar  <marek.safar@gmail.com>
5532
5533         * delegate.cs: Delegate creation expression cannot be of Nullable type.
5534
5535 2007-02-12  Marek Safar  <marek.safar@gmail.com>
5536
5537         A fix for bug #80749
5538         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5539         its parent container.
5540
5541         * class.cs (DefineFieldInitializers): Each initializer can has different
5542         resolve context.
5543
5544         * const.cs: Updated.
5545
5546 2007-02-11  Miguel de Icaza  <miguel@novell.com>
5547
5548         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
5549         now all the heavy lifting to check that embedded statements or
5550         expressions have the right form is done in the ContextualReturn.
5551
5552         (ContextualReturn): New class.  
5553
5554         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
5555         method that can be invoked to report 201, so we do not replicate
5556         this everywhere.
5557
5558         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
5559         
5560         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
5561         treating tabs as spaces. 
5562
5563 2007-02-09  Marek Safar  <marek.safar@gmail.com>
5564
5565         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
5566         * assign.cs: Use full implicit conversion for right side check.
5567
5568 2007-02-09  Marek Safar  <marek.safar@gmail.com>
5569
5570         * statement.cs (Switch): Switch over boolean type is not standardized.
5571
5572 2007-02-08  Marek Safar  <marek.safar@gmail.com>
5573
5574         A fix for bug #80755
5575         * decl.cs (FindBaseEvent): Don't use method cache for events.
5576
5577 2007-02-07  Marek Safar  <marek.safar@gmail.com>
5578
5579         * cs-parser.jay: Better syntax error handling.
5580
5581         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
5582         instead of underlying type value.
5583
5584 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5585
5586         * driver.cs: Check define identifier before is registered.
5587
5588         * namespace.cs: Use existing error message.
5589
5590         * report.cs: New warning.
5591
5592 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5593
5594         A fix for bug #80742
5595         * expression.cs: Delegate Invoke method can be called directly.
5596
5597 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5598
5599         A fix for bug #80676
5600         * class.cs (IsEntryPoint): The Main method can have params modifier.
5601
5602 2007-02-04  Miguel de Icaza  <miguel@novell.com>
5603
5604         * parameter.cs (Parameter, Parameters): Add Clone method.
5605
5606         * anonymous.cs (Compatible): Turn method into virtual method, so
5607         LambdaExpression can implement a different behavior.
5608
5609         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
5610         out the basic checking here, so it can be used by
5611         LambdaExpressions.
5612         
5613         * lambda.cs: Introduce "Compatible" function that will do the
5614         heavy lifting.
5615
5616 2007-02-02  Marek Safar  <marek.safar@gmail.com>
5617
5618         * attribute.cs: Unified one error message.
5619
5620         * class.cs (Class): Use type attributes and not properties to test static
5621         class.
5622         (IsEntryPoint): Don's pass local variable.
5623
5624         * convert.cs: Removed duplicate check.
5625
5626         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
5627
5628         * driver.cs: Don't crash when soft reference does not exist.
5629
5630         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
5631         (UsingEntry): Removed redundant allocation.
5632
5633         * parameter.cs: Add fast path for type parameters.
5634
5635         * support.cs: Don't allocate attribute when it's not used.
5636
5637 2007-01-30  Miguel de Icaza  <miguel@novell.com>
5638
5639         * anonymous.cs
5640         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
5641         this into a virtual method, so we can override it in LambdaExpression.
5642
5643         * driver.cs: Improve diagnostics in case of failure. 
5644
5645         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
5646         write a function that is slightly more complex and that parses:
5647
5648         type identifier [, type identifier]* )
5649
5650         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
5651         this expression:
5652
5653                 (canEmpty ? i >= 0 : i > 0)
5654
5655 2007-01-30  Raja R Harinath  <rharinath@novell.com>
5656
5657         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
5658         exception on possibly valid code.
5659
5660 2007-01-29  Raja R Harinath  <rharinath@novell.com>
5661
5662         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
5663         Push/PopPosition.
5664         (parse_opt_type_arguments): Remove.  It's almost the same as
5665         parse_less_than.
5666         (parse_namespace_or_typename): Use parse_less_than.
5667
5668 2007-01-28  Miguel de Icaza  <miguel@novell.com>
5669
5670         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
5671         this bug took a few hours to find, because the state saved and
5672         restored by PushPosition and PopPosition was ignoring the state of
5673         parse_generic_less_than.
5674
5675         I can also now remove the handling of OP_LT and OP_GT, this solves
5676         the big mistery.
5677         
5678         * cs-tokenizer.cs: store the location for the ARROW token, we use
5679         that in the parser.
5680
5681         (PushPosition, PopPosition): save/restore also `current_token',
5682         restore `parse_generic_less_than' (was missing).
5683
5684         (parse_opt_type_arguments): use parse_type, not
5685         parse_namespace_or_typename to parse types.
5686
5687         * lambda.cs: Empty new file, will eventually have the lambda
5688         expression implementation.
5689
5690         * lambda.test: used to test the internal tokenizer. 
5691
5692         * report.cs (FeatureIsNotISO1): Rename from
5693         FeatureIsNotStandardized, because it was about the language level
5694         (1 vs 2) it was not about standarization.
5695
5696         (FeatureRequiresLINQ): New.
5697
5698         * support.cs (SeekableStreamReader): Only require that the reader
5699         is a TextReader, not a StreamReader, so we can plug StringReader. 
5700
5701         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
5702         given position in the input stream the following tokens can be
5703         parsed as a type followed by an identifier.
5704
5705         (is_punct): after a '(' if parse_type_and_parameter returns true,
5706         then return a special token OPEN_PARENS_LAMBDA which is used to
5707         avoid reduce/reduce errors in the grammar for the
5708         lambda_expression rules.
5709
5710         (parse_type): implement a type parser inside the
5711         tokenizer, the parser only returns true or false depending on
5712         whether the input at a given position can be parsed as a type.
5713
5714         (peek_token): new method used during type parsing.
5715
5716 2007-01-28  Raja R Harinath  <rharinath@novell.com>
5717
5718         Fix #80531
5719         * anonymous.cs (ScopeInfo.InflateParameters): New.
5720         (AnonymousContainer.Resolve): Use it to redirect types of
5721         delegate parameters.
5722
5723 2007-01-27  Raja R Harinath  <rharinath@novell.com>
5724
5725         Fix #80530
5726         * expression.cs (Error_InvalidArguments): Don't use two different
5727         messages for CS1503.  Use ExtraInformation and
5728         SymbolRelatedToPreviousError instead.
5729
5730         Fix #80358
5731         * decl.cs (DeclSpace.initialize_type_params): Don't access
5732         'type_params' of a partial class directly.
5733
5734 2007-01-26  Miguel de Icaza  <miguel@novell.com>
5735
5736         * constant.cs: Removed a handful of out-of-range checks that were
5737         not necessary. 
5738
5739 2007-01-25  Marek Safar  <marek.safar@gmail.com>
5740
5741         * expression.cs (CheckUselessComparison): Add additional check for char
5742         constants.
5743
5744         * namespace.cs: Fixed typo.
5745
5746 2007-01-23  Miguel de Icaza  <miguel@novell.com>
5747
5748         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
5749         gone, instead we inline the test, preventing the needless casts to
5750         longs, ulongs and doubles for the parameters, avoiding calls to
5751         methods that overchecked stuff, and instead inlined things
5752         nicely. 
5753
5754 2007-01-20  Marek Safar  <marek.safar@gmail.com>
5755
5756         * cs-parser.jay: Better parameter error handling.
5757
5758 2007-01-17  Marek Safar  <marek.safar@gmail.com>
5759
5760         A fix for bug #80368, #80522
5761         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
5762         whether array initializer contains constants only.
5763         (ArrayCreation.Emit): Use better formula to decide when
5764         are array initializers for static initialization.
5765         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
5766         have to emit even constants otherwise they are pre-initialized.
5767
5768 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
5769             Raja R Harinath  <rharinath@novell.com>
5770
5771         Fix emit order of 'get' vs. 'set'.
5772         * support.cs (Accessors): New.
5773         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
5774         Note the order in which accessors are declared in the source.
5775         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
5776         Refactored from Property.Define and Indexer.Define.
5777         (PropertyBase.DefineAccessors): New helper that calls the above in
5778         appropriate order as noted by the parser.
5779         (Property.Define, Indexer.Define): Update to changes.
5780         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
5781
5782 2007-01-17  Raja R Harinath  <rharinath@novell.com>
5783
5784         Fix cs0029-6.cs and gcs0029-2.cs (regression)
5785         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
5786         there's an implicit conversion from the current type to the target
5787         type before converting the underlying constant.
5788
5789 2007-01-16  Marek Safar  <marek.safar@gmail.com>
5790
5791         * const.cs (ResolveValue): Updated after constant conversion was made more
5792         generic.
5793
5794         * constant.cs (GetAttributableValue): constant to object conversion is
5795         used for attributes only.
5796         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
5797         constant conversions.
5798         (LongConstant.ConvertImplicitly): Ditto.
5799
5800         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
5801         (ImplicitConversionStandard): Handle constant conversion as extra step.
5802         It solves the issue when constant conversion was called indirectly like
5803         inside array initializer and constant folding was skipped.
5804
5805         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
5806         this change.
5807
5808         * statement.cs(ImplicitConversionStandard): Updated after constant
5809         conversion was made more generic.
5810
5811 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
5812
5813         * expression.cs (As.DoResolve): Use GenericConstraints instead of
5814         Constraints, solves the problem where the compiler incorrectly
5815         reported that a type parameter was not constrained to a class (Bug
5816         80518)
5817
5818 2007-01-14  Marek Habersack  <grendello@gmail.com>
5819
5820         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
5821
5822 2007-01-14  Marek Safar  <marek.safar@gmail.com>
5823
5824         A fix for bug #80368
5825         * assign.cs (FieldInitializer): New class implements field
5826         initializer statement.
5827
5828         * attribute.cs: Update after FieldMember rename.
5829
5830         * class.cs (PropertyBasedMember): New common class for property based
5831         types.
5832         (InterfaceMemberBase): New base class for all members which can be used as
5833         an interface members.
5834         (MethodCore): Moved really common code to InterfaceMemberBase.
5835         (Method.Define): Equal and GetHasCode detection is relevant for methods
5836         only.
5837         (MethodData.Define): Don't assume that public event implements an
5838         interface automatically.
5839         (MethodData.DefineMethodBuilder): Issue an error even if only extern
5840         modifier is used.
5841         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
5842         (FieldMember): Merged with FieldBase.
5843         (EventProperty.AEventPropertyAccessor): New specialization to check whether
5844         event extern modifier can be used.
5845         (EventField.EventFieldAccessor): Moved event field specific code here.
5846         (Event.AllowedModifiers): Even event can be extern.
5847         (Event.FindOutBaseMethod): New override specific to events.
5848         (Indexer.parameters): Reintroduce parameters because base class holds
5849         only properties common data.
5850         (Indexer.CheckForDuplications): Indexers are threated as methods so we
5851         need do extra parameters check.
5852
5853         * const.cs: Update after FieldMember rename.
5854
5855         * decl.cs (MemberCache.FindBaseEvent): New method.
5856
5857         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
5858         to reflect that indexer is now derived from PropertyBased.
5859
5860         * ecore.cs (GetMemberType): Made public.
5861         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
5862         obsolete event.
5863
5864         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
5865         
5866         * typemanager.cs (CSharpSignature): Correctly print event accessors.
5867         (RegisterEvent): Removed.
5868         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
5869         (GetPrivateFieldOfEvent): Renamed to GetEventField.
5870
5871 2007-01-11  Raja R Harinath  <rharinath@novell.com>
5872
5873         Fix #80249
5874         * statement.cs (CollectionForeach.TryType): Prefer generic
5875         GetEnumerator over non-generic variant.  Fix code to follow comments.
5876
5877 2007-01-09  Raja R Harinath  <rharinath@novell.com>
5878
5879         Fix #80446
5880         * support.cs (ReflectionParameter): Don't use an invalid index on
5881         the generic parameter data.
5882
5883 2007-01-08  Miguel de Icaza  <miguel@novell.com>
5884
5885         * driver.cs: Just add a tiny bit of infrastructure.
5886
5887 2007-01-02  Marek Safar  <marek.safar@gmail.com>
5888
5889         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
5890         where field type is struct from current assembly.
5891         
5892         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
5893         it is possible.
5894
5895 2007-01-02  Marek Safar  <marek.safar@gmail.com>
5896
5897         A fix for bug #80381
5898         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
5899         the core types.
5900
5901         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
5902         messages.
5903         (Namespace.LookupType): Always use core types from corlib when speficied.
5904
5905         * report.cs: A new warning.
5906
5907         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
5908         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
5909         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
5910
5911         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
5912         (InitCoreTypes): Set expression type of object_type and value_type
5913         immediately after lookup.
5914
5915 2007-01-01  Miguel de Icaza  <miguel@novell.com>
5916
5917         * cs-tokenizer.cs: Accept Pc class characters (Connector
5918         Punctuation) as valid identifiers.  Fixes #78259
5919
5920         * expression.cs (Invocation.DoResolve): Moved the check for the
5921         use of `this' for doing method calls to the Invocation resolution
5922         step, after overload resolution has taken place instead of doing
5923         the check at the low-level `This.DoResolve' level.
5924
5925         The `This.DoResolve'(appens before overload resolution, so it has
5926         no way of knowing if the method that will be called will be
5927         instace or static, triggering an erroneous report for cs0188 (Bug
5928         78113).
5929
5930         We now do the check for instance method invocations after we know
5931         what method will be called.
5932
5933         (This.CheckThisUsage): Move the actual use of this structure
5934         checking into its own method and expose it. 
5935
5936         * Everywhere that called Error_ValueCannotBeConverted: pass a new
5937         EmitContext.
5938
5939         Exceptions: Null.ConvertImplicitly,
5940         Constant.ImplicitConversionRequired as there are too many call
5941         sites for passing the ec. 
5942
5943         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5944         EmitContext, if the value is null, then we do not try to provide
5945         the extra information from the error (If a userdefined conversion
5946         exists, as UserDefinedConversion requires a non null-EmitContext).
5947
5948         Fixes: #80347
5949
5950 2006-12-30  Raja R Harinath  <rharinath@novell.com>
5951
5952         * flowanalysis.cs (MyBitVector): Document some invariants.
5953         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5954         introduced below, and add a couple of others, 
5955
5956 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5957
5958         * attribute.cs (GetMethodObsoleteAttribute): Uses new
5959         GetPropertyFromAccessor and GetEventFromAccessor.
5960         
5961         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5962         overrides non-obsolete one.
5963         (Indexer.Define): Error message has been moved to the parser.
5964
5965         * cs-parser.jay: Better syntax errors handling.
5966
5967         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5968         when an invocation has no arguments.
5969
5970         * ecore.cs: Removed not used caching.
5971
5972         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5973         implementation.
5974
5975         * report.cs: Add a new warning.
5976
5977         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5978
5979         * typemanager.cs (enumeration_type): Removed.
5980         (CSharpSignature): Reuses IsSpecialMethod.
5981         (IsEqual): Hack for MS BCL.
5982         (GetPropertyFromAccessor): New method.
5983         (GetEventFromAccessor): New method.
5984         (IsSpecialMethod): Fixed to handle more cases.
5985
5986 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5987
5988         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5989         Made white spaces array static.
5990
5991         * ecore.cs (RemoveGenericArity): Optimized.
5992
5993         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5994         10 times faster).
5995         (MyBitVector.initialize_vector): Simplified.
5996
5997 2006-12-22  Miguel de Icaza  <miguel@novell.com>
5998
5999         * ecore.cs: Am not entirely happy with this hack, but it seems to
6000         address the issue in 80257 (a small test case for
6001         CreativeDocs.NET). 
6002
6003         I set the MethodGroupExpr.Type to an internal compiler type
6004         (itself in this case) to force the resolution to take place.   Why
6005         it does not take place with a null is beyond me.
6006
6007 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6008
6009         A fix for bug #80288
6010         * expression.cs (ResolveOperator): Consider user defined conversion for
6011         logical and operator too.
6012         (EmitBranchable): Optimization for logical and when full constant folding
6013         could not be applied but one operand is constant.
6014
6015 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6016
6017         * class.cs (GetClassBases): Write 5 times every day, will never use
6018         FullName for error reporting.
6019
6020         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6021
6022 2006-12-19  Martin Baulig  <martin@ximian.com>
6023
6024         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6025         the symbol file info here.
6026
6027 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6028
6029         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6030         of `elseif' is taking then following sections are not taking.
6031         Fixes an issue reported on mono mailing list.
6032
6033 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6034
6035         A fix for bug #80300
6036         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6037         a caller is not taking.
6038
6039 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6040
6041         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6042         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6043         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6044         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6045         * class.cs: Update to changes.
6046
6047 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6048
6049         A fix for bug #79934
6050         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6051         partial container.
6052
6053         * class.cs (ResolveMembers): Register an iterator in current container and
6054         not in shared one.
6055
6056 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6057
6058         Fix test-543.cs
6059         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6060         satisfy a params annotated parameter.
6061
6062 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6063
6064         A fix for bug #77014
6065         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6066         paramters correctly and not rely on hacks in Parameters class.
6067         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6068         at any possition.
6069         (Invocation.VerifyArgumentsCompat): Ditto.
6070         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6071         any possition.
6072
6073         * parameter.cs (HasParams): Don't assume that params is the last one.
6074
6075         * support.cs (ReflectionParameters.ctor): Look for params attribute
6076         correctly.
6077         (ReflectionParameters.ParameterType): Removed hack when we returned last
6078         parameter for out of range parameters.
6079         (ParameterName, ParameterModifier): Ditto.
6080
6081 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6082
6083         A fix for bug #79987
6084         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6085         when assembly is not CLS compliant but type is. I have no idea why is this
6086         allowed.
6087
6088         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6089
6090 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6091
6092         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6093         in struct constructors, they are basically no-ops.
6094
6095 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6096
6097         * cs-tokenizer.cs (Position): Save preprocessor status too.
6098
6099 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6100
6101         A fix for bug #77794
6102         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6103
6104 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6105
6106         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6107         Fixes #69299.
6108         (pp_expr): Report error for an invalid expression.
6109         (handle_preprocessing_directive): Simplified; add more error checking.
6110
6111 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6112
6113         A fix for bug #74939
6114         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6115         directives handling.
6116
6117 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6118
6119         A fix for bugs #80093, and #75984
6120         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6121         logic, it seems to me as it worked before "by coincidence".
6122         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6123         (cleanup): Enabled endif check.
6124
6125 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6126
6127         A fix for bug #80162
6128         * statement.cs (CollectionForeach.TryType): Generics and non-generics
6129         enumerators are never ambiguous.
6130
6131 2006-12-08  Raja R Harinath  <rharinath@novell.com>
6132
6133         Fix #80060
6134         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6135
6136 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6137
6138         A fix for bug #80144
6139         * class.cs (EventProperty.Define): Explicit implementation means
6140         that an even is used.
6141
6142 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6143
6144         Fixes the operators implementation (part II)
6145
6146         * cfold.cs (DoConstantNumericPromotions): Renamed to
6147         DoBinaryNumericPromotions and simplified.
6148         (BinaryFold): Couple of conversion fixes; simplified.
6149
6150         * constant.cs, ecore.cs, literal.cs
6151         (ToType): Renamed to ConvertImplicitly.
6152         (Reduce): Renamed to ConvertExplicitly.
6153
6154         * class.cs, convert.cs: Updated.
6155
6156         * expression.cs: TryReduce doesn't throw an exception.
6157
6158 2006-12-01  Marek Safar  <marek.safar@gmail.com>
6159
6160         A fix for bug #80108
6161         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6162         compatible.
6163
6164 2006-11-30  Marek Safar  <marek.safar@gmail.com>
6165
6166         Fixes unary operators implementation (part I)
6167         Also fixes #80026
6168
6169         * cfold.cs (Error_CompileTimeOverflow): Made internal
6170
6171         * const.cs (IConstant): Changed to use reference to constant and
6172         not constant itself.
6173         Updated IConstant implementations.
6174
6175         * constant.cs (CreateConstant): New factory method.
6176         Updated IConstant implementation.
6177
6178         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6179
6180         * ecore.cs: Updated to use CreateConstantReference.
6181
6182         * enum.cs: Reflects IConstant changes.
6183
6184         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6185
6186         * literal.cs (NullConstant): Change to be independently usable.
6187
6188 2006-11-29  Martin Baulig  <martin@ximian.com>
6189
6190         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6191         we need to emit the scope initializer before calling the base .ctor.
6192
6193         * anonymous.cs: Merged back from the new anonymous methods branch.
6194         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6195
6196         * expression.cs (ParameterReference.DoResolveBase): Create a
6197         "normal" ScopeInfo when capturing parameters rather than using the
6198         root scope; this makes things work with anonymous methods having
6199         parameters.
6200
6201         * statement.cs
6202         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6203
6204 2006-11-22  Marek Safar  <marek.safar@gmail.com>
6205
6206         A fix for bug #79987
6207         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6208         check to a base class.
6209         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6210         only when assembly has missing attribute.
6211         * report.cs: Update.
6212
6213 2006-11-21  Marek Safar  <marek.safar@gmail.com>
6214
6215         * cs-tokenizer.cs: Merged with gmcs version.
6216
6217 2006-11-20  Marek Safar  <marek.safar@gmail.com>
6218
6219         * cs-tokenizer.cs,
6220         * cs-parser.jay: Better error message when partial keyword is misplaced.
6221
6222 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
6223
6224         A fix for bug #79810
6225         report.cs: CS1058 only applies to 2.0 profile (gmcs).
6226         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6227         a RuntimeWrappedException by default.
6228
6229 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6230
6231         A fix for bug #79843
6232         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6233         implementation.
6234         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6235
6236 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6237
6238         * driver.cs, namespace.cs: Uses faster IndexOf version.
6239
6240 2006-11-17  Marek Safar  <marek.safar@gmail.com>
6241
6242         A fix for bug #79941
6243         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6244         operators.
6245         (Operator.Define): Implicit/Explicit operator of same type is duplicate
6246         even if internal name is different.
6247         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6248         (UserDefinedConversion): Simplified as the operators cannot be internal.
6249         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6250         conversions.
6251         (MethodLookup): Replaced EmitContext with parentType.
6252         * expression.cs: Updated.
6253
6254 2006-11-09  Raja R Harinath  <rharinath@novell.com>
6255
6256         * driver.cs (BadAssembly): Handle all the ugliness of
6257         DefineDynamicAssembly.
6258
6259 2006-11-08  Raja R Harinath  <rharinath@novell.com>
6260
6261         Address parts of #58244 -- most of what's left is in the runtime
6262         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
6263         CS1509 error checks, and handle them for all assembly loads, not
6264         just the first invocation.
6265         (LoadModule): Likewise.  Move handling of 'adder_method' ...
6266         * codegen.cs (AssemblyClass.AddModule): ... here.
6267
6268 2006-11-02  Marek Safar  <marek.safar@gmail.com>
6269
6270         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6271         IEnumerable<T> is ambiguous.
6272
6273 2006-10-31  Marek Safar  <marek.safar@gmail.com>
6274
6275         A fix for bug #67689
6276         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6277         GetEnumerator is ambiguous.
6278
6279         * report.cs: Add new warning.
6280
6281 2006-10-29  Marek Safar  <marek.safar@gmail.com>
6282
6283         A fix for bug #78602
6284         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6285         to protected member can be nested type.
6286
6287 2006-10-28  Marek Safar  <marek.safar@gmail.com>
6288
6289         A fix for bug #78965
6290         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6291         to protected member must derive from current type.
6292
6293 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6294
6295         assign.cs: Reuses error method.
6296
6297         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6298         instead of type for constants.
6299         (Expression.Error_ValueAssignment): Common error method.
6300
6301         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6302         for any assignment.
6303
6304 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6305
6306         A fix for bug #79081
6307         * expression.cs (MemberAccess.DoResolve): Check nested type
6308         accessibility.
6309
6310 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
6311
6312         * doc.cs : nested delegates were not handled. Fixed bug #79754.
6313
6314 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6315
6316         A fix for bug #76591
6317         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6318
6319 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6320
6321         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6322         type forwarder of the same type multiple times.
6323
6324 2006-10-26  Raja R Harinath  <rharinath@novell.com>
6325
6326         Fix #78820
6327         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6328         instance as an rvalue, even when we later resolve as an lvalue.
6329
6330 2006-10-25  Martin Baulig  <martin@ximian.com>
6331
6332         * anonymous.cs: Fix #79673.
6333
6334 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
6335
6336         A fix for bug #79666
6337         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6338         ignored when is optimized (= default value) as its value is already set.
6339
6340 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6341
6342         A fix for bug #79724
6343         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6344         TypeContainer for type lookup.
6345
6346 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6347
6348         A fix for bug #79231
6349         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6350         * expression.cs (OverloadResolve): Always convert type name for
6351         an error message.
6352         (ResolveNamespaceOrType): Don't confuse a nested type with any 
6353         other member.
6354
6355 2006-10-18  Martin Baulig <martin@ximian.com>
6356
6357         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6358
6359 2006-10-17  Miguel de Icaza  <miguel@novell.com>
6360
6361         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6362         an int32, but requesting an int64 from the conversion
6363
6364 2006-10-12  Martin Baulig  <martin@ximian.com>
6365
6366         * anonymous.cs
6367         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
6368         
6369 2006-10-12  Martin Baulig  <martin@ximian.com>
6370
6371         * statement.cs
6372         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6373
6374 2006-10-11  Miguel de Icaza  <miguel@novell.com>
6375
6376         * convert.cs: Remove broken code: I was doing the "Existance"
6377         tests for Implicit conversions.
6378
6379 2006-10-10  Miguel de Icaza  <miguel@novell.com>
6380
6381         * convert.cs: Added one missing case in
6382         ImplicitStandardConversionExists uint64 to intptr.
6383
6384         Fixes #59800
6385         
6386         * typemanager.cs (uintptr_type): another core known type.   
6387
6388         * ecore.cs (OperatorCast): routine used to do cast operations that
6389         depend on op_Explicit.  We could change some of the Decimal
6390         conversions to use this.
6391
6392         This one has a probe mechanism that checks both types for an op_
6393         which it coudl be used to eliminate two classes: CastToDecimal
6394         and CastFromDecimal.
6395
6396         * convert.cs: Implement the conversions documented in #59800
6397         
6398 2006-10-10  Martin Baulig  <martin@ximian.com>
6399
6400         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6401         before RootScope.ResolveMembers().
6402
6403         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6404         `CurrentType' if appropriate.
6405
6406 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
6407
6408         A fix for bug #78568
6409         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6410         when contains binary operators.
6411         * cs-parser.jay: Updated.
6412
6413 2006-10-09  Martin Baulig  <martin@ximian.com>
6414
6415         * delegate.cs
6416         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6417         moved that into Define() and also do the other type parameter
6418         checks there.  Fixes #79094.  Added gtest-292.cs.
6419
6420         * expression.cs
6421         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6422         since that doesn't include type parameters; don't use `Ldelema'
6423         for type parameters.  Fixes #78980.  Added gtest-293.cs.
6424
6425 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
6426
6427         A fix for #77796
6428         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6429         conversion is allowed.
6430
6431 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6432
6433         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6434         error reporting when no error occurs.
6435
6436 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6437
6438         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6439         does not exist.
6440
6441 2006-10-06  Raja R Harinath  <rharinath@novell.com>
6442
6443         Fix #79584
6444         * class.cs (DefineTypeBuilder): Check circular dependencies before
6445         setting the parent of the TypeBuilder.
6446         (CheckRecursiveDefinition): Don't use 'BaseType', since
6447         it may not be valid until after DefineTypeBuilder.  Use
6448         'base_type' instead.
6449
6450 2006-10-04  Martin Baulig  <martin@ximian.com>
6451
6452         Merged the Anonymous Methods patch.
6453
6454         * anonymous.cs, iterators.cs: The new anonymous methods code.
6455
6456         * statement.cs (Variable): New public abstract class.
6457         (LocalInfo.Variable): New public property.
6458         (LocalInfo.ResolveVariable): New public method.
6459         (Block.Flags): Add `IsIterator'.
6460         (Block.AddVariable): Improved the CS0136 check.
6461         (Block.AnonymousChildren): New public property.
6462         (Block.AddAnonymousChild): New public method.
6463         (ToplevelBlock): Update to use the new anonymous method framework.
6464         (ToplevelBlock.ctor): `container' is now a `Block' and not a
6465         `ToplevelBlock'; this is required to correctly implement the
6466         CS0136 check.
6467         (Fixed, Using): Use `TemporaryVariable' instead of directly
6468         creating the `LocalBuilder'.
6469
6470         * parameter.cs (Parameter.ResolveVariable): New public method.
6471         (Parameters.ResolveVariable): Likewise.
6472
6473         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6474
6475         * class.cs (TypeContainer): Replaced the `iterators' list and
6476         corresponding methods with a list of `CompilerGeneratedClass'es.
6477         (TypeContainer.ResolveMembers): New public method.
6478         (Method): `IIteratorContainer' has been replaced by
6479         `IAnonymousHost'.
6480
6481         * expression.cs (VariableReference): New public abstract base
6482         class for `LocalVariableReference', `ParameterReference' and
6483         `This'.
6484
6485         * codegen.cs (EmitContext): Removed `capture_context',
6486         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
6487         (EmitContext.EmitThis): Removed.
6488
6489         * cs-parser.jay: Replace `iterator_container' with
6490         `anonymous_host'.       
6491
6492 2006-10-04  Martin Baulig  <martin@ximian.com>
6493
6494         * generic.cs (GenericMethod): Don't make this abstract.
6495         (Constraints.Clone): Added dummy implementation.
6496
6497 2006-10-04  Raja R Harinath  <harinath@gmail.com>
6498
6499         Fix #79577
6500         * namespace.cs (LookForAnyGenericType): Avoid nullref on
6501         'declspaces'.  Avoid allocating arrays willy-nilly.
6502
6503         Fix #79553
6504         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
6505         cases out of the switch.
6506
6507 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
6508
6509         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
6510         message when non-generic type is used with the type arguments.
6511         * expression.cs: Updated.
6512
6513 2006-09-28  Raja R Harinath  <rharinath@novell.com>
6514
6515         Fix #79013
6516         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
6517         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6518         Change semantics slightly.  Don't insist on having only one
6519         temporary EmptyExpression -- just throttle the creation of new ones.
6520
6521         Fix #79451
6522         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
6523         non-interfaces too.  If no methods are found, don't try to create
6524         a MethodGroupExpr.
6525
6526 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
6527
6528         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
6529         generic type.
6530
6531         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
6532         us produce better error message.
6533
6534 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
6535
6536         * expression.cs (Binary.ResolveOperator): Warn about a side effect
6537         of the `|' operator.
6538
6539         * report.cs: A new warning added.
6540
6541 2006-09-27  Martin Baulig  <martin@ximian.com>
6542
6543         * generic.cs (GenericMethod): Don't make this abstract.
6544
6545 2006-09-27  Martin Baulig  <martin@ximian.com>
6546
6547         * report.cs
6548         (InternalErrorException): Added overloaded ctor taking a params array.
6549
6550 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
6551
6552         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
6553         Fixed the cases when same error was reported twice.
6554
6555         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
6556         now report symbol information.
6557
6558 2006-09-25  Martin Baulig  <martin@ximian.com>
6559
6560         * class.cs: Completely unified with the gmcs version.
6561
6562 2006-09-25  Martin Baulig  <martin@ximian.com>
6563
6564         * typemanager.cs (TypeManager.IsNullableType): New public function.
6565         (TypeManager.IsNullableTypeOf): Likewise.
6566         (TypeManager.IsNullableValueType): Likewise.
6567
6568         * class.cs (MethodCore): Added the `GenericMethod' argument from
6569         gmcs and also unified all classes derived from `MethodCore' with gmcs.
6570
6571 2006-09-24  Raja R Harinath  <harinath@gmail.com>
6572
6573         * convert.cs: Unify with gmcs version.
6574
6575 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6576
6577         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
6578         verify them as well.
6579
6580         * report.cs: New warning.
6581
6582 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6583
6584         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
6585         for anonymous block with out argument.
6586
6587 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6588
6589         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
6590         not used private events only.
6591
6592 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
6593
6594         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
6595
6596         * const.cs (Const.Define): Check for constant type.
6597         (Const.IsConstantTypeValid): Looks for valid constant types.
6598
6599         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
6600
6601         * ecore.cs (EmptyConstantCast): New common class for all constant based
6602         EmptyCast(s).
6603
6604         * expression.cs (Is.DoResolve): Handle null constant especially.
6605         (New.DoResolve): Check for new void().
6606         (MemberAccess.DoResolve): Cope with all kind of nulls.
6607
6608         * literal.cs (NullConstant): Uses EmptyConstantCast.
6609         (NullDefault): Based on EmptyConstantCast.
6610         (NullLiteral): Uses EmptyConstantCast.
6611
6612         * statement.cs (Block.ResolveMeta): Check for constant type.
6613
6614 2006-09-22  Martin Baulig  <martin@ximian.com>
6615
6616         * delegate.cs, attribute.cs: Merged with the gmcs versions.
6617
6618 2006-09-22  Raja R Harinath  <rharinath@novell.com>
6619
6620         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
6621         not the null type.
6622
6623         Fix part of #79451
6624         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
6625         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
6626         code slightly.
6627
6628 2006-09-22  Martin Baulig  <martin@ximian.com>
6629
6630         * ecore.cs: Merged with the gmcs version.
6631
6632         * generic.cs (ConstructedType): New dummy class.
6633         (TypeArguments): Don't make this abstract.
6634
6635         * typemanager.cs
6636         (TypeManager.IsGenericTypeDefinition): New method.
6637         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
6638
6639 2006-09-22  Raja R Harinath  <rharinath@novell.com>
6640
6641         * expression.cs (ComposedCast): Check for arrays of TypedReference
6642         before creating the type, not after.
6643
6644 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
6645
6646         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
6647         after ToType change.
6648
6649         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
6650         when constant must be implicitly convertible.
6651
6652         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
6653
6654         * ecore.cs (NullCast): Derives from NullConstant.
6655
6656         * expression.cs (Is.DoResolve): Removed useless variables.
6657         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
6658         (New.Constantify): Add enum support.
6659         (MemberAccess.DoResolve): Add warning when accessing null constant or
6660         variable.
6661
6662         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
6663         property.
6664
6665         * literal.cs (NullConstant): New abstract class with common
6666         functionality for all null specializations.
6667         (NullDefault): Represents default(X) when result can be
6668         reduced to null.
6669         (NullLiteral): Updated.
6670
6671         * report.cs: Add new warning.
6672
6673 2006-09-21  Martin Baulig  <martin@ximian.com>
6674
6675         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
6676
6677 2006-09-21  Martin Baulig  <martin@ximian.com>
6678
6679         * generic.cs (GenericConstraints): New dummy class.
6680         (Constraints): Likewise.
6681         (TypeParameter): Likewise.
6682         (TypeParameterName): Likewise.
6683         (GenericMethod): Likewise.
6684
6685         * typemanager.cs (TypeManager.GetGenericArguments): New method.
6686
6687         * decl.cs: Merged with the gmcs version.
6688
6689 2006-09-21  Raja R Harinath  <rharinath@novell.com>
6690
6691         * generic.cs (TypeParameter): Implement IMemberContainer.
6692         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
6693
6694         * rootcontext.cs: Unify with gmcs version.
6695
6696         * report.cs: Unify with gmcs version.
6697         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
6698         from gmcs/generics.cs.
6699         * generics.cs (TypeParameter): New dummy class.
6700
6701         * support.cs: Unify with gmcs version.
6702
6703 2006-09-20  Raja R Harinath  <rharinath@novell.com>
6704
6705         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
6706         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
6707
6708         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
6709         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
6710         * mcs.exe.sources: Add generic.cs.
6711
6712         * codegen.cs: Unify with gmcs version.
6713
6714         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
6715         (EmitContext): Add GenericDeclContainer implementation.
6716         * decl.cs (MemberCore, DeclSpace): Likewise.
6717         * namespace.cs: Remove #ifdef GMCS_SOURCE.
6718
6719         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
6720         MCS TypeManager has a corresponding dummy method.
6721
6722 2006-09-19  Martin Baulig  <martin@ximian.com>
6723
6724         * expression.cs: Completely merged with the gmcs version.
6725
6726 2006-09-19  Martin Baulig  <martin@ximian.com>
6727
6728         * expression.cs (Invocation): Merged with the gmcs version.
6729         (ArrayAccess.GetStoreOpcode): Likewise.
6730
6731 2006-09-19  Martin Baulig  <martin@ximian.com>
6732
6733         * typemanager.cs
6734         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
6735         (TypeManager.IsGenericMethodDefinition): Likewise.
6736
6737 2006-09-19  Martin Baulig  <martin@ximian.com>
6738
6739         * typemanager.cs
6740         (TypeManager.IsEqual): Moved the gmcs implementation here.
6741         (TypeManager.DropGenericTypeArguments): Likewise.
6742         (TypeManager.DropGenericMethodArguments): Likewise.
6743         (TypeManager.GetTypeArguments): Moved here from gmcs.
6744         (TypeManager.HasGenericArguments): Likewise.
6745
6746 2006-09-19  Martin Baulig  <martin@ximian.com>
6747
6748         * expression.cs (Binary): Merged with the gmcs version.
6749
6750 2006-09-19  Martin Baulig  <martin@ximian.com>
6751
6752         * expression.cs (Probe, As, Is): Merged with the gmcs version.
6753
6754 2006-09-19  Martin Baulig  <martin@ximian.com>
6755
6756         * typemanager.cs: Merged with the gmcs version.
6757
6758 2006-09-16  Raja R Harinath  <rharinath@novell.com>
6759
6760         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
6761         * driver.cs: Likewise.
6762
6763 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
6764
6765         A fix for #79401
6766         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
6767         only if parent type is class.
6768         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
6769         update.
6770
6771 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
6772
6773         * cs-parser.jay,
6774         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
6775         keywords are used.
6776         * typemanager.cs(CSharpName): Converts NullType to null.
6777
6778 2006-09-15  Martin Baulig  <martin@ximian.com>
6779
6780         * typemanager.cs
6781         (TypeManager.GetMethodName): Added mcs implementation.
6782         (TypeManager.IsEqual): Likewise.
6783
6784         * ecore.cs
6785         (SimpleName.RemoveGenericArity): Added dummy implementation.
6786
6787         * pending.cs: Merged with the gmcs version.     
6788
6789 2006-09-15  Martin Baulig  <martin@ximian.com>
6790
6791         * statement.cs: Merge with the gmcs version.
6792
6793 2006-09-15  Martin Baulig  <martin@ximian.com>
6794
6795         * statement.cs (Switch): Merge with the gmcs implementation
6796         (without nullables), which is newer.
6797
6798 2006-09-15  Martin Baulig  <martin@ximian.com>
6799
6800         * statement.cs (Block.Variables): Make this public.
6801         (ToplevelBlock.Parameters): Make this a property.
6802         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
6803
6804 2006-09-15  Martin Baulig  <martin@ximian.com>
6805
6806         * namespace.cs: Merge with the gmcs version.
6807
6808 2006-09-15  Martin Baulig  <martin@ximian.com>
6809
6810         * decl.cs (MemberName): Minor code cleanups.
6811
6812 2006-09-15  Martin Baulig  <martin@ximian.com>
6813
6814         * parameter.cs: Merge with the gmcs version.
6815
6816 2006-09-15  Martin Baulig  <martin@ximian.com>
6817
6818         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
6819         and an error in mcs.
6820
6821 2006-09-15  Martin Baulig  <martin@ximian.com>
6822
6823         * flowanalysis.cs: Merged from GMCS; added the generics code into
6824         a `GMCS_SOURCE' conditional so we can share this file.
6825
6826 2006-09-08  Martin Baulig  <martin@ximian.com>
6827
6828         * typemanager.cs (TypeManager.interlocked_type): New public field.
6829         (TypeManager.int_interlocked_compare-exchange): New public field.
6830         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
6831         enumerator types here and call InitGenericCoreTypes().
6832         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
6833         after calling InitEnumUnderlyingTypes().
6834
6835         * rootcontext.cs
6836         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
6837         `classes_second_stage'. 
6838
6839 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
6840
6841         * assign.cs, ecore.cs, expression.cs: Share error message text.
6842         * class.cs (FieldMember.Define): Check for varible of static type.
6843         * driver.cs (LoadAssembly): Uses error output for errors.
6844         * statement.cs: Updated.
6845
6846 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
6847
6848         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
6849         type instance.
6850
6851 2006-09-07  Martin Baulig  <martin@ximian.com>
6852
6853         * driver.cs
6854         (MainDriver): Revert r62663 from Marek; see #70506 for details.
6855
6856 2006-08-29  Miguel de Icaza  <miguel@novell.com>
6857
6858         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
6859         
6860 2006-08-17  Miguel de Icaza  <miguel@novell.com>
6861
6862         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
6863         #52019 and #79064, the use of the \uXXXX sequence in source code
6864         to represent unicode characters.
6865
6866 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
6867
6868         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
6869         support.
6870         * class.cs, ecore.cs, statement.cs: Merged to one error message.
6871
6872 2006-08-13  Miguel de Icaza  <miguel@novell.com>
6873
6874         * assign.cs: Catch attempts to assign to a method groups in += and
6875         report as 1656
6876
6877 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
6878
6879         A fix for #79056
6880         * cs-parser.jay: Don't destroy current array type by typeof of array's.
6881
6882 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
6883
6884         * class.cs (Method.Define): Issue a warning when generic method looks like
6885         an entry point.
6886         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
6887         as well.
6888
6889 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
6890  
6891         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
6892         looking for ctor.
6893         * decl.cs (MemberCache.FindMembers): When container is interface we need to
6894         search all base interfaces as a member can be ambiguous.
6895         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
6896         Constructor member type filter. 
6897         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
6898         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
6899         reporting for returned memberinfos.
6900         * report.cs: Updated.
6901         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
6902         version to work on all runtimes.
6903         (TypeManager.RealMemberLookup): Removed members filtering.
6904
6905 2006-08-08  Raja R Harinath  <rharinath@novell.com>
6906
6907         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
6908         (PropertyExpr.EmitAssign): Likewise.
6909         * expression.cs (Indirection.EmitAssign): Likewise.
6910         (LocalVariableReference.EmitAssign): Likewise.
6911         (ParameterReference.EmitAssign): Likewise.
6912         (Invocation.EmitArguments): Likewise.
6913         (ArrayAccess.EmitAssign): Likewise.
6914         (IndexerAccess.EmitAssign): Likewise.
6915         (This.EmitAssign): Likewise.
6916         (ConditionalLogicalOperator.Emit): Likewise.
6917
6918         Fix #79026
6919         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
6920         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
6921         leave it in after returning it.
6922         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
6923
6924 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
6925
6926         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
6927         message.
6928
6929 2006-08-03  Raja R Harinath  <rharinath@novell.com>
6930
6931         Fix cs0146-3.cs and cs0146-4.cs.
6932         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
6933         enclosing types don't depend on the current type.
6934
6935 2006-08-02  Raja R Harinath  <rharinath@novell.com>
6936
6937         Fix #77963
6938         * class.cs (TypeContainer.DoDefineMembers): Use
6939         FindBaseMemberWithSameName on Parent, since we're interested in
6940         whether we hide inherited members or not.
6941         (FindBaseMemberWithSameName): Make slightly more robust.
6942
6943         Fix the non-generic testcase from #77396
6944         * decl.cs (DeclSpace.DeclContainer): Remove override.
6945
6946         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6947         declspaces for doppelgangers too.
6948         (UsingEntry): Implement IResolveContext.
6949         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
6950         'this' as the resolve context.
6951         (LocalAliasEntry): Likewise.
6952
6953         Implement parts of #77403
6954         * roottypes.cs (RootDeclSpace): New.  Used to represent the
6955         toplevel declaration space.  Each namespace declaration introduces
6956         a "partial" root declaretion space.
6957         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6958         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6959         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6960         from 'current_namespace.SlaveDeclSpace'.
6961         (namespace_declaration): Likewise.
6962         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6963         check.  It can't happen now.
6964         * decl.cs (DeclSpace.LookupType): Likewise.
6965         * driver.cs (MainDriver): Sanity check.
6966
6967 2006-08-01  Raja R Harinath  <rharinath@novell.com>
6968
6969         * decl.cs (DeclSpace.FindNestedType): Remove.
6970         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6971         LookupTypeContainer to get the container of the nested type.
6972         * class.cs (TypeContainer.FindNestedType): Make non-override.
6973
6974 2006-07-31  Raja R Harinath  <rharinath@novell.com>
6975
6976         * decl.cs (DeclSpace.PartialContainer): Move field from ...
6977         * class.cs (TypeContainer.PartialContainer): ... here.
6978         (TypeContainer.AddBasesForPart): New helper.
6979         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
6980         instead.
6981         * cs-parser.jay (current_class): Convert to DeclSpace.
6982         (struct_declaration, interface_declaration, class_declaration):
6983         Use AddBasesForPart instead of .Bases directly.
6984         * const.cs, iterators.cs: Update to changes.
6985
6986 2006-07-28  Raja R Harinath  <rharinath@novell.com>
6987
6988         * class.cs (TypeContainer.AddMemberType): Rename from
6989         AddToTypeContainer.
6990         (TypeContainer.AddMember): Rename from AddToMemberContainer.
6991         (AddTypeContainer): New.  Combine AddClassOrStruct and
6992         AddInterface.
6993         (AddPartial): Update.  Add 'is_partial' argument.
6994         * roottypes.cs: Update to changes.
6995         * cs-parser.jay (push_current_class): New helper for handling
6996         current_container and current_class.
6997         (struct_declaration, interface_declaration, class_declaration):
6998         Use it.
6999
7000 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7001
7002         * roottypes.cs: Rename from tree.cs.
7003
7004         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7005         * tree.cs (Tree, ITreeDump): Remove types.
7006         * rootcontext.cs (tree, Tree): Remove fields.
7007         (root, ToplevelTypes): New.
7008         * *.cs: Update to rename.
7009
7010         * tree.cs (Tree.RecordDecl): Remove.
7011         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7012         namespace here.
7013         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7014
7015 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7016
7017         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7018         DoFlowAnalysis and OmitStructFlowAnalysis here.
7019         (ec.With): Rename from WithUnsafe and generalize.
7020         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7021         (ec.WithFlowAnalyis): New.
7022         * ecore.cs, expression.cs, statement.cs: Update.
7023
7024 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7025
7026         * statement.cs (Block.ResolveMeta): Simplify slightly.
7027
7028         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7029         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7030         check_state to flags.
7031         (CheckState, ConstantCheckState): Update.
7032         (InUnsafe): New read-only property.
7033         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7034         arbitrary flags.
7035         (WithUnsafe): New helper similar to WithCheckState.
7036         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7037         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7038
7039 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7040
7041         Make comparisons use the same IL irrespective of whether they're
7042         in a 'checked' or 'unchecked' context: one of the issues in #78899
7043         * codegen.cs (EmitContext.CheckState): Make read-only property.
7044         (EmitContext.ConstantCheckState): Likewise.
7045         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7046         helper that implement a save/restore stack for CheckState
7047         values.  This is the only way to change check-state.
7048         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7049         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7050         (CheckedExpr.EmitBranchable): New forwarding method.
7051         (UnCheckedExpr): Likewise.
7052         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7053         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7054         (Checked.Resolve, checked.DoEmit): Likewise.
7055
7056 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7057
7058         * anonymous.cs: Cache the resolved anonymous delegate, and return
7059         this so that the ResolveTopBlock is only triggered once, not
7060         twice.
7061
7062         Currently we trigger ResolvetopBlock twice due to a first pass of
7063         argument check compatibility, and a second pass that does the
7064         actual resolution.   
7065         
7066 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7067
7068         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7069         modifiers.
7070         * rootcontext.cs (Reset): Add helper_classes.
7071
7072 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7073
7074         A fix for #78860
7075         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7076         correctly.
7077
7078 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7079
7080         * statement.cs (Lock): Handle expressions of type
7081         TypeManager.null_type specially.  Fixes #78770
7082
7083 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7084
7085         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7086         to an event.
7087
7088 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7089
7090         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7091         for accessors as well.
7092         * ecore.cs (EventExpr): Add AccessorTable.
7093
7094 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7095
7096         A fix for #78738
7097         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7098         for CS0122 where appropriate.
7099         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7100         level attributes.
7101         (Filter): Assembly can be null in the case of top level attributes.
7102
7103 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7104
7105         A fix for #78690
7106
7107         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7108         is done at global level.
7109
7110 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7111
7112         A fix for #77002, Implemented TypeForwarder support.
7113
7114         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7115         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7116         * typemanager.cs (): Add type_forwarder_attr_type.
7117
7118 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7119
7120         * report.cs: Add CS0469 warning.
7121
7122 2006-06-21  Martin Baulig  <martin@ximian.com>
7123
7124         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7125         the `try'-block, so we also report CS0016 etc. there.
7126
7127 2006-06-21  Martin Baulig  <martin@ximian.com>
7128
7129         * delegate.cs
7130         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7131
7132 2006-06-21  Martin Baulig  <martin@ximian.com>
7133
7134         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7135         also report CS1686 for parameters.
7136
7137 2006-06-21  Martin Baulig  <martin@ximian.com>
7138
7139         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7140         instead of an error if the value is not implicitly convertible to
7141         the switch types; fixes #77964.
7142
7143 2006-06-21  Raja R Harinath  <rharinath@novell.com>
7144
7145         Fix #78673
7146         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7147         FieldBuilder is null.
7148
7149         Fix #78662
7150         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7151         'left' and 'right' before error-checking.
7152
7153 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
7154
7155         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7156         Fixed bug #78601.
7157         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7158         (FieldExpr.DoResolve): likewise.
7159         (PropertyExpr.InstanceResolve): likewise.
7160         (EventExpr.InstanceResolve): likewise. 
7161
7162 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
7163
7164         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7165         attribute applicable tests for attribute argument.
7166
7167 2006-06-02  Raja R Harinath  <rharinath@novell.com>
7168
7169         Fix #78079
7170         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7171         (Binary.OverloadResolve_PredefinedIntegral): New.
7172         (Binary.OverloadResolve_PredefinedFloating): New.
7173         (Binary.OverloadResolve_PredefinedString): New.
7174         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7175         Follow the standard more closely, and treat numeric promotions in
7176         terms of overload resolution.
7177         (Binary.CheckShiftArguments): Simplify.
7178
7179 2006-06-01  Raja R Harinath  <rharinath@novell.com>
7180
7181         * flowanalysis.cs (MyBitVector): Simplify representation.
7182         (MyBitVector.Clone): Avoid allocating BitArray.
7183         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7184         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7185         (*): Update.  Change all references to MyBitVector.And and
7186         MyBitVector.Or to &= and |=.
7187
7188 2006-05-29  Raja R Harinath  <rharinath@novell.com>
7189
7190         Fix cs0231-[34].cs.
7191         * cs-parser.jay (formal_parameter_list): Extend the pattern below
7192         to param arguments too.
7193
7194 2006-05-26  Miguel de Icaza  <miguel@novell.com>
7195
7196         * cs-parser.jay: Catch another parsing form for arglist being
7197         followed by other arguments.  Fixes #78313.
7198
7199 2006-05-24  Raja R Harinath  <rharinath@novell.com>
7200
7201         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7202         checking of out parameters to ...
7203         (FlowBranchingToplevel.Merge): ... here.
7204         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7205         set, propagate the origin upward, and only complain if there was
7206         no other error.
7207         (FlowBranchingException.AddContinueOrigin): Likewise.
7208         (FlowBranchingException.AddReturnOrigin): Likewise.
7209         (FlowBranchingException.AddGotoOrigin): Likewise.       
7210
7211 2006-05-23  Raja R Harinath  <rharinath@novell.com>
7212
7213         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7214         unreachable, skip it.
7215         (FlowBranchingException.Merge): Always propagate jumps, even if
7216         the finally block renders subsequent code unreachable.
7217
7218 2006-05-18  Raja R Harinath  <rharinath@novell.com>
7219
7220         Fix #77601
7221         * statement.cs (Goto.Resolve): Move responsibility for resolving
7222         'goto' to FlowBranching.AddGotoOrigin.
7223         (Goto.SetResolvedTarget): New.  Callback to set the
7224         LabeledStatement that's the target of the goto.
7225         (Goto.DoEmit): Use Leave instead of Br when crossing an
7226         unwind-protect boundary.
7227         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7228         LookupLabel and adjust to new semantics.
7229         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7230         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7231         Goto.SetResolvedTarget to update target.
7232         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7233         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7234         AddBreakOrigin & co.  Delay propagation until ...
7235         (FlowBranchingException.Merge): ... this.
7236
7237         * statement.cs (Block.Resolve): Always depend on flow-branching to
7238         determine unreachability.  Kill workaround that originally emitted
7239         only one statement after an "unreachable" label (see infloop in
7240         test-515.cs).
7241
7242         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7243         This is still "wrong", but anything better would probably need a
7244         multi-pass algorithm.
7245         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7246         usage vector.  Force current usage vector to be reachable, to
7247         optimistically signify backward jumps.
7248         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7249         detected.
7250         (FlowBranchingLabeled.Merge): New.  If no backward jump was
7251         detected, return the original salted-away usage vector instead,
7252         updated with appropriate changes.  Print unreachable warning if
7253         necessary.
7254         * statement.cs (Block.Resolve): Don't print unreachable warning on
7255         a labeled statement.
7256
7257 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
7258
7259         * driver.cs: Pass filename without path to AssemblyBuilder's 
7260         AddResourceFile. Fixes bug #78407.
7261
7262 2006-05-17  Raja R Harinath  <rharinath@novell.com>
7263
7264         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7265         * flowanalysis.cs (FlowBranchingLabeled): ... here.
7266         (FlowBranching.MergeChild): Overwrite
7267         reachability information from Labeled branchings too.
7268
7269 2006-05-16  Raja R Harinath  <rharinath@novell.com>
7270
7271         * statement.cs (Goto.Resolve): Merge jump origins here ...
7272         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7273
7274         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7275         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
7276         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
7277         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7278         here, ...
7279         * statement.cs (Goto.Resolve): ... not here.
7280         (Goto.Emit): Remove CS1632 check.
7281
7282 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
7283
7284         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7285         error message.
7286
7287 2006-05-11  Raja R Harinath  <rharinath@novell.com>
7288
7289         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7290         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7291         (FlowBranchingException.Label): Likewise.
7292
7293         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
7294         given value.
7295         (MyBitVector.Or): Use it to avoid losing information (Count).
7296         (FlowBranching.MergeOrigins): Likewise.
7297
7298         * flowanalysis.cs (UsageVector.IsDirty): Remove.
7299         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7300         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7301         (UsageVector.ToString): Simplify.
7302         (UsageVector.MergeSiblings): Move here from ...
7303         (FlowBranching.Merge): ... here.
7304         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7305         not a MyBitVector.
7306
7307 2006-05-10  Raja R Harinath  <rharinath@novell.com>
7308
7309         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7310         null bitvector is treated as all-true.
7311
7312         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7313         (MyBitVector): Rationalize invariants.  'vector != null' implies
7314         that we have our own copy of the bitvector.  Otherwise,
7315         'InheritsFrom == null' implies all inherited bits are true.
7316
7317 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
7318
7319         * statement.cs (LocalInfo): Add IsConstant.
7320         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7321         local variable for constants.
7322
7323 2006-05-09  Raja R Harinath  <rharinath@novell.com>
7324
7325         * flowanalysis.cs (MyBitVector.Empty): New.
7326         (MyBitVector): Don't allow InheritedFrom to be null.
7327         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7328         (UsageVector, FlowBranching): Update to changes.
7329
7330         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7331         recursion.  The 'Parent == null' condition isn't sufficient for
7332         anonymous methods.
7333         (FlowBranching.AddBreakOrigin): Likewise.
7334         (FlowBranching.AddContinueOrigin): Likewise.
7335         (FlowBranching.AddReturnOrigin): Likewise.
7336         (FlowBranching.StealFinallyClauses): Likewise.
7337         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7338         (FlowBranching.CheckOutParameters): Likewise.
7339         (FlowBranchingToplevel): Terminate all the above recursions here.
7340         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7341         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7342
7343         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
7344         toplevel block.
7345         (FlowBranchingToplevel): New.  Empty for now.
7346         (FlowBranching.MergeTopBlock): Update.
7347         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7348         branching for the anonymous delegate.
7349         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7350
7351         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7352         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7353         information at the start of the merge.  Reorganize.
7354
7355 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7356
7357         * class.cs (MethodData.Define): Method cannot implement interface accessor.
7358
7359 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7360
7361         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7362         to newly introduced ctor.
7363
7364         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7365         message to one place.
7366         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7367         global namespace.
7368
7369 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7370
7371         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7372
7373         * ecore.cs (Expression.ResolveAsConstant): Updated.
7374
7375         * statement.cs (ResolveMeta): Updated.
7376
7377 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7378
7379         * cs-parser.jay: __arglist cannot be used in initializer.
7380
7381 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7382
7383         A fix for #77879
7384         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7385         private types.
7386
7387 2006-05-05  Raja R Harinath  <rharinath@novell.com>
7388
7389         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7390         (LabeledStatement): Add 'name' parameter.
7391         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7392         (Block.AddLabel): Update to changes.
7393         * cs-parser.jay (labeled_statement): Likewise.
7394
7395         * flowanalysis.cs (BranchingType.Labeled): New.
7396         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7397         (FlowBranchingLabeled): New.  Does nothing for now, but will
7398         eventually handle 'goto' flows.
7399         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7400         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7401         that's terminated ...
7402         (Block.Resolve): ... here.
7403
7404         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7405         (UsageVector.MergeFinallyOrigins): Likewise.
7406         (FlowBranching.InTryOrCatch): Likewise.
7407         (FlowBranching.AddFinallyVector): Likewise.
7408         (FlowBranchingException): Update to changes.
7409
7410         Fix #78290
7411         * statement.cs (Return.Resolve): Move error checking to ...
7412         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7413         (FlowBranchingException): Handle return origins like break and
7414         continue origins.
7415         (FlowBranching.UsageVector.CheckOutParameters): Remove.
7416
7417 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7418
7419         A fix for #76122
7420         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7421         filter.
7422
7423 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7424
7425         A fix for #77543
7426         * class.cs (MethodData.Define): Do public accessor check only when method
7427         implements an interface.
7428
7429 2006-05-04  Raja R Harinath  <rharinath@novell.com>
7430
7431         Remove special handling of 'break'
7432         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7433         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
7434         (UsageVector.Break): Remove.
7435         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7436         reachability.
7437         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7438
7439         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7440         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
7441
7442 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7443
7444         A fix for #75726
7445         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7446         be the interface member.
7447
7448 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7449
7450         A fix for #60069
7451         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7452         for emitting small (int) values.
7453
7454 2006-05-03  Raja R Harinath  <rharinath@novell.com>
7455
7456         Fix #59427
7457         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7458         control-flow passes through the 'finally' after merging-in all the
7459         control-flows from 'try' and the 'catch' clauses.
7460
7461         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7462         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
7463         always true at the only non-recursive entry point.
7464         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7465         FlowBranchingBreakable.
7466         (FlowBranchingLoop): Remove.
7467         * statement.cs (Return.DoResolve): Update to changes.
7468
7469         Fix #76471, #76665
7470         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7471         (FlowBranching.CreateBranching): Handle it: create a
7472         FlowBranchingContinuable.
7473         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7474         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7475         except that it handles the 'continue' command.
7476         (FlowBranching.UsageVector.MergeOrigins): Rename from
7477         MergeBreakOrigins.
7478         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7479         except that it overrides AddContinueOrigin.
7480         (FlowBranchingException): Override AddContinueOrigin, similar to
7481         AddBreakOrigin.
7482         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7483         Create a new branching around the embedded statement.
7484         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
7485         control flow after the embedded statement.
7486         (Continue.Resolve): Move all error checking to AddContinueOrigin.
7487
7488         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
7489         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
7490         FlowBranchingBreakable.
7491         (FlowBranchingSwitch): Remove.
7492
7493         Fix test-503.cs
7494         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
7495         error reporting to ...
7496         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
7497         Rename from 'AddBreakVector'.  Add new location argument.  Return
7498         a bool indicating whether the 'break' crosses an unwind-protect.
7499         (FlowBranchingException.AddBreakOrigin): Add.
7500         (FlowBranchingException.Merge): Propagate 'break's to surrounding
7501         flowbranching after updating with the effects of the 'finally'
7502         clause.
7503         (FlowBranchingBreakable): New common base class for
7504         FlowBranchingLoop and FlowBranchingSwitch.
7505
7506         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
7507         embedded statement.
7508         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
7509
7510 2006-05-02  Raja R Harinath  <rharinath@novell.com>
7511
7512         * statement.cs (Do.Resolve): If the loop is infinite, set the
7513         barrier.
7514         (While.Resolve, For.Resolve): Set a barrier after the embedded
7515         statement.  There's no direct control flow that goes from the end
7516         of the embedded statement to the end of the loop.
7517         * flowanalysis.cs (FlowBranching.Infinite): Remove.
7518         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
7519         above ensure that the reachability is correctly computed.
7520
7521         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
7522         (UsageVector.MergeBreakOrigins): If the current path is
7523         unreachable, treat it as if all parameters/locals are initialized.
7524         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
7525         infinite loops before merging-in break origins.
7526
7527         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
7528         (Reachability.Reachable): Split part into ...
7529         (Reachability.Unreachable): ... this.  Simplify.
7530         (Reachability.IsUnreachable): Use 'Unreachable' instead.
7531
7532         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
7533         (Reachability.SetThrowsSometimes): Likewise.
7534         (FlowBranchingBlock.MergeTopBlock): Don't compare against
7535         TriState.Always, use corresponding property.
7536         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
7537         (Block.Resolve): Likewise.  Remove some redundant checks.
7538
7539 2006-05-02  Raja R Harinath  <harinath@gmail.com>
7540
7541         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
7542         (Reachability.Meet): Don't bother checking AlwaysThrows --
7543         barrier is always set.
7544         (FlowBranchingBlock.Merge): Likewise.
7545
7546 2006-05-01  Raja R Harinath  <harinath@gmail.com>
7547
7548         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
7549         checks for unreachable.
7550
7551 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
7552
7553         A fix for #77980
7554         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
7555
7556         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
7557         whether field is really assigned.
7558
7559 2006-04-30  Raja R Harinath  <harinath@gmail.com>
7560
7561         * flowanalysis.cs (Reachability): Make 4-argument constructor
7562         private.
7563         (Reachability.Meet): Rename from 'And'.  Remove static variant.
7564         (Reachability.Always): Rename from the highly misleading
7565         'Reachability.Never'.
7566         (FlowBranching.Merge): Update to changes.  Mark an impossible
7567         situation with a 'throw'.
7568         (*): Update to changes.
7569
7570 2006-04-29  Raja R Harinath  <harinath@gmail.com>
7571
7572         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
7573         Remove 'Undefined'.
7574         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
7575         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
7576         (*): Update to changes.
7577         * statement.cs: Update to changes.
7578
7579 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
7580
7581         A fix for #78049
7582         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
7583
7584 2006-04-28  Raja R Harinath  <harinath@gmail.com>
7585
7586         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
7587         dummy UsageVector.
7588
7589         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7590         argument to two arguments: an usage-vector and a bool.  Move call
7591         to FlowBranching.Merge () ...
7592         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
7593
7594         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
7595         handling of loop and switch reachability to ...
7596         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
7597
7598 2006-04-27  Raja R Harinath  <harinath@gmail.com>
7599
7600         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
7601         handling to FlowBranchingLoop.InLoop.
7602         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
7603
7604 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
7605
7606         A fix for #78115
7607         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
7608         anonymous method is allowed from AnonymousContainer here.
7609
7610         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
7611
7612 2006-04-24  Raja R Harinath  <rharinath@novell.com>
7613
7614         Fix #78156
7615         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
7616
7617 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
7618
7619         A fix for #49011.
7620         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
7621         (DoubleConstant.Reduce): Ditto.
7622
7623 2006-04-23  Raja R Harinath  <rharinath@novell.com>
7624
7625         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
7626         Remove 'lvalue_right_side' argument.  Move parts to ...
7627         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
7628         (LocalVariable.DoResolveLValue): ... these.
7629
7630 2006-04-21  Raja R Harinath  <rharinath@novell.com>
7631
7632         Fix cs1655.cs
7633         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
7634         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
7635         (LocalVariableReference.DoResolveBase): Use it to implement new
7636         CS1655 check.
7637         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
7638         (Argument.Resolve): Simplify.  Move CS1510 check ...
7639         * ecore.cs (Expression.ResolveLValue): ... here.
7640         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
7641         (PropertyExpr.DoResolveLValue): Likewise.
7642         (FieldExpr.Report_AssignToReadonly): Likewise.
7643         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
7644         LValueMemberAccess or LValueMemberOutAccess on instance depending
7645         on it.
7646         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
7647         DoResolve as appropriate.
7648
7649 2006-04-20  Raja R Harinath  <rharinath@novell.com>
7650
7651         Fix #75800
7652         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
7653         implicit conversions on 'out' and 'ref' arguments.
7654
7655         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
7656         improve clarity.  Remove dead code.
7657
7658         Fix #66031
7659         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
7660         (Catch.Resolve): Resolve VarBlock if it exists.
7661
7662 2006-04-19  Miguel de Icaza  <miguel@novell.com>
7663
7664         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
7665         twice, this was some residual code, the enumerator was emitted
7666         properly in the two branche of if later.
7667
7668 2006-04-19  Raja R Harinath  <rharinath@novell.com>
7669
7670         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
7671         cast is never an lvalue.
7672         (Cast.DoResolve, Cast.ResolveRest): Combine.
7673         (Argument.Emit): Simplify slightly.  Move 'Expr is
7674         IMemoryLocation' check ...
7675         (Argument.Resolve): ... here.
7676         (Argument.Error_LValueRequired): Remove.  Inline into only user.
7677
7678         Simplifications.  Fix cs0191-2.cs
7679         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
7680         CS1649 and CS1651 to ...
7681         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
7682         the actual selection of the error code and message to a lookup
7683         table.  Add a dummy return value to simplify callsites.
7684         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
7685         readonly fields of other instances of the same type.  Move CS0197
7686         warning from ...
7687         * expression.cs (Argument.Resolve): ... here.  Simplify code.
7688         Ensure that ec.InRefOutArgumentResolving is only set during LValue
7689         resolution of an out or ref argument.  The code simplification
7690         above uses this invariant.
7691
7692 2006-04-18  Raja R Harinath  <rharinath@novell.com>
7693
7694         Possibly fix #77752.  Fix cs1690-[4-7].cs.
7695         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
7696         CheckMarshallByRefAccess.  Drop parameter.
7697         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
7698         warning.
7699         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
7700         InstanceExpression.
7701         * report.cs (AllWarnings): Add CS1690.
7702         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
7703         for ref access too.
7704         (LocalVariableReference.DoResolveBase): Update.
7705
7706 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7707
7708         * class.cs (MethodOrOperator): Moved common parts from method class.
7709         detect obsolete attributes.
7710         (Method.Define): Simplified as it reuses code from base.
7711         (Constructor.ValidAttributeTargets): Fixed issue found during
7712         refactoring.
7713         (Destructor.ValidAttributeTargets): Fixed issue found during
7714         refactoring.
7715         (Operator): Finished refactoring set off by #78020. Operator class is now
7716         ordinary method class.
7717
7718         * anonymous.cs: Updated.
7719
7720         * decl.cs (DeclSpace): Add IsGeneric
7721
7722 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7723
7724         * class.cs (Constructor.Emit): Don't emit the attributes twice.
7725
7726 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7727
7728         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
7729         detect obsolete attributes.
7730         (Method.CreateEmitContext): Moved to MethodOrOperator.
7731
7732 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7733
7734         A fix for #78048.
7735         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
7736         customized exception to make crash detection easier.
7737         (MethodOrOperator): Started to work on new base class for methods and
7738         operators.
7739         (Method): Derives from MethodOrOperator.
7740         (Constructor.Emit): Emits its own attributes.
7741         (AbstractPropertyEventMethod.Emit): Ditto.
7742         (Operator): Derives from MethodOrOperator, will refactor fully in extra
7743         patch.
7744         (Operator.Emit): It's temporary more tricky than should be.
7745         
7746         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
7747
7748         * report.cs (InternalErrorException): Add ctor with inner exception.
7749
7750 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
7751
7752         A fix for #76744.
7753         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
7754         only not visible.
7755
7756 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
7757
7758         A fix for #77916.
7759         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
7760         array.
7761
7762 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
7763
7764         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
7765         attribute is present and Guid not.
7766         (Interface.ApplyAttributeBuilder): Ditto.
7767
7768         * attribute.cs: Add error message.
7769
7770 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
7771
7772         A fix for #78020.
7773
7774         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
7775         sources (it's composite) so hold them in extra array as they are used in
7776         Emit phase only. It worked in the previous versions by mistake.
7777         (Attribute.Emit): Emit attribute for more owners when exist.
7778
7779         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
7780         it has now different behaviour.
7781
7782 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
7783
7784         * constant.cs (Constant.IsDefaultInitializer): New method.
7785
7786         * class.cs: Updated.
7787
7788         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
7789         re-initialize default values. It saves KBs almost for every assembly.
7790         Thanks Zoltan for the idea.
7791         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
7792         (ArrayCreation.DoResolve): Resolve only once.
7793         (ArrayCreation.Emit): Emit static initializer only when it is faster.
7794         (ArrayCreation.GetAttributableValue): Cope with optimized values.
7795
7796 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
7797
7798         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
7799         From #77961.
7800
7801 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
7802
7803         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
7804         in an embedded statement too.
7805
7806 2006-04-01  Raja R Harinath  <rharinath@novell.com>
7807
7808         Fix #77958
7809         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
7810
7811 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
7812
7813         A fix for #77966.
7814
7815         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
7816         was not specified.
7817
7818         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
7819
7820 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
7821
7822         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
7823         phase.
7824
7825         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
7826         LocalTemporary change.
7827
7828         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
7829         TypeContainer.
7830         (ClassOrStruct.DefineFieldInitializers): Implemented static field
7831         initializers optimization.
7832         (ClassOrStruct.TypeAttr): Moved from modifiers.
7833         (Constructor.CheckBase): Don't crash when static ctor has parameters.
7834         (FieldBase.ResolveInitializer): Resolves initializer.
7835         (FieldBase.HasDefaultInitializer): New property.
7836
7837         * cs-parser.jay: Removed message.
7838
7839         * expression.cs (CompilerGeneratedThis): New specialization.
7840
7841         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
7842
7843 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
7844
7845         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
7846
7847 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
7848
7849         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
7850         be now EnumConstants only.
7851
7852 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
7853
7854         * attribute.cs, driver.cs: Reset more caches.
7855
7856 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
7857
7858         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
7859
7860 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
7861
7862         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
7863         for easier reuse. Updated all overrides.
7864         (IntegralConstant): New base class for all integral constants.
7865         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
7866         of the constant range, report custom error.
7867         (UIntConstant.Reduce): Fixed uint conversion.
7868
7869         * ecore.cs, literal.cs: Reduce updates.
7870
7871 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
7872
7873         A fix for #75813.
7874
7875         * class.cs (Constructor.Define): Removed extra if for default ctors.
7876         A patch from Atsushi Enomoto.
7877
7878 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
7879
7880         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
7881         GetAttributableValue.
7882
7883         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
7884         when required.
7885
7886         * convert.cs (ImplicitConversionRequired): Error message moved to
7887         DoubleLiteral.
7888
7889         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
7890         automatic implicit conversion of an output value.
7891         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
7892
7893         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
7894         conversion.
7895         (TypeOf.GetAttributableValue): Add extra handling for object type.
7896
7897         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
7898         special error message.
7899
7900 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
7901
7902         * class.cs (Constructor.Emit): Don't crash when struct ctor is
7903         InternalCall.
7904         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
7905         compatible with MS runtime.
7906
7907 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
7908
7909         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
7910         attribute arguments here.
7911
7912         * class.cs (Indexer.Define): The check was moved to attribute class.
7913
7914 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
7915
7916         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
7917         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
7918         easier.
7919
7920 2006-03-22  Raja R Harinath  <rharinath@novell.com>
7921
7922         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
7923         mcs to keep code differences small.
7924         * attribute.cs (Attribute.GetParameterDefaultValue): New.
7925         * typemanager.cs (parameter_default_value_attribute_type): New.
7926         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
7927         CS1908 check.
7928
7929 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
7930
7931         * expression.cs (StringConcat.Append): Reverted back to no warning state.
7932
7933 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
7934
7935         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
7936
7937         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7938         the blocks too.
7939
7940 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
7941
7942         * doc-bootstrap.cs : fix build.
7943
7944 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * expression.cs (StringConcat.Append): Issue a warning when empty string
7947         is going to append.
7948
7949 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7950
7951         * assign.cs (CompoundAssign.ResolveSource): Removed.
7952
7953         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7954         clean up.
7955
7956         * class.cs (TypeContainer.FindMethods): Removed.
7957         (TypeContainer.CheckMemberUsage): Made static.
7958
7959         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7960
7961         * constant.cs (CheckRange): Removed unused type argument.
7962         (CheckUnsigned): Removed unused type argument.
7963
7964         * cs-parser.jay: Updated after MemberAccess clean up.
7965         Uses Length for empty string test.
7966
7967         * cs-tokenizer.cs: Uses Length for empty string test.
7968         (IsCastToken): Made static.
7969         (is_hex): Made static.
7970         (real_type_suffix): Made static.
7971
7972         * decl.cs (SetupCache): Made static.
7973         (OnGenerateDocComment): Removed unused ds argument.
7974
7975         * delegate.cs (VerifyDelegate): Removed unused argument.
7976
7977         * doc.cs: Uses Length for empty string test.
7978
7979         * driver.cs: Uses Length for empty string test.
7980
7981         * enum.cs (IsValidEnumType): Made static
7982
7983         * expression.cs (EnumLiftUp): Removed unused argument.
7984         (ResolveMethodGroup): Ditto.
7985         (BetterConversion): Ditto.
7986         (GetVarargsTypes): Ditto.
7987         (UpdateIndices): Ditto.
7988         (ValidateInitializers): Ditto.
7989         (MemberAccess.ctor): Ditto.
7990         (GetIndexersForType): Ditto.
7991
7992         * flowanalysis.cs: (MergeFinally): Removed unused argument.
7993
7994         * iterators.cs: Updated after MemberAccess clean up.
7995
7996         * location.cs: Uses Length for empty string test.
7997
7998         * namespace.cs: Uses Length for empty string test.
7999
8000          * report.cs (CheckWarningCode): Made static.
8001
8002         * statement.cs (LabeledStatement): Removed unused argument.
8003
8004         * typemanager.cs (FilterNone): Removed.
8005
8006 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8007
8008         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8009         obsolete.
8010
8011         * class.cs: Updated.
8012
8013 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8014
8015         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8016
8017 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8018
8019         A fix for #77822.
8020
8021         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8022         reporting, it's more tricky than I thought.
8023
8024 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8025
8026         A fix for #77816.
8027
8028         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8029         host container.
8030         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8031         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8032         Add more error reporting; Fixed issue with params.
8033
8034         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8035
8036         * cs-parser.jay: AnonymousMethod requires host container.
8037
8038         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8039
8040 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8041
8042         * class.cs: Change 'TypeContainer ds' constructor argument to
8043         'DeclSpace parent'.  Some classes were missed below due to
8044         different naming convention.
8045
8046         * class.cs (MemberCore.Parent): Delete.  This makes the
8047         ParentContainer changes below enforceable by the compiler.
8048
8049         Treat pointers to enclosing declaration space as 'DeclSpace', not
8050         'TypeContainer'.
8051         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8052         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8053
8054         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8055         of TypeContainer.
8056         (Block.AddThisVariable): Likewise.
8057         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8058         (AbstractPropertyEventMethod.Emit): Likewise.
8059         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8060         (GetMethod.Define, SetMethod.Define): Likewise.
8061         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8062         (DelegateMethod.EmitMethod): Likewise.
8063
8064         Fix regression test-partial-13.cs.
8065         Rationalize use of PartialContainer.  Ensure that the partial
8066         class semantics can be tied to type-correctness, i.e., any
8067         violation will cause a compile error.
8068         * class.cs, const.cs: Access all fields that belong to class
8069         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8070         Resolve()-like functions still use 'Parent'.
8071
8072         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8073         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8074         (PropertyMethod.CheckModifiers): Remove unused argument.
8075         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8076         DeclSpace.
8077
8078 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8079
8080         Make semantics of PartialContainer simpler.
8081         * decl.cs (DeclSpace.IsPartial): Remove.
8082         * class.cs (TypeContainer.IsPartial): Likewise.
8083         (TypeContainer..ctor): Set PartialContainer to point to self.
8084         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8085         (TypeContainer.FindNestedType): Likewise.
8086         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8087
8088 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8089
8090         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8091
8092 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8093
8094         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8095         classes.
8096
8097 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8098
8099         * class.cs (Operator.Define): An error for base conversion was not
8100         reported correctly.
8101
8102 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8103
8104         * iterator.cs : yield break is allowed in try statement which has
8105           catch clauses. Fixed bug #77767.
8106
8107 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8108
8109         A fix for #77593, #77574.
8110
8111         * class.cs (MethodCore.CheckBase): Another if for operator.
8112
8113 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8114
8115         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8116         were not resolved
8117
8118         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8119         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8120         conversion test.
8121         
8122         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8123         not needed.
8124
8125         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8126         Updated after another emitcontext usage was clean up. It should help us to
8127         synchronize with gmcs easier.
8128
8129 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
8130
8131         A fix for #77353.
8132
8133         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8134         (Event.Define): ditto
8135         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8136
8137         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8138         Removed redundant code and set NewSlot for Invoke method too.
8139
8140         * parameter.cs (Parameters.ctor): Add custom, type ctor.
8141         (Parameters.MergeGenerated): New method. Use this method when you merge
8142         compiler generated argument with user arguments.
8143
8144 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
8145
8146         * attribute.cs (ResolveAsTypeTerminal): Removed.
8147
8148         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8149         specialization for predefined types; 30% speed up.
8150         Finally placed obsolete check to right place.
8151         (Expression.ResolveType): Removed.
8152
8153         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8154         Updated after ResolveType was removed.
8155
8156         * expression.cs (Cast.ctor): Check void cast.
8157         (Binary.ResolveAsTypeTerminal): Is never type.
8158         (Conditional.ResolveAsTypeTerminal): Is never type.
8159
8160         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8161
8162 2006-03-01  Raja R Harinath  <rharinath@novell.com>
8163
8164         Fix #77679.
8165         * expression.cs (ParameterReference.DoResolveBase): Change return
8166         type to bool.
8167         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8168         Update.
8169
8170         Fix #77628.
8171         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8172
8173         Fix #77642.
8174         * typemanager.cs (GetFullNameSignature): Don't nullref on
8175         protected accessors.
8176
8177 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
8178
8179         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8180         these two separated members to simplify the code.
8181         (Attribute.Resolve): Refactored to use new fields and methods.
8182         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8183         implemented obsolete attribute checking.
8184         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8185         implemented obsolete checking again. It look line never ending quest ;-)
8186         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8187
8188         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8189
8190         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8191
8192         *class.cs (Property.Define): Add RegisterProperty call.
8193
8194         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8195         argument groups (only 2).
8196
8197         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8198         encoding expression to arguments.
8199         (Expression.ExprClassToResolveFlags): Just turned to property.
8200
8201         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8202         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8203         optimized as well as implemented support for zero-length attributes.
8204
8205         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8206         Add caching of PropertyInfo's.
8207
8208 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8209
8210         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8211         error multiple times.
8212
8213 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8214
8215         New partial class implementation.
8216         A fix for #77027, #77029, #77403
8217
8218         * attribute.cs (Attributable): Made attributes protected.
8219
8220         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8221         the replacements of ClassPart and PartialContainer.
8222         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8223         (TypeContainer.AddInterface): Ditto.
8224         (TypeContainer.AddPartial): The main method for partial classes. It checks
8225         for errors and merges ModFlags and attributes. At the end class is added to
8226         partial_parts list.
8227         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8228         required here.
8229         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8230         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8231         from the rest of partial classes.
8232         (TypeContainer.GetClassBases): Simplified.
8233         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8234         DefineType.
8235         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8236         (TypeContainer.HasExplicitLayout): Uses Flags now.
8237         (PartialContainer): Removed.
8238         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8239         (StaticClass): Was merged with Class.
8240         (Class.GetClassBases): class and static class bases are verified here.
8241         (Class.TypeAttr): Added static attributes when class is static.
8242         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8243         (MemberBase): In some cases we need to call parent container for partial
8244         class. It should be eliminated but it's not easy now.
8245
8246         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8247
8248         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8249         partial classed to accumulate class comments.
8250         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8251
8252         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8253
8254         * driver.cs (MainDriver): Tree.GetDecl was removed.
8255
8256         * modifiers.cs (Modifiers): Add partial modifier.
8257
8258         * tree.cs (Tree.decl): Removed.
8259         (RootTypes): Started to use this class more often for root types
8260         specializations.
8261
8262 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8263
8264         A fix for #77615
8265
8266         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8267         external interface does not have an attribute.
8268
8269 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8270
8271         Another prerequisites for new partial classs implementation.
8272         
8273         * attribute.cs (Attribute.Equal): Implemented.
8274         (Attribute.Emit): Changed as attributes can be applied more than twice.
8275         (Attributes.Emit): Check for duplicate attributes here.
8276
8277         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8278         as a parameter, clean-up.
8279
8280 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8281
8282         A fix for #77485
8283
8284         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8285         contains obsolete attribute check which can in some cases look for base
8286         type of current class which is not initialized yet.
8287         (TypeContainer.BaseType): Replacement of ptype.
8288
8289         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8290
8291 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8292
8293         First of prerequisites for new partial classs implemention.
8294         
8295         * attribute.cs (Attributable): Extended by ResolveContext;
8296         Attributes finally have correct context for resolving in all cases.
8297         (AttachTo): Attribute owner is assigned here.
8298
8299         * codegen.cs (IResolveContext): Introduce new interface to hold
8300         all information needed in resolving phase.
8301         (EmitContext): Implements IResolveContext; more clean-up needed here.
8302         
8303         * decl.cs (MemberCore): Implemented IResolveContext.
8304
8305         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8306         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8307         parameter.cs, statement.cs, tree.cs, typemanager.cs:
8308         Refactored to use new IResolveContext instead of EmitContext; cleanup
8309
8310 2006-02-06  Miguel de Icaza  <miguel@novell.com>
8311
8312         * codegen.cs (EmitScopeInitFromBlock): check here the
8313         capture_context, there is no need to make two calls to the
8314         EmitContext. 
8315
8316         * anonymous.cs: Add some debugging messages that might help me
8317         track other instances of this problem in the future (the
8318         regression of test 467).
8319
8320         * cs-parser.jay: track the variable block, as we need to initalize
8321         any captured variables declared in this block for the "catch"
8322         portion of the "Try" statement.
8323
8324         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8325         scope initialization for captured variables. 
8326
8327         Also, move the emit for the variables after the block location has
8328         been marked.
8329
8330 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
8331
8332         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8333
8334 2006-02-02  Miguel de Icaza  <miguel@novell.com>
8335
8336         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8337         commit yesterday, the initialization for the roots is necessary.
8338         What is not necessary is the scope activation.
8339
8340 2006-02-02  Raja R Harinath  <rharinath@novell.com>
8341
8342         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8343         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8344         CS0206 checks.
8345         (Argument.Resolve): Remove CS0206 checks.
8346
8347 2006-02-01  Miguel de Icaza  <miguel@novell.com>
8348
8349         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8350         scopes for all the roots, the scopes will now be emitted when the
8351         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
8352
8353         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8354         code.  This reduces a lot of existing cruft.
8355         
8356         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8357         that the ScopeInfo is generated as we enter the scope, not at the
8358         time of use, which is what we used to do before.
8359
8360         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8361         every time a Block is about to be emitted if we have a
8362         CaptureContext. 
8363
8364 2006-02-01  Raja R Harinath  <rharinath@novell.com>
8365
8366         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8367         (Reset): Update.
8368         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8369
8370         * typemanager.cs (cons_param_array_attribute): Make private.
8371         (Reset): Set it to null.
8372         (InitCoreHelpers): Don't initialize it.
8373         (ConsParamArrayAttribute): New.  Initialize it as needed.
8374         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8375
8376 2006-01-31  Miguel de Icaza  <miguel@novell.com>
8377
8378         * expression.cs: There might be errors reported during the
8379         selection of applicable methods.  If there are errors, do not
8380         continue execution as it will lead the compiler to crash.
8381
8382 2006-01-30  Miguel de Icaza  <miguel@novell.com>
8383
8384         * expression.cs: Member access is not allowed on anonymous
8385         methods.  Fixes #77402.
8386
8387 2006-01-30  Raja R Harinath  <rharinath@novell.com>
8388
8389         Fix #77401
8390         * cs-parser.jay (VariableDeclaration): Don't set
8391         current_array_type to null.
8392         (field_declaration, event_declaration, declaration_statement):
8393         Set it to null here.
8394
8395 2006-01-28  Raja R Harinath  <harinath@gmail.com>
8396
8397         * typemanager.cs (GenericParameterPosition): New.
8398         * doc.cs: Use it.
8399
8400 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
8401
8402         * doc.cs : To process "include" elements, first we should create
8403           another list than XmlNodeList, because it could result in node
8404           removal, which could result in that the XmlNodeList gives up
8405           yielding next node.
8406
8407           (Also made code identical to gmcs again.)
8408
8409 2006-01-25  Miguel de Icaza  <miguel@novell.com>
8410
8411         * ecore.cs: Introduce an error report that we were not catching
8412         before, if not silent, we must report the error.  Gonzalo ran into
8413         it.
8414
8415 2006-01-23  Miguel de Icaza  <miguel@novell.com>
8416
8417         A fix for bug: #76957
8418         
8419         * iterators.cs (MoveNextMethod.CreateMethodHost): call
8420         ComputeMethodHost before creating the method, this is a new
8421         requirement. 
8422
8423         * anonymous.cs (AnonymousContainer): Now we track all the scopes
8424         that this method references (RegisterScope).  The actual scope
8425         where the method is hosted is computed with the ComputeMethodHost
8426         before we create the method.
8427
8428         Moved the Deepest routine here.
8429
8430         (AnonymousContainer.ComputeMethodHost): New routine used to
8431         compute the proper ScopeInfo that will host the anonymous method.
8432
8433         (ScopeInfo): Deal with multiple roots.  The problem was that we
8434         did not have a unique root where all ScopeInfos could be hanged
8435         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
8436         of roots.  
8437
8438         Remove AdjustMethodScope which is now computed at the end.  Remove
8439         LinkScope which did a partial link, instead link all ScopeInfos
8440         before code generation from the new "LinkScopes" routine. 
8441
8442         Simplify all the Add* routines as they no longer need to maintain
8443         the tree, they just need to record that they are using variables
8444         from a ScopeInfo.
8445
8446         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8447         routines to produce the forest of ScopeInfo trees.
8448
8449         * class.cs (TypeContainer.AppendMethod): This is just like
8450         AddMethod, but ensures that an interface implementation method
8451         (IEnumerable.XXX) is not inserted at the beginning of the queue of
8452         methods, but at the end.
8453
8454         We use this functionality to ensure that the generated MoveNext
8455         method in the iterator class is resolved/emitted before the
8456         enumerator methods created.   
8457
8458         This is required because the MoveNext method computes the right
8459         ScopeInfo for the method.  And the other methods will eventually
8460         need to resolve and fetch information computed from the anonymous
8461         method. 
8462
8463 2006-01-21  Raja R Harinath  <harinath@gmail.com>
8464             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
8465
8466         Fix rest of #76995.
8467         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8468         the 'aliases' hash.
8469         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8470         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8471
8472 2006-01-18  Raja R Harinath  <rharinath@novell.com>
8473
8474         Fix #76656, cs0231-2.cs.
8475         * cs-parser.jay (formal_parameter_list): Make error case catch
8476         more issues.
8477         (parenthesized_expression_0): Add CS1026 check.
8478         (invocation_expression): Remove unused { $$ = lexer.Location }.
8479
8480 2006-01-17  Raja R Harinath  <rharinath@novell.com>
8481
8482         Fix #76824.
8483         * cs-parser.jay (statement_expression): Don't list out the
8484         individual statement-expressions.  Convert syntax error into
8485         CS0201 check.
8486
8487 2006-01-16  Raja R Harinath  <rharinath@novell.com>
8488
8489         Fix #76874.
8490         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
8491         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
8492         CheckIntermediateModification.
8493         (FieldExpr.DoResolve): Add new two-argument version that
8494         allows us to resolve the InstanceExpression as an lvalue.
8495         The one-argument variant is now just a wrapper.
8496         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
8497         Resolve the lhs as an lvalue if the it has a value type.
8498         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
8499         from Assign.DoResolve.
8500         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
8501         resolved as an lvalue.
8502         (PropertyExpr.DoResolve): Update.
8503         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
8504         has a value type.  Move CS1612 check here from
8505         CheckIntermediateModification.
8506         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
8507         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
8508         'right_side' of a ResolveLValue on an 'out' argument.
8509         (EmptyExpression.LValueMemberAccess): New.  Used as the
8510         'right_side' of a propagated ResolveLValue on a value type.
8511         (LocalVariableReference.DoResolveBase): Recognize
8512         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
8513         Add CS1654 check.
8514         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
8515         EmptyExpression.Null.
8516
8517 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
8518
8519         * typemanager.cs : added IsGenericParameter(). In mcs it always
8520           return false.
8521         * doc.cs : for generic parameters, use GenericParameterPosition,
8522           not FullName.
8523
8524 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
8525
8526         * expression.cs: Fix Console.WriteLine ((this = x).foo);
8527
8528 2006-01-12  Miguel de Icaza  <miguel@novell.com>
8529
8530         This fixes the problem where we used ldfld instead of ldflda to
8531         load the "THIS" pointer on captured parameters, when THIS is a
8532         value type.  See bug #77205.
8533         
8534         * iterators.cs (CapturedThisReference.Emit): Pass false to
8535         EmitThis (we do not need the address).
8536
8537         * codegen.cs (EmitThis): it needs to know whether we need the
8538         address of `this' or not.  This is used by value types.  
8539
8540         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
8541         every other call passes false.
8542
8543 2006-01-12  Raja R Harinath  <rharinath@novell.com>
8544
8545         Fix #77221.
8546         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
8547         GetOverride.
8548         * expression.cs (Invocation.OverloadResolve): Update.
8549         (Invocation.DoResolve): Avoid double resolution of invocation.
8550
8551 2006-01-11  Raja R Harinath  <rharinath@novell.com>
8552
8553         Fix #77180.
8554         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
8555         unary negation of floating point types as 0-expr; negation cannot
8556         overflow in floating point types.
8557
8558         Fix #77204.
8559         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
8560         on operands of 'void' type.
8561
8562         Fix #77200.
8563         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
8564         and ExclusiveOr for boolean constants too.
8565
8566 2006-01-09  Raja R Harinath  <rharinath@novell.com>
8567
8568         Fix #75636.
8569         * expression.cs (Invocation.OverloadResolve): Replace reflected
8570         override methods with their base virtual methods, rather than
8571         skipping over them.
8572         * typemanager.cs (TypeManager.GetOverride): New.
8573
8574 2006-01-05  Jb Evain  <jbevain@gmail.com>
8575
8576         * class.cs (Property.Define, Indexer.Define): do not tag the
8577         properties as SpecialName | RTSpecialName.
8578
8579 2006-01-04  Miguel de Icaza  <miguel@novell.com>
8580
8581         * class.cs (MethodCore.IsDuplicateImplementation): This method was
8582         doing a low-level comparission of parameter types.  It was lacking
8583         a check for __argslist. 
8584
8585 2005-12-30  Miguel de Icaza  <miguel@novell.com>
8586
8587         * expression.cs (ParameterReference.DoResolveBase): Allow
8588         reference parameters if they are local to this block. 
8589
8590         This allows the ref and out parameters of a delegate to be used in
8591         an anonymous method, for example:
8592
8593         delegate void set (out int x);
8594
8595         set s = delegate (out int x){
8596                 x = 0;
8597         };
8598
8599         This is used by functionality introduced late in the C# language.
8600         
8601         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
8602         method that take ref and out parameters. 
8603
8604         Fixes #77119 which was a late change in the spec.
8605
8606 2005-12-23  Miguel de Icaza  <miguel@novell.com>
8607
8608         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
8609         parent if its the same scope.  Fixes #77060.
8610
8611 2005-12-21  Miguel de Icaza  <miguel@novell.com>
8612
8613         * driver.cs: Report the case of no source files and no -out:
8614         argument provided.
8615
8616 2005-12-20  Raja R Harinath  <rharinath@novell.com>
8617
8618         Fix #77035.
8619         * expression.cs (ComposedCast.GetSignatureForError): Define.
8620
8621 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8622
8623         Fix #76995
8624
8625         * namespace.cs (NamespaceEntry): Add extern_aliases as a
8626         ListDictionary, to contain the ExternAliasEntry entries (in
8627         addition to the NamespaceEntry.aliases hashtable). This field is
8628         shared between the original entry and its doppelganger (bodyless 
8629         copy of it).
8630         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
8631         extern_aliases field.
8632         (NamespaceEntry.Lookup): Move the IsImplicit check after the
8633         lookup in extern_aliases.
8634
8635 2005-12-16  Raja R Harinath  <rharinath@novell.com>
8636
8637         Fix #77006.
8638         * class.cs (TypeContainer.Mark_HasEquals): New.
8639         (TypeContainer.Mark_HasGetHashCode): New.
8640         (ClassPart): Override them.
8641         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
8642
8643         Fix #77008.
8644         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
8645         'parent' argument to the base constructor.
8646
8647         Remove all mention of TypeContainer from decl.cs.
8648         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
8649         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
8650         (DeclSpace.DeclSpace): Likewise.
8651         (DeclSpace.DefineMembers): Remove unused argument.
8652         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
8653         debugging check -- we don't care if the debug code throws an
8654         InvalidCastException instead of an InternalErrorException.
8655         * class.cs (TypeContainer.DefineMembers): Update to changes.
8656         (TypeContainer.DoDefineMembers): Likewise.
8657         (TypeContainer.GetMethods): Likewise.
8658         (PropertyMember.Define): Likewise.
8659         (MemberBase.Parent): New property that forwards to
8660         MemberCore.Parent, but ensures that we get a TypeContainer.
8661         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
8662         (RootContext.PopulateTypes): Likewise.  Remove special case code
8663         for !RootContext.StdLib: DefineMembers is idempotent.
8664
8665 2005-12-14  Miguel de Icaza  <miguel@novell.com>
8666
8667         * convert.cs (ExplicitConversionCore): Check the return value from
8668         ExplicitConversionCore which can return null on failure.  Fixes #76914
8669
8670 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
8671
8672         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
8673
8674 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
8675
8676         * doc.cs : The search for referenced namespace was insufficient to
8677           get global one as it used to do. Fixed bug #76965.
8678
8679 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
8680
8681         * doc.cs : check name in cref in the last phase that whether it is
8682           namespace or not.
8683
8684 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8685
8686         * cs-tokenizer.cs : reverted the latest change: it somehow broke
8687           Mono.C5.
8688
8689 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8690
8691         * doc.cs : so it turned out that we cannot skip override check for 
8692           interface members. Fixed bug #76954.
8693
8694 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8695
8696         * cs-tokenizer.cs : fixed bug #75984:
8697           - #warning and #error should not be handled when the source line
8698             is disabled.
8699           - #line is not checked strictly when the source line is disabled.
8700           - #define and #undef is on the other hand checked strictly at any
8701             state.
8702
8703 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
8704
8705         * cs-tokenizer.cs : missing Location (actually, filename) in one of
8706           CS1027 report.
8707
8708 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8709
8710         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
8711
8712         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
8713         event initializers.
8714         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
8715         (FieldBase.Initializer): Initializer is now optional.
8716         (EventField.Define): Only event field can have initializer.
8717
8718         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
8719
8720         * const.cs (Const): Reuse initializer.
8721
8722         * cs-parser.jay: Updated after FieldBase changes.
8723         Added current_array_type to simplify array initializers.
8724
8725         * ecore.cs (NullCast.IsDefaultValue): Implemented.
8726
8727         * expression.cs, iterators.cs: Updated.
8728
8729         * namespace.cs (NamespaceEntry): Made UsingFound private.
8730
8731 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8732
8733         * parameterCollection.cs: Obsolete, removed.
8734         * parser.cs: Obsolete, removed.
8735
8736 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8737
8738         Fix #76849.
8739         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
8740
8741         * enum.cs (Enum.Define): Set obsolete context here.
8742
8743 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
8744
8745         * doc.cs :
8746           - FindDocumentedMember() now expects 1) paramList as null
8747             when "we don't have to check the number of parameters" and
8748             2) Type.EmptyTypes when "there is no arguments".
8749           - Introduced FoundMember struct to hold the exact type which was
8750             used to find the documented member (the above change broke
8751             test-xml-044; it might be better just to use DeclaringType than
8752             what MS does, like this change does, but it depends on usage.)
8753
8754 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
8755
8756         * doc.cs : documented member might be from DeclaringType for nested
8757           types. Fixed bug #76782.
8758
8759 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
8760
8761         * anonymous.cs: Have the param code handle leaving copies on the
8762         stack etc. Allows anonymous params to take part in the assignment
8763         code (++, +=, etc). Fixes bug #76550
8764
8765         * expression.cs: Handle the prepare_for_load/leave_copy by passing
8766         it down to the anon code.
8767
8768         * iterators.cs: Use dummy var here
8769
8770         * codegen.cs: Handle new vars
8771
8772 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
8773
8774         Fix #76849.
8775         * class.cs (MethodData.Define): Set proper Obsolete context.
8776
8777         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
8778         obsolete context.
8779         (FieldExpr.DoResolve): Ditto.
8780
8781 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
8782
8783         Fix #76849.
8784         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
8785         parent is not obsolete.
8786
8787 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
8788
8789         * doc.cs : (FindDocumentedMember) find parameterless members first
8790           and get CS0419 in the early stage. Fixed first case of bug #76727.
8791
8792 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
8793
8794         Fix #76859.
8795         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
8796         no error was reported.
8797
8798         *expression.cs (Binary.DoResolve): left can be null.
8799
8800 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
8801
8802         Fix #76783.
8803         * class.cs (MethodData.Emit): Parameters should be labeled first.
8804
8805 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
8806
8807         Fix #76761.
8808         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
8809
8810 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
8811
8812         * attribute.cs (AreParametersCompliant): Moved to Parameter.
8813
8814         * class.cs (MethodCore): Parameter clean up.
8815         (IMethodData): Added ParameterInfo.
8816         (MethodData): Parameter clean up.
8817         (Indexer.Define): Parameter clean up.
8818
8819         * anonymous.cs,
8820         * codegen.cs,
8821         * cs-parser.jay,
8822         * decl.cs,
8823         * doc.cs,
8824         * ecore.cs,
8825         * flowanalysis.cs,
8826         * iterators.cs,
8827         * pending.cs,
8828         * statement.cs,
8829         * typemanager.cs: Parameter clean up.
8830
8831         * delegate.cs (Define): Get rid of duplicated code.
8832
8833         * expression.cs (ParameterReference): Removed useless parameters
8834         and simplified.
8835         (Invocation): Ditto.
8836
8837         * parameter.cs (ParamsParameter): New class, params specialization.
8838         (ArglistParameter): Attemp to separate arglist.
8839         (Parameter): Refactored to be reusable and faster.
8840         (Parameter.Modifier): Made understandable.
8841         (Parameters): Changed to be used as a class for `this' assembly
8842         parameters. Refactored to use new specialized classes.
8843
8844         * support.cs (ParameterData): Added Types property.
8845         (InternalParameters): Deleted.
8846
8847 2005-08-20  Martin Baulig  <martin@ximian.com>
8848
8849         Merging this patch from GMCS to fix #75867.
8850
8851         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8852         scope if we don't already have it.
8853
8854 2005-11-17  Martin Baulig  <martin@ximian.com>
8855
8856         * anonymous.cs
8857         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
8858         inherit the scope from our parent.  Fixes #76653.
8859
8860 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
8861
8862         * doc.cs : the previous patch does not actually fix the bug.
8863           PropertyInfo override check is now implemented and really fixed it.
8864         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
8865
8866 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
8867
8868         * doc.cs : apply "override filter" also to properties.
8869           Fixed bug #76730.
8870
8871 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
8872
8873         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
8874           no need to check overrides. For classes, omit those results from 
8875           interfaces since they must exist in the class. Fixed bug #76726.
8876
8877 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8878
8879         * typemanager.cs : (GetFullNameSignature) differentiate indexers
8880           with different parameters. Fixed the second problem in #76685.
8881
8882 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8883
8884         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
8885           get expected 'protected' access in CheckValidFamilyAccess()).
8886           Fixed bug #76692.
8887
8888 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8889
8890         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
8891           Fixed bug #76705.  CS1569 was incorrectly commented out.
8892
8893 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
8894
8895         * doc.cs : use Invocation.IsOverride() to do real override check.
8896         * expression.cs : made Invocation.IsOverride() internal.
8897
8898 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
8899
8900         * doc.cs : use TypeManager.FindMembers() instead of (possible)
8901           TypeBuilder.FindMembers() and filter overriden base members out.
8902           Fixed bug #76990.
8903
8904 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8905
8906         * doc.cs : ref/out parameters are represented as '@' (instead of
8907           '&' in type FullName). Fixed bug #76630 (additionally crefs).
8908
8909 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8910
8911         * doc.cs : when there was no '.' in cref to methods in doc comment,
8912           then parameters were missing in the output. Fixed bug #76691.
8913
8914 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8915
8916         * driver.cs : don't output docs when there is an error.
8917           Fixed bug #76693.
8918
8919 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8920
8921         * doc.cs :
8922           Now it should detect indexers. Fixed primary concern in bug #76685.
8923           Fixed CS0419 message to not show the identical member signature in
8924           the message.
8925
8926 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8927
8928         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
8929           instead of Type.FindMembers() since it does not handle events.
8930           Fixed bug #71604.
8931
8932 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
8933
8934         * codegen.cs: Fixed typo (speficied -> specified).
8935
8936 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8937
8938         Fix #76369.
8939         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8940
8941 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8942
8943         * attribute.cs: Changed error message.
8944
8945         * cs-tokenizer.cs: One more check.
8946
8947 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8948
8949         * statement.cs (Block.Resolve): Ignore empty statement.
8950
8951 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8952
8953         * report.cs: Made error/warning methods more strict to avoid
8954         their misuse.
8955
8956         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8957         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8958         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8959         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8960
8961 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
8962
8963         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8964         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8965
8966         * class.cs (TypeContainer.IsComImport): New property.
8967         (Constructor.Define): Create proper ctor for ComImport types.
8968
8969         * expression.cs (New.CheckComImport): Fixed.
8970
8971 2005-11-07  Miguel de Icaza  <miguel@novell.com>
8972
8973         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8974         that a parameter has been captured does not mean that we do not
8975         have to do the rest of the processing.  This fixes the second part
8976         of #76592.  If there was another anonymous method capturing
8977         values in the past, the Scope would never be set for the second
8978         method that captured the same parameter.
8979
8980         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8981         properly manipulate the stack.   Second part of fix for #76592.
8982
8983         * expression.cs (New): Add support for invoking "new" on
8984         interfaces that have been flagged with the ComImport attribute and
8985         the CoClass.  Fixes #76637 
8986
8987         * statement.cs (Try.DoEmit): When a variable is captured, do not
8988         try to emit the vi.LocalBuilder variable as it has been captured.
8989         Create a temporary variable and store the results on the
8990         FieldBuilder.  Fixes #76642
8991
8992 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
8993
8994         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8995
8996         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8997
8998         * expression.cs (Binary.DoResolve): Added && optimalization.
8999     
9000         * typemanager.cs (AddUserType): Removed useless argument.
9001
9002 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9003
9004         * statement.cs (Block.variables): Uses ListDictionary.
9005
9006 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9007
9008         Fix #75969.
9009         * class.cs (PartialContainer.EmitType): Customized to emit
9010         security attributes.
9011         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9012         for partial classes.
9013
9014 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9015
9016         Fix #76599.
9017         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9018         access has to be fixed.
9019         
9020         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9021
9022 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9023
9024         Fix #76590.
9025         * ecore.cs (NullCast.Reduce): Implemented.
9026
9027         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9028         constant type.
9029         
9030         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9031         properly.
9032         (Foreach.Resolve): Catch null properly.
9033
9034 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9035  
9036         * cs-tokenizer.cs: Warning text fix.
9037
9038         * driver.cs: AllWarningNumbers exposed on public interface.
9039
9040         * report.cs (): Reviewed warning numbers.
9041         (IsValidWarning): Use binary search.
9042
9043 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9044  
9045         * driver.cs: Implemeted resource visibility.
9046         (Resources): New class for code sharing between /res: and
9047         /linkres:
9048  
9049 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9050
9051         Fix #76568.
9052         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9053         folding.
9054         
9055         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9056         contants only.
9057         
9058         * ecore.cs (NullCast): Child is contant only.
9059         
9060         * literal.cs (NullLiteral.Reduce): null can be converted to any
9061         reference type.
9062
9063 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9064
9065         * driver.cs: Use Encoding.Default as default code page instead
9066           of ISO-28591.
9067
9068 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9069
9070         Fix #76085.
9071         * expression.cs (Invocation.Error_InvalidArguments): Handle
9072         __arglist parameters.
9073         (Invocation.VerifyArgumentsCompat): Likewise.
9074         * support.cs (ReflectionParameters.GetSignatureForError): Print
9075         __arglist parameters.
9076         (InternalParamters.GetSignatureForError): Likewise.
9077         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9078
9079 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9080
9081         * attribute.cs (GetPropertyValue): Made public.
9082
9083         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9084         Resolve.
9085         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9086         attribute.
9087         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9088         is not defined.
9089         
9090         * driver.cs: Reflect method name change.
9091         
9092         * statement.cs (Try.Resolve): Warn when try has both general
9093         exception handlers.
9094         
9095         * typemanager.cs: runtime_compatibility_attr_type new predefined
9096         type.
9097
9098 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9099
9100         Fix #76419.
9101         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9102         treat it as an empty parameter list.
9103
9104 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9105
9106         Fix #76271.     
9107         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9108         ResolveAsTypeStep silent.
9109         * statement.cs (Block.AddConstant): Mark block as used.
9110         (Block.ResolveMeta): Avoid piling on error messages
9111         if a constant initializer resolution fails.
9112
9113 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9114
9115         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9116         Remove.
9117         (NamespaceEntry.VerifyAllUsing): New.
9118         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9119         behaviour.  Delegates actual resolution of alias to ...
9120         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9121         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9122         Update.
9123         * driver.cs (Driver.MainDriver): Update.
9124         
9125         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9126         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9127         property.
9128         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9129         Remove.
9130         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9131         RootNamespace.DefineNamespacesForAll.
9132
9133 2005-10-24  Raja R Harinath  <harinath@gmail.com>
9134
9135         * typemanager.cs (assemblies, external_aliases, modules)
9136         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9137         (ComputeNamespaces, GetRootNamespace): Remove extra staging
9138         overhead.  Move resposibility ...
9139         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
9140         * driver.cs, attribute.cs, codegen.cs: Update to changes.
9141
9142 2005-10-23  Raja R Harinath  <harinath@gmail.com>
9143
9144         * namespace.cs (RootNamespace.all_namespaces): Renamed from
9145         cached_namespaces.  Improve usage.
9146         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9147         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9148         Move from GlobalRootNamespace and simplify.
9149         (RootNamespace.Global): Make instance variable.
9150         (RootNamespace.RootNamespace): Add "alias name" parameter.
9151         (GlobalRootNamespace): Simplify drastically.
9152         (Namespace.Lookup): Don't use GetNamespace.
9153         * typemanager.cs (GetRootNamespace): Rename from
9154         ComputeNamespaceForAlias.
9155         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9156
9157 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9158
9159         * anonymous.cs (AnonymousContainer): Don't crash when container
9160         doesn't exist.
9161
9162 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * expression.cs (Binary.DoResolve): Warn when comparing same
9165         values.
9166
9167 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9168
9169         Fix #76486.
9170         * expression.cs (Binary.DoResolve): It looks like there are no
9171         convetsion rules in enum context.
9172
9173 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9174
9175         Add support for extern alias qualifiers.
9176         * typemanager.cs: Move some LookupTypeReflection code
9177         to namespace.cs, to have cleaner code. Added some methods
9178         to help us keep track of the extern aliased references.
9179         * driver.cs: Add suport for extern alias assemblies on command
9180         line and check for their warnings/errors. Also keep track of the
9181         extern aliased assemblies.
9182         * namespace.cs: Move the global functionality of Namespace
9183         to GlobalRootNamespace/RootNamespace. Now the global namespace
9184         is GlobalRootNamespace.Globa. Also the code moved from 
9185         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
9186         Finally added LocalAliasEntry (AliasEntry before) and
9187         ExternAliasEntry, to handle alias statements.
9188         * cs-parser.jay: Add support in the grammar for extern alias
9189         statement.
9190         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
9191         Update callings to Namespace (now in GlobalRootNamespace).
9192
9193 2005-10-18  Raja R Harinath  <rharinath@novell.com>
9194
9195         Fix #76371.
9196         * class.cs (TypeContainer.DefineType): Move updating of
9197         topological sort earlier in the code.
9198         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9199
9200 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
9201
9202         Fix #76273.
9203         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9204         
9205         * constant.cs (Constant.TryReduce): Moved from Cast class.
9206         (Reduce): Made little bit more OO and fixed missing conversions.
9207         
9208         * ecore.cs (Reduce): Implemented.
9209         (Binary.EnumLiftUp): New method to upgrade values to enum values.
9210         
9211         * literal.cs (Reduce): Implemented.
9212         
9213         * class.cs: Reverted Miguel's wrong commit.
9214
9215 2005-10-14  Miguel de Icaza  <miguel@novell.com>
9216
9217         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9218
9219 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
9220
9221         * cs-parser.jay, expression.cs : CS0214 was missing error location
9222           for constants. Fixed bug #76404.
9223
9224 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
9225
9226         Fix #76370.
9227         * convert.cs (ExplicitConversionCore): Fixed object->enum
9228         conversion.
9229
9230 2005-10-10  Raja R Harinath  <rharinath@novell.com>
9231
9232         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9233         InstanceExpression.
9234         (PropertyExpr.EmitCall): Likewise.
9235         * expression.cs (Invocation.EmitArguments): Handle case where
9236         arguments == null.
9237         (Invocation.EmitCall): Avoid allocating temporary variable if
9238         there are no arguments.
9239
9240 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9241
9242         Fix #76323.
9243         * convert.cs (ImplicitConversionStandard): Move conversion of
9244         void* to arbitrary pointer types ...
9245         (ExplicitConversionStandard): .. here.
9246         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9247         error to always print typenames.
9248
9249 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9250
9251         * convert.cs (GetConversionOperator): Rename from
9252         GetConversionOperators.  Move operator selection code from ...
9253         (UserDefinedConversion): ... here.
9254
9255 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
9256
9257         * convert.cs (ExplicitConversionCore): Removed duplicate enum
9258         conversion.
9259
9260 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
9261
9262         * assign.cs (Assign.DoResolve): Error method changed.
9263
9264         * cfold.cs (DoConstantNumericPromotions): Error method changed.
9265         
9266         * const.cs (ResolveValue): Reset in_transit immediately.
9267         
9268         * constant.cs: Error method changed.
9269         
9270         * convert.cs: Removed useless location parameter.
9271         (ExplicitNumericConversion): Don't do double enum check.
9272         (ExplicitConversionCore): Renamed from ExplicitConversion.
9273         (ExplicitUnsafe): Extracted from ExplicitConversion.
9274         (ExplicitConversion): Uses for error reporting.
9275         
9276         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9277         error messages.
9278         (ResolveBoolean): Uses common error method.
9279         (CastToDecimal): Get rid of ec.
9280         (CastFromDecimal): Optimized.
9281         (ConvCast): Get rid of ec.
9282         
9283         * enum.cs (ResolveValue): Reset in_transit immediately.
9284         (Emit): Return after first error.
9285         
9286         * expression.cs: Convert changes.
9287         
9288         * literal.cs: Error method changed.
9289         
9290         * statement.cs: Error method changed.
9291
9292 2005-10-03  Raja R Harinath  <rharinath@novell.com>
9293
9294         * support.cs (SeekableStreamReader.Position): Don't error out when
9295         the requested position is just beyond the end of the current
9296         buffered data.
9297
9298 2005-09-28  Raja R Harinath  <rharinath@novell.com>
9299
9300         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
9301         try to keep in sync with the byte count of the underlying Stream.
9302         However, this limits us to a window size of 2048 characters: i.e.,
9303         the maximum lookahead of our lexer/parser can be 2048 characters.
9304
9305 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
9306
9307         Fix #76255.
9308         * driver.cs: Fix compilation files with full root path.
9309
9310 2005-09-25  Miguel de Icaza  <miguel@novell.com>
9311
9312         * report.cs (SymbolRelatedToPreviousError): Format the output so
9313         it does not use an open parenthesis that is never closed. 
9314
9315         * driver.cs: Follow coding guidelines
9316
9317 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9318
9319         Fix #72930.
9320         * const.cs (Const.ResolveValue): Check for assigning non-null
9321         value to reference type.
9322
9323 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9324
9325         * anonymous.cs: Implemented ExprClassName.
9326         
9327         * assign.cs (Assign.DoResolve): Don't chrash when type is not
9328         delegate.
9329         
9330         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9331         check.
9332         
9333         * class.cs (StaticClass.DefineContainerMembers): Report protected
9334         members as error.
9335         
9336         * codegen.cs: if(ed) PRODUCTION.
9337         
9338         * convert.cs (Error_CannotImplicitConversion): Better error
9339         distinction.
9340         
9341         * cs-parser.jay: More error checks.
9342         
9343         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9344         
9345         * driver.cs (CSCParseOption): Enabled wrong option check.
9346         
9347         * ecore.cs (Expression.ExprClassName): Turned to property.
9348         (MemberExpr.CheckIntermediateModification): For checking boxed
9349         value types     modification.
9350         
9351         * statement.cs (Fixed.Resolve): Expression type must be
9352         convertible to fixed type.
9353         (CollectionForeach.GetEnumeratorFilter,TryType):
9354         Small refactoring for easier error checking.
9355
9356 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
9357
9358         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9359         attributes.
9360         
9361         * class.cs (GeneratedBaseInitializer): New class for customization
9362         compiler generated initializers.
9363         (MemberBase.DoDefine): Check Obsolete attribute here.
9364         (FieldMember.DoDefine): Ditto.
9365         
9366         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9367         constants.
9368         
9369         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9370         (MemberCore.GetObsoleteAttribute): Removed argument.
9371         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9372         (MemberCore.CheckObsoleteType): New helper.
9373         
9374         * delegate.cs,
9375         * enum.cs,
9376         * statement.cs: Updates after MemberCore changes.
9377         
9378         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9379         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9380         
9381         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9382         obsolete attribute for compiler construct.
9383         (As.DoResolve): Cache result.
9384         
9385         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9386
9387 2005-09-26  Raja R Harinath  <rharinath@novell.com>
9388
9389         Fix #76133.
9390         * expression.cs (This.VerifyFixed): In a value type T, the type of
9391         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
9392         value type R, 'this' is treated as a value parameter.
9393
9394 2005-09-22  Miguel de Icaza  <miguel@novell.com>
9395
9396         * statement.cs (Lock): Use the TemporaryVariable class instead of
9397         manually using local variables as those do not work when variables
9398         are captured.
9399
9400         * ecore.cs: Moved the TemporaryVariable class from being a nested
9401         class inside Foreach to be a public class that can be employed in
9402         other places. 
9403
9404 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
9405
9406         * cs-parser.jay: interface_accessors replaced by
9407         accessor_declarations.
9408
9409         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9410         location.
9411         
9412         * statement.cs (GotoCase.Resolve): Convert null constant to
9413         null case.
9414         (SwitchLabel.ResolveAndReduce): Ditto.
9415         (SwitchLabel.NullStringCase): Custom null stamp.
9416         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9417         
9418         typemanager.cs (CSharpSignature): Don't skip first argument
9419         for full names.
9420
9421 2005-09-18  Miguel de Icaza  <miguel@novell.com>
9422
9423         * driver.cs: Set InEmacs based on the environment variable EMACS. 
9424
9425         * location.cs (InEmacs): in this mode, do not report column
9426         location as it confuses Emacs.
9427
9428 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
9429
9430         * cfold.cs, constant.cs, convert.cs, ecore.cs,
9431         expression.cs, iterators.cs, literal.cs: Store constants and
9432         literals location.
9433         
9434         * class.cs (MemberBase.ShortName): Pass location.
9435         
9436         * cs-parser.jay: Some location fixes.
9437         
9438         * ecore.cs (Expression.Location): Made virtual.
9439
9440 2005-09-05  Miguel de Icaza  <miguel@novell.com>
9441
9442         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9443         if the underlying types are the same, otherwise we need to produce
9444         code that will do the proper cast.
9445
9446         This was exposed by Marek's constant rewrite which produced
9447         invalid code for the call site:
9448
9449         enum X : long { a }
9450         void Method (X v) {}
9451
9452         Method ((X) 5)
9453
9454         This fixes test-49.cs
9455
9456 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9457
9458         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9459           Type/Object should be allowed as well. Fixed bug #75968.
9460
9461 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9462
9463         * expression.cs : (Binary.DoResolve): when one is enum constant and
9464           another is constant 0, then return enum one *as enum type*.
9465           Fixed bug 74846.
9466
9467 2005-09-02  Raja R Harinath  <rharinath@novell.com>
9468
9469         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9470         internal.
9471
9472         Fix #75941.
9473         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9474         flow-branching for LocalVariableReferences in case we were invoked
9475         from a MemberAccess.
9476         * expression.cs (LocalVariableReference.VerifyAssigned): New.
9477         Carved out of ...
9478         (LocalVariableReference.DoResolveBase): ... this.
9479         (MemberAccess.Resolve): Do the check that was disabled during
9480         SimpleNameResolve.
9481
9482 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9483
9484         * class.cs :
9485           (PartialContainer.Create): check abstract/sealed/static strictly
9486           but abstract/sealed can exist only at one side. Fixed bug #75883.
9487
9488 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
9489
9490         Fix #75945.
9491         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
9492         specified, don't default to UnmanagedType.I4.
9493
9494 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9495
9496         * expression.cs : conditional operator should check possibly
9497           incorrect assign expression. Fixed bug #75946.
9498
9499 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
9500
9501         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
9502           Reverting the change. gmcs is much complex than mcs on this matter.
9503
9504 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
9505
9506         * cs-tokenizer.cs : To read another token ahead of the actual 
9507           consumption, use new SavedToken and cache token instead of moving
9508           back the stream with SeekableStreamReader (it seemed problematic).
9509         * cs-parser.jay,
9510           driver.cs : Thus use StreamReader directly.
9511         * support.cs : Thus removed SeekableStreamReader.
9512
9513 2005-08-30  Raja R Harinath  <rharinath@novell.com>
9514
9515         Fix #75934.
9516         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
9517         (ScopeInfo.EmitScopeType): Use it to construct field names from
9518         names of captured locals.
9519
9520         Fix #75929.
9521         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
9522         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
9523         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
9524         (ExplicitConversion): Remove enum cases already handled by
9525         implicit conversion.  Move implicit conversion check to the beginning.
9526         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
9527         * expression.cs (ArrayCreation.EmitDynamicInitializers):
9528         Don't treat System.Enum as a struct.
9529
9530 2005-08-30  Jb Evain  <jbevain@gmail.com>
9531
9532         * attribute.cs: handles as expression in parameters.
9533
9534 2005-08-30  Raja R Harinath  <rharinath@novell.com>
9535
9536         Fix #75802.
9537         * class.cs (TypeContainer.VerifyClsName): Don't use a
9538         PartialContainer when verifying CLS compliance.
9539         (AbstractPropertyEventMethod): Set Parent here, ...
9540         (PropertyMethod): ... not here.
9541
9542 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
9543
9544         * attribute.cs : escaped attribute name should not be allowed to be
9545           resolved (e.g. @class as classAttribute). Fixed bug #75930.
9546
9547 2005-08-29  Raja R Harinath  <rharinath@novell.com>
9548
9549         Fix #75927.
9550         * convert.cs (ImplicitStandardConversionExists): Allow zero also
9551         when converting a long constant to unsigned long.
9552         * expression.cs (Invocation.OverloadResolve): Add sanity check to
9553         detect where IsApplicable and VerifyArgumentsCompat disagree.
9554
9555 2005-08-29  Raja R Harinath  <rharinath@novell.com>
9556         and Carlos Alberto Cortez  <carlos@unixmexico.org>
9557
9558         Fix #75848.
9559         * class.cs (TypeContainer.CanElideInitializer): New helper.
9560         (TypeContainer.EmitFieldInitializers): Use it to determine if we
9561         can safely emitting the initializer of a field.
9562
9563 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9564
9565         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
9566           allowed inside a switch (without loop). Fixed bug #75433.
9567
9568 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
9569
9570         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9571         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
9572
9573 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9574
9575         * driver.cs : kinda reverting the default encoding changes (not exact 
9576           revert since I noticed that "codepage:reset" might not work fine).
9577
9578 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9579
9580         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
9581           Location. Now getter and setter store location correctly.
9582           (errors/cs0111-12.cs now reports the expected location.)
9583
9584 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9585
9586         * driver.cs : Use default encoding on the environment.
9587           Removed (now that) extra parameter for SeekableStreamReader.
9588         * support.cs : (SeekableStreamReader) third .ctor() argument for
9589           StreamReader is not required (always true). preamble size could
9590           be acquired in simpler and safe way.
9591
9592 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
9593
9594         * cs-parser.jay: report CS0642 at warning level 3
9595           and report CS0642 for an if else statement also
9596           fixes bug #74745. Patch by John Luke (and a bit
9597           modified by me).
9598           Removed extra CS0642 warning check for "while",
9599           "for" and "fixed".
9600         * statement.cs: In Block.Resolve(), CS0642 check
9601           is reimplemented to check a sequence of an empty
9602           statement and a block.
9603
9604           Both fix bug #66777.
9605
9606 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
9607
9608         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
9609         detection until I fix it.
9610         
9611         * cs-tokenizer.cs: Changed error message.
9612         
9613         * cs-parser.jay: Fixed 2 error locations.
9614         
9615         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
9616         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
9617         properties.
9618         
9619         * enum.cs (GetSignatureForError): Fixed.
9620         
9621         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
9622         method detection.
9623         
9624         * class.cs,
9625         * typemanager.cs (RegisterProperty): Removed.
9626         
9627         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
9628
9629 2005-08-24  Raja R Harinath  <rharinath@novell.com>
9630
9631         Fix #75874.
9632         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
9633         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
9634
9635 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9636
9637         * expression.cs : tiny fix is required for not warning positive ulong.
9638           See test-441.cs.
9639
9640 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9641
9642         * expression.cs : add CS0652 check for constant and integral
9643           expression. Fixed bug #53974.
9644
9645 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9646
9647         * expression.cs : in DoNumericPromotions(), check if there is implicit
9648           conversion overload for string (to check CS0034). Fixed bug #52492.
9649
9650 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9651
9652         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
9653
9654 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9655
9656         * ecore.cs : report location when it is *not* Null.
9657
9658 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9659
9660         * codegen.cs,
9661           ecore.cs,
9662           flowanalysis.cs,
9663           expression.cs:
9664           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
9665           correctly. Fixed bug #75721.
9666
9667 2005-08-23  Raja R Harinath  <rharinath@novell.com>
9668
9669         * support.cs (SeekableStreamReader.Position): Avoid an expensive
9670         loop that performs 'min (pos, char_count)'.
9671
9672         Fix #75862.
9673         * expression.cs (Unary.ResolveOperator): Don't discard implicit
9674         converted value in Operator.OnesComplement.
9675
9676 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
9677
9678         * anonymous.cs: If the anon method is pulled into a helper class,
9679         it needs to be `internal' not `private'. Fixes runtime behavior on
9680         msft. bug #75704
9681
9682 2005-08-20  Martin Baulig  <martin@ximian.com>
9683
9684         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9685         scope if we don't already have it.
9686
9687         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
9688         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
9689         fixes #75867.
9690
9691 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
9692
9693         Fix #75803
9694         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
9695         is a partial class.
9696
9697 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
9698
9699         The big constants rewrite
9700         Fix #75746, #75685 and more
9701         As a side effect saved 1MB for MWF ;-)
9702         
9703         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
9704         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
9705         enum based for corlib compilation.
9706         
9707         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
9708         subtractions.
9709         
9710         * class.cs (FixedField.Define): Use ResolveAsConstant.
9711         
9712         * const.cs (IConstant): Interface constants and enums.
9713         (Const.ResolveValue): New method for constant resolvning.
9714         (ExternalConstant): Constants from imported assemblies.
9715         
9716         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
9717         conversion; like enums.
9718         (Constant.ToType): Converts this constant to different type.
9719         (Constant.Increment): Adds 1.
9720         
9721         * convert.cs (ImplicitConversionRequired): Simplified.
9722         
9723         * cs-parser.jay: Create EnumMember directly.
9724         
9725         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
9726         
9727         * doc.cs (GenerateEnumDocComment): Removed.
9728         
9729         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
9730         (ConvertIntLiteral): Removed.
9731         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
9732         
9733         * enum.cs (EnumMember): Implement IConstant.
9734         (Enum.IsValidEnumConstant): Removed.
9735         (Enum.GetNextDefaultValue): Removed.
9736         (Enum.FindMembers): Updated.
9737         (Enum.GenerateDocComment): Iterate enum members.
9738         
9739         * expression.cs (Cast.TryReduce): Handle enums correctly.
9740         (New.Constantify): Made public.
9741         (MemberAccess.DoResolve): Removed contant specific if(s).
9742         
9743         * literal.cs (NullLiteral): Implement new abstract methods.
9744         
9745         * statement.cs (GotoCase.Resolve): Use new constant methods.
9746         (SwitchLabel.ResolveAndReduce): Use new constant methods.
9747         
9748         * typemanager.cs (LookupEnum): Removed.
9749         (IsEnumType): Fixed to work with corlib.
9750         (RegisterConstant): Removed.
9751         (LookupConstant): Removed.
9752         (GetConstant): Changed to work with IConstant.
9753
9754 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
9755
9756         * location.cs : Fixed overflown (>255) column number.
9757
9758 2005-08-03  Raja R Harinath  <rharinath@novell.com>
9759
9760         First cut of the qualified-alias-member feature.
9761         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
9762         token.
9763         * cs-parser.jay (DOUBLE_COLON): New token.
9764         (namespace_or_type_name): Add rule for recognizing
9765         qualified-alias-members.
9766         (primary_expression): Likewise.
9767         (element_access): Allow QualifiedAliasMember as a possible
9768         type-bearing expression.
9769         (local_variable_type, local_variable_pointer_type): Likewise.
9770         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
9771         aliases in the current and enclosing namespace declarations.
9772         (NamespaceEntry.UsingAlias): Add CS0440 warning.
9773         * decl.cs (MemberName.is_double_colon): New.
9774         (MemberName.MemberName): Add new constructor for alias-member.
9775         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
9776         * expression.cs (QualifiedAliasMember): New expression type.
9777
9778 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9779
9780         * location.cs : it borked when no argument was specified.
9781
9782 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9783
9784         * location.cs : tiny ToString() format fix.
9785
9786 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9787
9788         * statement.cs : oops, it was missing.
9789
9790 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
9791
9792         A set of fixes for precise line/column location.
9793
9794         * location.cs :
9795           "token" field now holds a file/line "delta", a line number offset 
9796           from the segment, and a column number. See also:
9797           http://lists.ximian.com/pipermail/mono-devel-list/2004-
9798           December/009508.html
9799           Removed static IsNull. Use instance IsNull property instead.
9800         * cs-tokenizer.cs :
9801           For some tokens it stores Location. For Identifier it stores
9802           LocatedToken which is a pair of string name and location.
9803           Column numbers are adjusted only at getChar().
9804         * report.cs :
9805           Use Location.ToString() for reporting (it now contains column).
9806         * cs-parser.jay :
9807           Largely modified to use LocatedToken instead of
9808           string (IDENTIFIER), and to acquire Location from some tokens.
9809         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
9810           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
9811           codegen.cs :
9812           Now MemberName holds Location. DeclSpace.ctor() receives Location
9813           as a parameter. Removed extra parameters to all derived classes.
9814           Replaced Location.IsNull() with instance property.
9815         * assign.cs, expression.cs :
9816           Added .ctor() overload that omits Location.
9817         * attribute.cs :
9818           Added "nameEscaped" flag that indicates the identifier was escaped
9819           in the source file. This fixes bug #57047.
9820
9821 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
9822
9823         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
9824         New method, looking for lo-case imported cls type.
9825
9826         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
9827         here.
9828
9829         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
9830
9831         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
9832
9833         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
9834         all_imported_types.
9835         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
9836
9837         Optimized to save 3.5 MB for SWF compilation.
9838
9839 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
9840
9841         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
9842         (PartialContainer.Create): Moved logic AddToContainer.
9843         (PartialContainer.MarkForDuplicationCheck): Shares name.
9844         
9845         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
9846         place.
9847         
9848         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
9849         initialization.
9850         (Namespace.GetSignatureForError): New method.
9851         
9852         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
9853         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
9854
9855 2005-08-01  Raja R Harinath  <rharinath@novell.com>
9856
9857         Fix #75669.
9858         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
9859         member lookup rather than qualifier_type, since qualifier_type can
9860         be null.
9861
9862 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
9863
9864         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
9865         enum member.
9866
9867 2005-07-31  Miguel de Icaza  <miguel@novell.com>
9868
9869         * statement.cs: Copy the local exception into the exception
9870         captured local.  Fixes 75674
9871
9872 2005-07-31  Raja R Harinath  <harinath@gmail.com>
9873
9874         Fix #75658.
9875         * expression.cs (Invocation.OverloadResolve): Don't report error
9876         CS1501 if error CS1502 has been reported.
9877         (New.DoResolve): Delegate CS1501 reporting to
9878         Invocation.OverloadResolve.
9879
9880         Fix #75656.
9881         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
9882         invariant-meaning-in-block property in an enclosing block if
9883         necessary.
9884
9885 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
9886
9887         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
9888         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
9889         (Switch.CheckSwitch): Just save 50kb for SWF.
9890
9891 2005-07-27  Martin Baulig  <martin@ximian.com>
9892
9893         * anonymous.cs (CaptureContext.AddField): Added
9894         `AnonymousContainer am' argument; compute its toplevel scope if
9895         it's not already computed.  Fixes #75649.
9896
9897 2005-07-26  Raja R Harinath  <rharinath@novell.com>
9898
9899         Fix #75628.
9900         * class.cs (Constructor.Emit): Reset block to null if the block
9901         resolve fails.
9902
9903 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
9904
9905         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
9906
9907 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
9908
9909         * class.cs (MethodData.Define): Check whether accessor implementing
9910         interface is public.
9911
9912         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
9913
9914 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
9915
9916         Fix #57245
9917         * namespace.cs (LookupType): Moved same type check to...
9918         
9919         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
9920         with the same name.
9921
9922 2005-07-21  Raja R Harinath  <rharinath@novell.com>
9923
9924         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
9925         already found a typebuilder.
9926         * class.cs (MethodCore.IsDuplicateImplementation): Compare
9927         MemberNames, not strings.
9928
9929         * const.cs (Error_ExpressionMustBeConst): 
9930         Rename from Error_EpressionMustBeConst.
9931         * const.cs, class.cs, statement.cd: Update.
9932
9933 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
9934
9935         Fix #65573
9936
9937         * const.cs (Const.LookupConstantValue): Report missing contant expression
9938         everytime.
9939         (Error_EpressionMustBeConstant): Only one error method.
9940
9941         * class.cs, statement.c: Updated.
9942
9943 2005-07-20  Raja R Harinath  <rharinath@novell.com>
9944
9945         * statement.cs (Block.Flags): Add back HasVarargs.
9946         (Block.flags): Make protected.
9947         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9948
9949         * typemanager.cs (types, typecontainers, user_types): Remove.
9950         (UserTypes, TypeContainers): Likewise.
9951         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9952         (CleanUp, Reset): Update.
9953         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
9954         (GetNestedType): Use Type.GetNestedType.
9955         (CoreLookupType): Take two arguments, the namespace and the
9956         basename of the type.  Update to use the Namespace.Lookup
9957         mechanism.
9958         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9959         (RealMemberLookup): Use IsNestedChildOf instead of playing with
9960         string concatenation and substring matches.
9961         * class.cs, enum.cs, delegate.cs: Update to changes.
9962
9963 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
9964
9965         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9966         Expression and made virtual.
9967
9968         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9969         (ImplicitStandardConversionExists): Fixed `byte' typo ?
9970
9971         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9972
9973         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9974         error message.
9975
9976         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9977         change.
9978
9979 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
9980
9981         Fix #57707
9982         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9983         AssemblyCultureAttribute is not used on executable.
9984
9985         * rootcontext.cs,
9986         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9987
9988 2005-07-16  Raja R Harinath  <rharinath@novell.com>
9989
9990         Fix #60638.
9991         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9992         New.  Reports CS0252/CS0253.
9993         Mostly taken from preliminary patch by Duncak Mak.
9994         (Binary.DoResolveOperator): Store results of operator lookup.
9995         Use them to detect if we need to warn about unintended reference
9996         comparisons.
9997
9998 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9999
10000         Fix #72969.
10001         * namespace.cs (Namespace.Lookup): Add back location parameter.
10002         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10003         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10004
10005         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10006         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10007         (Namespace.LookupType): ... this.
10008         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10009         of namespaces.
10010         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10011         purported to handle pointers.
10012         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10013         CoreLookupType.
10014
10015 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10016
10017         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10018         type as namespace.
10019
10020 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10021
10022         * namespace.cs (Namespace.Lookup): Drop location parameter.
10023         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10024         (NamespaceEntry.Lookup): ... this.
10025         (NamespaceEntry.Error_AmbiguousTypeReference):
10026         Move here from DeclSpace.
10027         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10028         names ...
10029         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10030         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10031         Move to NamespaceEntry.
10032         * delegate.cs, expression.cs: Update to changes.
10033
10034 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10035
10036         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10037         CheckAttributeType and refactored.
10038         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10039         ResolveAsTypeTerminal error handling.
10040         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10041         handling.
10042         (GetSignatureForError): Print errors in same way.
10043
10044         * class.cs,
10045         * codegen.cs: Reflect attribute GetSignatureForError change.
10046
10047         * ecore.cs,
10048         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10049
10050         * namespace.cs (UsingEntry): Refactored to make fields private.
10051
10052         * assign.cs,
10053         statement.cs: Error_UnexpectedKind has extra parameter.
10054
10055 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10056
10057         * ecore.cs (IAlias): Remove.
10058         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10059         that implement the interface.
10060         * namespace.cs (Namespace): Likewise.
10061         (Namespace.declspaces): Renamed from 'defined_names'.
10062         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10063         DeclSpace instead of an IAlias.
10064         * tree.cs (Tree.AddDecl): Update.
10065
10066 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10067
10068         * statement.cs (Block.Flags); Remove HasVarargs.
10069         (Block.HasVarargs): Move to ToplevelBlock.
10070         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10071         (Block.Variables): Make protected.  Initialize variable hashtable
10072         if necessary.
10073         (Block.AddVariable): Update.
10074         (Block.Resolve): Update to changes.
10075         (ToplevelBlock.HasVarargs): New boolean.
10076         (ToplevelBlock.ThisVariable): Move here from Block.
10077         (ToplevelBlock.AddThisVariable): Likewise.
10078         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10079         * expression.cs (This.ResolveBase): Update to changes.
10080         (ArglistAccess.DoResolve): Likewise.
10081
10082 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10083
10084         Fix #75321
10085         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10086
10087         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10088         not used and not used & assigned.
10089         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10090
10091 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10092
10093         Fix #75053
10094         * expression.cs (Is.DoResolve): null is never provided type.
10095
10096 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10097
10098         Fix #52496
10099         * cs-parser.jay: Less strict event error rule to catch more errors.
10100
10101 2005-07-08  Martin Baulig  <martin@ximian.com>
10102
10103         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10104         gettter (allowed) or setter (not allowed).
10105
10106         * class.cs (Accessor): Implement IIteratorContainer.
10107         (Accessor.Yields): New public field.
10108         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10109         per-accessor basis.
10110
10111         * cs-parser.jay
10112         (get_accessor_declaration, set_accessor_declaration): Set the
10113         `yields' flag on the accessor, not the property.
10114         (property_declaration): Do the iterators check on a per-accessor
10115         basis and not for the whole property.
10116
10117 2005-07-08  Martin Baulig  <martin@ximian.com>
10118
10119         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10120         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10121
10122 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10123
10124         Fix #74975
10125         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10126         (ExtractSecurityPermissionSet): Cope with self referencing security
10127         attributes properly.
10128
10129         * driver.cs (SetOutputFile): Made public property OutputFile.
10130
10131 2005-07-07  Raja R Harinath  <rharinath@novell.com>
10132
10133         Fix #75486.
10134         * class.cs (TypeContainer.first_nonstatic_field): Rename from
10135         has_nonstatic_fields.  Make into a FieldBase pointer.
10136         (TypeContainer.AddField): Add CS0282 check.
10137         (TypeContainer.EmitType): Update.
10138
10139 2005-07-06  Miguel de Icaza  <miguel@novell.com>
10140
10141         * cs-tokenizer.cs (consume_identifier): Do not create strings to
10142         compare if they start with __.
10143
10144 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10145
10146         * statement.cs (Switch.SwitchGoverningType): Only look at
10147         UserCasts that don't need implicit standard conversions to one of
10148         the allowed switch types (Fixes test-322.cs).
10149         (LocalInfo.Resolve): Re-enable sanity-test.
10150
10151 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
10152
10153         * cs-tokenizer.cs (consume_identifier): Detect double undescores
10154         
10155         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10156         
10157         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10158
10159 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10160
10161         Fix #75472.
10162         * ecore.cs (SimpleName.GetSignatureForError): Add.
10163         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10164         (MemberAccess.GetSignatureForError): Add.
10165
10166 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
10167  
10168         The big error and warning messages review.
10169         
10170         * anonymous.cs,
10171         * assign.cs,
10172         * attribute.cs,
10173         * class.cs,
10174         * codegen.cs,
10175         * convert.cs,
10176         * cs-parser.jay,
10177         * cs-tokenizer.cs,
10178         * decl.cs,
10179         * delegate.cs,
10180         * doc.cs,
10181         * driver.cs,
10182         * ecore.cs,
10183         * enum.cs,
10184         * expression.cs,
10185         * flowanalysis.cs,
10186         * iterators.cs,
10187         * literal.cs,
10188         * location.cs,
10189         * modifiers.cs,
10190         * namespace.cs,
10191         * parameter.cs,
10192         * pending.cs,
10193         * report.cs,
10194         * rootcontext.cs,
10195         * statement.cs,
10196         * support.cs,
10197         * tree.cs,
10198         * typemanager.cs: Updated.
10199         
10200         * class.cs: (MethodCore.SetYields): Moved here to share.
10201         (PropertyMethod.Define): Moved iterator setup here.
10202         
10203         * iterators.cs: Add orig_method to have full access to parent
10204         container.
10205
10206 2005-07-05  Raja R Harinath  <rharinath@novell.com>
10207
10208         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10209         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10210         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10211         variable of struct type.
10212         * expression.cs (Unary.ResolveOperator): Update to change.
10213         (Indirection.VerifyFixed): Likewise.
10214         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10215         (ParameterReference.VerifyFixed): Value parameters are fixed.
10216         (This.VerifyFixed): Treat 'this' as a value parameter.
10217         * statement.cs (LocalInfo.IsFixed): Remove.
10218
10219 2005-07-01  Martin Baulig  <martin@ximian.com>
10220
10221         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10222         `ec.EmitThis ()' to get the correct scope.
10223
10224 2005-07-01  Martin Baulig  <martin@ximian.com>
10225
10226         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10227         instance is a ParameterReference; fixes #75299.
10228
10229 2005-07-01  Martin Baulig  <martin@ximian.com>
10230
10231         Reverted Marek's latest patch (r46725):
10232         - it contains structural changes which are neither mentioned in
10233           the ChangeLog nor explained anywhere; for example the additional
10234           argument of EmitContext's and Iterator's .ctor's and the
10235           TypeContainer.DefineMembers() change.
10236         - structural changes like this should go in in seperate patches
10237           and not be hidden in a huge patch which just seems to affect
10238           warnings and errors.
10239           a big and hard to understand patch.
10240         - it breaks iterators and causes regressions, for instance in
10241           test-iter-03.cs.      
10242
10243 2005-06-30  Raja R Harinath  <rharinath@novell.com>
10244
10245         Fix #75412.
10246         * expression.cs (Indexers.map): Remove.
10247         (Indexers.Append): Filter out inaccessible setters and getters.
10248         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10249
10250         Fix #75283.
10251         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
10252         Refactored from ...
10253         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10254         (FieldExpr.Emit, PropertyExpr.Emit): Update.
10255         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10256         * expression.cs (Invocation.EmitCall): Add CS0120 check.
10257
10258 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
10259
10260         Fix #75322
10261         * class.cs (FieldBase.GetInitializerExpression): One more field
10262         for backup.
10263
10264 2005-06-28  Miguel de Icaza  <miguel@novell.com>
10265
10266         * pending.cs: Do not define a proxy if the base method is virtual,
10267         it will be picked up by the runtime (bug 75270).
10268
10269 2005-06-08  Martin Baulig  <martin@ximian.com>
10270
10271         The big Iterators rewrite :-)
10272
10273         * iterators.cs: Rewrite this to use the anonymous methods framework.
10274
10275         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10276         before the TypeContainers; see 2test-21.cs.
10277
10278         * class.cs
10279         (TypeContainer.DefineType): Don't create a new EmitContext if we
10280         already have one (this only happens if we're an Iterator).
10281         (TypeContainer.Define): Also call Define() on all our iterators.
10282         (Method.CreateEmitContext): Added support for iterators.
10283
10284         * anonymous.cs
10285         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10286         (AnonymousContainer.CreateMethodHost): Moved here from
10287         AnonymousMethod and made abstract.
10288         (AnonymousContainer.CreateScopeType): New abstract method.
10289         (AnonymousContainer.IsIterator): New public property.
10290         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10291         get the ScopeTypeBuilder rather than manually defining it here. 
10292         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10293         iterators here.
10294
10295         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10296         before RootContext.DefineTypes().
10297
10298         * codegen.cs (EmitContext.RemapToProxy): Removed.
10299         (EmitContext.CurrentAnonymousMethod): Changed type from
10300         AnonymousMethod -> AnonymousContainer.
10301         (EmitContext.ResolveTopBlock): Protect from being called twice.
10302         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10303         (EmitContext.EmitThis): Removed the iterators hacks; use the
10304         anonymous methods framework for that.
10305
10306         * statement.cs
10307         (ToplevelBlock.Container): Make this a property, not a field.
10308         (ToplevelBlock.ReParent): New public method; move the
10309         ToplevelBlock into a new container.
10310         (Foreach.TemporaryVariable): Simplify.
10311
10312 2005-06-05  Martin Baulig  <martin@ximian.com>
10313
10314         * statement.cs (LocalInfo.CompilerGenerated): New flag.
10315         (Block.AddTemporaryVariable): New public method; creates a new
10316         `LocalInfo' for a temporary variable.
10317         (Block.EmitMeta): Create the LocalBuilders for all the temporary
10318         variables here.
10319         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10320         non-iterator variables.
10321
10322 2005-06-05  Martin Baulig  <martin@ximian.com>
10323
10324         * statement.cs (Foreach.TemporaryVariable): Create the
10325         LocalBuilder in the Emit phase and not in Resolve since in some
10326         situations, we don't have an ILGenerator during Resolve; see
10327         2test-19.cs for an example.
10328
10329 2005-06-04  Martin Baulig  <martin@ximian.com>
10330
10331         **** Merged r45395 from GCS ****
10332
10333         The big Foreach rewrite - Part II.
10334
10335         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10336         with `PropertyInfo ienumerator_getcurrent'.
10337
10338         * codegen.cs (VariableStorage): Removed.
10339
10340         * statement.cs
10341         (Foreach): Derive from Statement, not ExceptionStatement.
10342         (Foreach.CollectionForeach): New nested class.  Moved all the code
10343         dealing with collection foreach here.
10344         (Foreach.ForeachHelperMethods): Removed.
10345         (Foreach.TemporaryVariable): Implement IMemoryLocation.
10346
10347 2005-05-23  Martin Baulig  <martin@ximian.com>
10348
10349         * statement.cs (Try.DoResolve): Don't create a `finally' if we
10350         don't need to.  Fix #75014.
10351
10352 2005-05-20  Martin Baulig  <martin@ximian.com>
10353
10354         Merged r44808 from GMCS.
10355
10356         * class.cs (TypeContainer.CircularDepException): Removed.
10357         (TypeContainer.DefineType): Removed the `InTransit' stuff.
10358         (TypeContainer.CheckRecursiveDefinition): Check for circular class
10359         (CS0146) and interface (CS0529) dependencies here.
10360
10361 2005-06-21  Raja R Harinath  <rharinath@novell.com>
10362
10363         * expression.cs (Invocation.EmitCall): Fix initialization
10364         'this_call' to reflect current behaviour.  Fix indentation.
10365
10366         * convert.cs (FindMostEncompassedType): Add two trivial special
10367         cases (number_of_types == 0 || number_of_types == 1).
10368         (FindMostEncompasingType): Likewise.
10369
10370 2005-06-17  Raja R Harinath  <rharinath@novell.com>
10371
10372         Some cleanups preparing for the fix of #75283.
10373         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10374         error testing.
10375         (EventExpr.InstanceResolve): Likewise.
10376         (EventExpr.DoResolve): Remove redundant checks.
10377
10378 2005-06-10  Duncan Mak  <duncan@novell.com>
10379
10380         * cs-tokenizer.cs (process_directives): New flag for controlling
10381         the processing of preprocessor directives.
10382         (x_token): After seeing a '#', return Token.NONE instead of going
10383         to handle_preprocessing_directive() when not processing
10384         directives. This avoids unnecessary processing during the token peek in
10385         is_punct().
10386
10387         This fixes #74939.
10388
10389         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10390         the existing error reporting methods instead of Report.Error.
10391
10392         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10393         after Raja's rewrite.
10394
10395 2005-06-08  Miguel de Icaza  <miguel@novell.com>
10396
10397         * class.cs: Small fix.
10398
10399 2005-06-08  Raja R Harinath  <rharinath@novell.com>
10400
10401         Fix #75160.
10402         * class.cs (GetPartialBases): Fix return value check of
10403         part.GetClassBases.
10404
10405 2005-06-07  Raja R Harinath  <rharinath@novell.com>
10406
10407         Ensure that partial classes are registered in their enclosing
10408         namespace.  Initial part of fix of #75160.
10409         * tree.cs (Tree.RecordDecl): Add new namespace argument.
10410         Register declspace with namespace here, not in
10411         DeclSpace.RecordDecl.
10412         * cs-parser.jay: Pass namespace to RecordDecl.
10413         * class.cs (PartialContainer.Create): Likewise.
10414         (ClassPart.DefineType): New sanity-check.  Throws an exception if
10415         called.
10416         * decl.cs (Declspace.RecordDecl): Remove.
10417         * namespace.cs (NamespaceEntry.DefineName): Remove.
10418
10419 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
10420
10421         * rootcontext.cs: Reset TargetExt as well.
10422
10423 2005-06-03  Raja R Harinath  <rharinath@novell.com>
10424
10425         * ecore.cs (Expression.Resolve): Emit CS0654 error when
10426         -langversion:ISO-1.
10427
10428 2005-06-02  Raja R Harinath  <rharinath@novell.com>
10429
10430         Fix #75080, cs0119.cs.
10431         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
10432         of ...
10433         (Expression.Resolve): ... this.  Use it.  Remove bogus code
10434         allowing ExprClass.Type and ExprClass.Namespace for
10435         ResolveFlags.VariableOrValue.
10436         (Expression.Resolve) [1-argument variant]: Change default resolve
10437         flags based on language version.
10438         (Expression.Error_UnexpectedKind): Use a simple string array
10439         rather than an ArrayList.
10440         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10441         not ExprClass.Type.
10442         (TypeOfVoid.DoResolve): Likewise.
10443         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
10444         flags argument -- it always has the same value.
10445
10446 2005-05-31  Raja R Harinath  <rharinath@novell.com>
10447
10448         Fix #75081.
10449         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10450         Use it in the error message.
10451         * assign.cs, expression.cs, statement.cs: Update.
10452
10453 2005-05-30  Raja R Harinath  <rharinath@novell.com>
10454
10455         Fix #75088.
10456         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10457         the "almostMatchedMember" case too.
10458         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10459         that failed the accessibility checks to 'almost_match'.
10460
10461 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
10462
10463         * attribute.cs: Use internal MethodBuilder methods to set
10464         ExactSpelling and SetLastError on PInvoke methods, instead
10465         of passing them via charset.  Fixes #75060.
10466
10467 2005-05-27  Raja R Harinath  <rharinath@novell.com>
10468
10469         * parameter.cs (Parameter): Remove TODO comment.
10470         (Parameter.DefineParameter): Remove Location parameter.
10471         (Parameters.LabelParameters): Likewise.
10472         * class.cs (Constructor.Emit): Update to change.
10473         (MethodData.Emit): Likewise.
10474         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
10475         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10476
10477 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
10478
10479         * parameter.cs,
10480           Removed Parameters.Location and added Parameter.Location instead.
10481           Removed Location parameter from Emit() and GetSignature().
10482         * anonymous.cs,
10483           class.cs,
10484           cs-parser.jay,
10485           delegate.cs,
10486           iterators.cs,
10487           statement.cs :
10488           Modified all related calls.
10489
10490 2005-05-26  Raja R Harinath  <rharinath@novell.com>
10491
10492         Improve user-defined conversion handling.
10493         * convert.cs (GetConversionOperators): Rewrite.  Return only the
10494         applicable operators.
10495         (AddConversionOperators): New.  Helper for GetConversionOperators.
10496         (FindMostEncompassedType, FindMostEncompassingType): Verify that
10497         there is only one most encompassed/encompassing type.
10498         (FindMostSpecificSource, FindMostSpecificTarget): Remove
10499         "applicable operator" handling.
10500         (UserConversion): Move cache here from GetConversionOperators.
10501         Directly cache the chosen operator, rather than the whole
10502         MethodGroup.
10503         (ExplicitNumericConversion): Fix buggy implementation of Decimal
10504         case.  Allow conversion of decimal to sbyte and byte too.
10505         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
10506         New static methods.  Used to avoid allocating EmptyExpressions in
10507         convert.cs.
10508
10509 2005-05-24  Duncan Mak  <duncan@novell.com>
10510
10511         * ecore.cs (CastFromDecimal): New class for casting a decimal to
10512         another class, used in Convert.ExplicitNumericConversion.
10513         (CastToDecimal): New class, similar to above, but casts to
10514         System.Decimal, used in Convert.ImplicitNumericConversion and also
10515         in explicit convesion from double/float to decimal.
10516
10517         * convert.cs (ImplicitNumericConversion): Handle implicit
10518         conversions to System.Decimal.
10519         (ExplicitNumericConversion): handle explicit conversions to
10520         System.Decimal.
10521
10522         This fixes #68711.
10523         
10524 2005-05-20  Miguel de Icaza  <miguel@novell.com>
10525
10526         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
10527         know the type at this stage, just break through.   Fixes #75008 
10528
10529 2005-05-19  Martin Baulig  <martin@ximian.com>
10530
10531         * delegate.cs
10532         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
10533         to disable error reporting.
10534
10535         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
10536         here since we don't want to report an error; see the new test-336.cs.
10537
10538 2005-05-19  Raja R Harinath  <rharinath@novell.com>
10539
10540         * statement.cs (ToplevelBlock.GetParameterReference)
10541         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
10542         Move here from class Block.
10543         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
10544         * expression.cs (ParameterReference.DoResolveBase): Likewise.
10545
10546 2005-05-18  Martin Baulig  <martin@ximian.com>
10547
10548         Fix #74978.
10549
10550         * flowanalysis.cs
10551         (FlowBranching.Reachability): Add non-static public And() and Or()
10552         methods.
10553         (FlowBranchingSwitch): New class; do the `break_origins' thing
10554         like in FlowBranchingLoop.
10555         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
10556         reachability, not just locals and parameters.
10557         (FlowBranching.MergeChild): Remove some of the hacks for loop and
10558         switch; MergeBreakOrigins() now takes care of that.
10559
10560 2005-05-18  Martin Baulig  <martin@ximian.com>
10561
10562         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10563         a loop and may leave it, reset the barrier; fixes #74974.
10564
10565 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
10566         
10567         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
10568         is back.
10569         
10570         * cs-parser.jay: Catch more lexical errors.
10571         
10572         * report.cs: Add one more Error method.
10573         
10574         * rootcontext.cs,
10575         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
10576
10577 2005-05-17  Martin Baulig  <martin@ximian.com>
10578
10579         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
10580         #70970. 
10581
10582 2005-05-16  Raja R Harinath  <rharinath@novell.com>
10583
10584         Fix test-382.cs.  Emit values of decimal constants.
10585         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
10586         Carved out of ...
10587         (TypeContainer.AddField): ... this.
10588         (TypeContainer.EmitFieldInitializers): Allow the list of fields
10589         with initializers to include 'Const's.
10590         (ClassPart.RegisterFieldForInitialization): Forward to
10591         PartialContainer.
10592         * const.cs (Const.Const): Pass initializer to base class.
10593         (Const.Define): In case of decimal constants, register them for
10594         initialization in a static constructor.
10595
10596 2005-05-14  Martin Baulig  <martin@ximian.com>
10597
10598         * statement.cs (Block.Resolve): Correctly handle unreachable code;
10599         do not call ResolveUnreachable() on unreachable statements in
10600         here, see the comment in the source code.
10601
10602 2005-05-13  Raja R Harinath  <rharinath@novell.com>
10603
10604         Fix #74934.
10605         * expression.cs (BinaryResolveOperator): If one of the operands of
10606         an equality comparison is 'null' and the other is a pointer type,
10607         convert the null to a NullPointer.
10608         * convert.cs (ImplicitReferenceConversion): If the expression is a
10609         NullLiteral and the target type is a pointer type, return a
10610         NullPointer instead.
10611         (ImplicitConversionStandard): Likewise.
10612
10613 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
10614         
10615         * cs-parser.jay: Set readonly context based on special constructs.
10616         
10617         * expression.cs (LocalVariableReference.DoResolveBase): Improved
10618         readonly variable error handling.
10619         
10620         * rootcontext.cs (EmitCode): Don't verify members when error
10621         occurred.
10622         
10623         * statement.cs (LocalInfo): Add reaodnly context information.
10624         (SetReadOnlyContext, GetReadOnlyContext): New methods.
10625
10626 2005-05-13  Raja R Harinath  <rharinath@novell.com>
10627
10628         * statement.cs (Block.Resolve): Revert change below.  Modify fix
10629         for #74041 to initialize 'resolved' to false only for explicit
10630         blocks.  Fixes #74873.
10631
10632 2005-05-12  Raja R Harinath  <harinath@gmail.com>
10633
10634         Fix #74920.
10635         * typemanager.cs (unmanaged_enclosing_types): New.
10636         (IsUnmanagedType): Avoid infloops by using
10637         'unmanaged_enclosing_types' to talk with recursive invocations.
10638
10639 2005-05-13  Martin Baulig  <martin@ximian.com>
10640
10641         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
10642         instance variable, not a local.  Fix #74873.
10643         (Block.ResolveUnreachable): Set it to true here.
10644
10645 2005-05-11  Duncan Mak  <duncan@novell.com>
10646
10647         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
10648         continuing to process for 'arg'.
10649         (handle_preprocessing_directive): Check the argument of the #endif
10650         directive and report error CS1025 if there are any trailing
10651         characters.
10652
10653         According to the C# spec, having even whitespace after the #endif
10654         directive is illegal; however, because we call arg.TrimEnd ()
10655         beforehand, we have the same behavior as csc, allowing whitespace
10656         after the directive.
10657
10658         Fixes #74892.
10659
10660 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
10661
10662         Fix #74863.
10663         
10664         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
10665         (Constructor.GetObsoleteAttribute): Implemented correctly.
10666
10667 2005-05-10  Martin Baulig  <martin@ximian.com>
10668
10669         * support.cs (ReflectionParameters.ParameterModifier): Use
10670         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
10671         and `ParameterAttributes.In'.  Fixes #74884.
10672
10673 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
10674
10675         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
10676         
10677         * expression.cs (Argument.GetParameterModifier): Turned to property.
10678         (Invocation.Error_InvalidArguments): Add more descriptive errors.
10679         
10680         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
10681         its C# equivalent.
10682         
10683 2005-05-09  Raja R Harinath  <rharinath@novell.com>
10684
10685         Fix #74852.
10686         * decl.cs (MemberCache.AddMethods): Register override methods,
10687         rather than non-override methods.
10688         * typemanager.cs (RegisterOverride): New.
10689         (IsOverride): Update.
10690
10691 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
10692
10693         Fix #73105.
10694         
10695         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
10696         recursive declaration.
10697         
10698         * statement.cs (Block.ResolveMeta): Report any error in resolving.
10699         
10700 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
10701
10702         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
10703         
10704         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
10705
10706 2005-05-05  Raja R Harinath  <rharinath@novell.com>
10707
10708         Fix #74797.
10709         * decl.cs (DeclSpace.FamilyAccessible): 
10710         Use TypeManager.IsNestedFamilyAccessible.
10711
10712         Fix reopened #64812.
10713         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
10714         internal'.
10715
10716 2005-05-04  Raja R Harinath  <rharinath@novell.com>
10717             Abin Thomas  <projectmonokochi@rediffmail.com>
10718             Anoob V E  <projectmonokochi@rediffmail.com>
10719             Harilal P R  <projectmonokochi@rediffmail.com>
10720
10721         Fix #64812.
10722         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
10723         allow access to all static members.
10724
10725 2005-05-04  Martin Baulig  <martin@ximian.com>
10726
10727         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
10728
10729 2005-05-04  Martin Baulig  <martin@ximian.com>
10730
10731         Fix #74655.
10732
10733         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
10734         section at the end; make things work if `default' is not the last
10735         section.        
10736
10737 2005-05-04  Martin Baulig  <martin@ximian.com>
10738
10739         Fix #70400.
10740
10741         * statement.cs (Switch): Replaced the `got_default' field with a
10742         `default_section' one.
10743         (Switch.CheckSwitch): Set `default_section' here.
10744         (Switch.Resolve): If we're a constant switch and the constant is
10745         not found, use the default section.
10746
10747 2005-05-03  Martin Baulig  <martin@ximian.com>
10748
10749         * expression.cs (ArrayAccess.EmitGetLength): New public method.
10750
10751         * statement.cs (Foreach.ArrayForeach): New nested class.
10752         (Foreach.TemporaryVariable): New nested class.
10753         (Foreach.EmitArrayForeach): Removed; this is now in the new
10754         ArrayForeach class.
10755
10756 2005-05-03  Raja R Harinath  <rharinath@novell.com>
10757
10758         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
10759         more conservative.
10760         (VerifyPendingMethods): Revert change below.
10761
10762         * typemanager.cs (IsOverride, RegisterNonOverride): New.
10763         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
10764         that used to trigger warning -28.  Remove warning -28.
10765         * expression.cs (Invocation.OverloadResolve): Use
10766         TypeManager.IsOverride to distinguish override methods.
10767
10768         Fix #74773.
10769         * pending.cs (VerifyPendingMethods): If a base type implements the
10770         requested interface, don't bother checking individual methods of
10771         the base type.  As a side-effect, this prevents the creation of
10772         unnecessary proxies.
10773
10774 2005-05-02  Martin Baulig  <martin@ximian.com>
10775
10776         Fix #70182.
10777
10778         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10779         Also `And' the locals if the old vector is null.
10780         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
10781         null; in this case we basically reset all the variables.        
10782
10783 2005-05-02  Martin Baulig  <martin@ximian.com>
10784
10785         Fix #74529.
10786
10787         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
10788         Added `FlowBranching branching' argument; always `and' the
10789         variables instead of `or'ing them unless we're an infinite loop.
10790
10791         * statement.cs (While.Resolve): Create a new sibling unless we're
10792         infinite.       
10793
10794 2005-05-02  Martin Baulig  <martin@ximian.com>
10795
10796         Fix #70140.
10797
10798         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
10799         arguments; use it instead of creating a new TopLevelBlock.
10800         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
10801         our ConstructorInitializer.
10802
10803         * statement.cs
10804         (TopLevelBlock.TopLevelBranching): New public property.
10805         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
10806         and create our `TopLevelBranching'.
10807
10808         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
10809         anonymous method host, use `block.TopLevelBranching' rather than
10810         creating a new branching.
10811
10812 2005-04-20  Miguel de Icaza  <miguel@novell.com>
10813
10814         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
10815         a ScopeInfo, if any of the current children is a child of the new
10816         entry, move those children there.
10817
10818 2005-04-30  Martin Baulig  <martin@ximian.com>
10819
10820         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
10821         at the beginning of a SwitchSection.  Fix #73335.
10822
10823 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
10824
10825         Fix #74378
10826         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
10827         
10828         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
10829         (FieldExpr.DoResolve): Obsolete members are ignored for field
10830         initializers.
10831         
10832 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
10833
10834         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
10835         of arrays detection.
10836
10837         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
10838         verification.
10839         (Field.VerifyClsCompliance): Volatile fields are not compliant.
10840
10841         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
10842         arrays report.
10843
10844 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
10845
10846         * cs-parser.jay: Use the prefered version of -unsafe in error
10847         message.
10848
10849 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
10850
10851         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
10852         circumstances.
10853
10854 2005-04-20  John Luke  <john.luke@gmail.com>
10855
10856         * driver.cs: fix typo in error message, --outout to --output
10857
10858 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
10859
10860         * codegen.cs (InRefOutArgumentResolving): New field.
10861         
10862         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
10863         fields outside contructor.
10864         
10865         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
10866         
10867 2005-04-19  Miguel de Icaza  <miguel@novell.com>
10868
10869         * anonymous.cs (CaptureContext.EmitParameterInstance): The
10870         parameter code was not completed ever, so it was not as up-to-date
10871         as local variables.  Must finish it.
10872
10873         The bug fix was to compare the Toplevel of the block, not the
10874         current block.  Thanks for Ben for pointing this out. 
10875
10876 2005-04-19  Raja R Harinath  <rharinath@novell.com>
10877
10878         * decl.cs (AddMethods): Use the declaring type of the problem
10879         method to determine if we want to squash a warning.
10880
10881 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
10882
10883         * attribute.cs: Removed debug output.
10884
10885         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
10886         
10887         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
10888         Report.Stderr.
10889         
10890 2005-04-18  Raja R Harinath  <rharinath@novell.com>
10891
10892         Fix #74481.
10893         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
10894         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
10895         all null comparisons against reference types.
10896
10897 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
10898
10899         Fix# 74565
10900         * class.cs (TypeContainer.CircularDepException) New nested
10901         exception class.
10902         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
10903         (TypeContainer.DefineType): Removed error, reset InTransit before
10904         exit.
10905         (Class.DefineType): Throw exception when is in Transit.
10906         Catch exception and report error.
10907         (Struct.DefineType): Throw exception when is in Transit.
10908         Catch exception and report error.
10909         (Interface.DefineType): Throw exception when is in Transit.
10910         Catch exception and report error.
10911
10912         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
10913         handle nested exception handlers.
10914
10915         * flowanalysis.cs (InTryWithCatch): New method, search for try with
10916         a catch.
10917
10918         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
10919         InFinally and InCatch storage.
10920
10921         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
10922         (Catch.Resolve): Set and Restore ec.InCatch.
10923         (Try.Resolve): Set and Restore ec.InFinally.
10924         (Try.HasCatch): True when try has catch.
10925
10926 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
10927
10928         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
10929           for the same event member, so exclude such cases from warning 419.
10930           Fixed bug #74633.
10931
10932 2005-04-16  Miguel de Icaza  <miguel@novell.com>
10933
10934         * expression.cs (Binary.ResolveOperator): Apply patch from John
10935         Luke to fix bug 59864: operators &, | and ^ on enumerations
10936         require that the same enum type on both sides.
10937
10938         * driver.cs: Add warnings to old flag usage, this is to assist
10939         people who produce Makefiles and hope that the Makefiles will be
10940         used on Windows.
10941
10942         * class.cs (TypeContainer.EmitType): Moved the definition of the
10943         special $PRIVATE$ field from the resolve phase to the Emit phase.
10944         During resolve we do not know if we are a struct with
10945         HasExplicitLayout, we know this only after the attributes for the
10946         type are emitted.
10947
10948         Set the FieldOffset to zero on the dummy field that we create for
10949         the class.   Fixes 74590.
10950
10951 2005-04-16  Raja R Harinath  <rharinath@novell.com>
10952
10953         Fix #73834.
10954         * ecore.cs (PropertyExpr.resolved): New.
10955         (DoResolve): Use it to handle a case of double resolution here.
10956         Handle a case of identical-name-and-type-name.
10957         * expression.cs (ArrayCreation.CheckIndices): Avoid double
10958         resolution by storing the results of expression resolution back
10959         into the "probes" array.
10960
10961 2005-04-15  Raja R Harinath  <rharinath@novell.com>
10962
10963         Fix cs0208-7.cs and cs0208-8.cs.
10964         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10965         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
10966         error reporting to point out the reason a struct is not unmanaged.
10967
10968 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10969
10970         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
10971           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10972
10973 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10974
10975         Fix #74528.
10976         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10977         IdenticalNameAndTypeName here.
10978         (EventExpr.InstanceResolve): Likewise.
10979
10980 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
10981
10982         C# 2.0 DefaultCharSetAttribute implementation
10983         
10984         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10985         which allows us to set GlobalNamespace for every resolve.
10986         (Attribute.ResolveArguments): Cut from Resolve.
10987         (Attribute.GetCharSetValue): Returns CharSet named argument.
10988         (Attribute.DefinePInvokeMethod): Gets default charset from
10989         module settings.
10990         (GlobalAttribute.ResolveAsTypeStep): Override.
10991         (GlobalAttribute.ResolveArguments): Override.
10992         
10993         * class.cs (TypeAttr): Is protected.
10994         
10995         * codegen.cs (ModuleClass.DefaultCharSet): New member.
10996         (ModuleClass.DefaultCharSetType): New memeber.
10997         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10998         
10999         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11000         charset from module.
11001         
11002         * delegate.cs (TypeAttr): Override.
11003         (Delegate.DefineType): Use this TypeAttr.
11004         
11005         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11006         at very early stage (before types are defined) to resolve model
11007         module attributes. It will probably not work with corlib but it
11008         should be ok.
11009         
11010         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11011         charset from module.
11012         
11013         * typemanager.cs (default_charset_type): New type.
11014
11015 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11016
11017         * decl.cs (MemberCache.AddMethods): Don't warn if
11018         System.Object.Finalize has buggy MethodAttributes.
11019
11020         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11021         removed below.
11022
11023 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11024
11025         * doc.cs : detect ambiguous reference to overloaded members.
11026           Fixed bug #71603. MS 1.1 csc does not detect it.
11027
11028 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11029
11030         * doc.cs : delegates must not be referenced with parameters.
11031           Fixed bug #71605.
11032
11033 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11034
11035         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11036
11037 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11038
11039         * driver.cs (MainDriver): Stop processing if the CLS stage found
11040         errors. 
11041
11042         (CompilerCallableEntryPoint.InvokeCompiler): Always
11043         reset after execution;   Take a TextWriter argument for the
11044         output.
11045
11046         * report.cs: Use the error stream instead of hardcoding stderr. 
11047
11048 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11049
11050         * class.cs: Reduce code paths to test, too small of an
11051         optimization to make it worth the extra testing.  Always perform
11052         it. 
11053
11054 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11055
11056         Fix #74510.
11057         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11058         operators that had errors reported on them.
11059
11060 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11061
11062         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11063         argument types.
11064         (Attribute.Resolve): Add named argument type checking.
11065         
11066         * class.cs (FixedField.Define): Use IsPrimitiveType
11067         
11068         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11069         
11070         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11071         unsafe parameter types.
11072         
11073         * statement.cs (Using.ResolveExpression): Add better error description.
11074         
11075         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11076         
11077 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11078
11079         Fix #74484.
11080         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11081         AttributeUsageAttribute in the emitcontext of the attribute class,
11082         not in the emitcontext of the attributable entity it was attached to.
11083         * cs-parser.jay: Use 'current_class', not 'current_container',
11084         when creating a GlobalAttribute.
11085
11086 2005-04-08  Alp Toker  <alp@atoker.com>
11087
11088         * pending.cs: The fix to #58413 failed to compile methods implementing
11089         interfaces with/without params modifiers and vice versa, even though
11090         params modifiers aren't part of the signature. Make the modifier check
11091         less strict as in csc.
11092
11093 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11094             Anoob V E  <projectmonokochi@rediffmail.com>
11095             Harilal P R  <projectmonokochi@rediffmail.com>
11096
11097         Fix #58413.
11098         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11099         modifiers of pending methods.
11100         (PendingImplementation.PendingImplementation): Initialize it.
11101         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11102         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11103         with ParameterData.  Add check for modifiers.
11104         * class.cs (MethodData.Define): Update to changes.
11105
11106 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11107
11108         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11109
11110 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11111
11112         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11113         property.
11114         
11115         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11116         
11117         * rootcontext.cs,
11118         * typemanager.cs: Registered RequiredAttributeAttribute.
11119         
11120 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11121
11122         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11123         Warning CS0169 is back at level 3.
11124         (IMethodData.SetMemberIsUsed): New method.
11125         
11126         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11127         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11128         
11129         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11130
11131         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11132         contants.
11133         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11134         is used.
11135         
11136         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11137         is used.
11138         
11139         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11140         to avoid the problems with nested types.
11141
11142 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
11143             Anoob V.E  <projectmonokochi@rediffmail.com>
11144             Harilal P.R  <projectmonokochi@rediffmail.com>
11145             Raja R Harinath  <rharinath@novell.com>
11146
11147         Fix #73820.
11148         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11149         attribute.
11150         * typemanager (GetConstructor): Make public.
11151
11152 2005-04-05  John Luke  <john.luke@gmail.com>
11153             Raja R Harinath  <rharinath@novell.com>
11154
11155         Fix #62232.
11156         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11157         struct too.  Return false quicker in a few cases.
11158         (VerifyUnManaged): Use it.
11159
11160 2005-04-05  Raja R Harinath  <rharinath@novell.com>
11161
11162         Fix #74041.
11163         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11164         not 'unreachable_seen'.
11165
11166 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
11167
11168         * attribute.cs (Attribute.GetValue): Removed unused.
11169         
11170         * codegen.cs (CodeGen.TrimExt): Removed unused.
11171         
11172         * cs-parser.jay (output): Removed unused.
11173         
11174         * cs-tokenizer.cs (hex_digits): Removed unused.
11175         
11176         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11177         
11178         * expression.cs (Indirection.LoadExprValue): Removed unused.
11179         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11180         
11181         * iterators.cs (Iterator.param_types): Removed unused.
11182         
11183         * statement.cs (Goto.block): Removed unused.
11184         (ToplevelBlock.did): Removed unused.
11185         (Switch.ResolveConstantSwitch): Removed unused.
11186
11187 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
11188
11189         * rootcontext.cs: Allow mcs to bootstrap with the compilation
11190         resetting thingy.
11191
11192 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11193
11194         Fix #74232 and cs0208-3.cs.
11195         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11196         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11197         unmanaged type.  Don't use FieldBuilders when 't' is a
11198         TypeBuilder.  Use ModFlags and MemberType fields.
11199         * class.cs (MemberBase.member_type): Rename from MemberType.
11200         (MemberBase.MemberType): New property.  Determines member_type on
11201         demand.
11202         (MemberBase.DoDefine): Don't initialize MemberType here.
11203         (FieldMember.Define): Likewise.
11204
11205 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
11206
11207         Fix #74241
11208         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11209         Attributes are emitted there.
11210         
11211 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11212
11213         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11214         keyword in 'partial enum' too.
11215         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11216         is not allowed).
11217         Report from Kamil Skalski <nazgul@omega.pl>.
11218
11219         Fix #74309.
11220         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11221         have partial containers too.
11222
11223         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11224         in block' checks to Block.CheckInvariantMeaningInBlock.
11225         * statement.cs (Block.GetKnownVariableInfo): Make private.
11226         (Block.IsVariableUsedInChildBlock): Remove.
11227         (Block.IsVariableUsedInBlock): Likewise.
11228         (Block.CheckInvariantMeaningInBlock): New.  Show location of
11229         conflicting declaration.
11230         (Block.AddVariable): Make error messages less long-winded and more
11231         specific.  Show location of conflicting declaration.
11232         * parameter.cs (Parameters.Location): New readonly property.
11233
11234 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11235
11236         Clean up semantics of invoking ResolveMemberAccess.
11237         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11238         can have an instance, ensure that we pass in a non-TypeExpression
11239         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
11240         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11241         argument.  Update to changes and simplify.
11242         (FieldExpr.Emitinstance): Remove CS0120 check.
11243         (PropertyExpr.EmitInstance): Likewise.
11244         * expression.cs (Argument.Resolve): Likewise.
11245         (Invocation.DoResolve): Update to changes in semantics of
11246         InstanceExpression.
11247
11248 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
11249
11250         Fix #74241
11251         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11252         customization.
11253         
11254         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11255
11256 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11257
11258         Fix difference in behaviour with commandline invocation.
11259         * driver.cs (Driver.Reset): New.
11260         (CompilerCallableEntryPoint): Call it.
11261
11262         * statement.cs (If.Resolve): Avoid spurious "uninitialized
11263         variable" warnings if the boolean expression failed to resolve.
11264
11265 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
11266
11267         * attribute.cs: Fix the union of several permissions when some of them
11268         are unrestricted (so the result isn't an unrestricted permission set).
11269         Fix #74036.
11270
11271 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11272
11273         * ecore.cs (MemberExpr): New class.  Convert from interface
11274         IMemberExpr.
11275         (MemberExpr.ResolveMemberAccess): Refactor and move here from
11276         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
11277         error checks.
11278         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11279         (MethodGroupExpr.IsExplicitImpl): Remove.
11280         (Expression.GetFieldFromEvent): Remove.
11281         (SimpleName.MemberStaticCheck): Remove.
11282         (SimpleName.DoSimpleNameResolve): Update to changes.
11283         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11284         (MemberAccess.IdenticalNameAndTypeName): Remove.
11285         (MemberAccess.error176): Move to MemberExpr.
11286         (MemberAccess.DoResolve): Update to changes.
11287         (BaseAccess.DoResolve): Likewise.
11288
11289 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
11290
11291         C# 2.0 Conditional attribute class implementation
11292         
11293         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11294         Analyzes class whether it has attribute which has ConditionalAttribute
11295         and its condition is not defined.
11296         
11297         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11298         (Class.IsExcluded): New method. Search for at least one defined
11299         condition in ConditionalAttribute of attribute class.
11300
11301 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11302
11303         * ecore.cs (PropertyExpr): Derive from Expression, not
11304         ExpressionStatement.
11305         (PropertyExpr.EmitStatement): Remove.
11306
11307 2005-03-29  Raja R Harinath  <rharinath@novell.com>
11308
11309         Fix #74060.
11310         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11311         internal field "value__" of an enum be private.  The examples for
11312         "value__" that I found on MSDN all used FieldAttributes.Private.
11313
11314         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11315         Don't mention IL method attribute names.
11316
11317         Fix #47991.  Remove a TODO.
11318         * statement.cs (Block.Toplevel): Make into a field.
11319         (Block.Parameters): Move into ToplevelBlock.
11320         (Block.known_variables): Rename from child_variable_names.
11321         (Block.Block): Remove variants that take Parameters.  Initialize
11322         'Toplevel' with the immediately surrounding toplevel block.
11323         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
11324         LocalInfo parameter.
11325         (Block.GetKnownVariableInfo): New.
11326         (Block.IsVariableNameUsedInChildBlock): Update.
11327         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
11328         the block, even though it may not be in scope.
11329         (Block.AddVariable): Remove Parameters parameter.  Use
11330         Toplevel.Parameters instead.
11331         (Block.AddConstant): Remove Parameters parameter.
11332         (Block.GetParameterReference): Update to use Toplevel.Parameters.
11333         (Block.IsParamaterReference): Likewise.
11334         (Block.IsLocalParameter): Likewise.  Simplify a lot.
11335         (ToplevelBlock.Parameters): New.  Moved from Block.
11336         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
11337         initialize Parameters to a non-null value.
11338         * cs-parser.jay: Update to changes.
11339         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11340         simple names that mean different things in the same block.  Use
11341         Block.IsVariableNameUsedInBlock.
11342
11343 2005-03-28  Raja R Harinath  <rharinath@novell.com>
11344
11345         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11346         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11347         GetTypeHandle.  It is possible for a reflected type to derive from
11348         a TypeBuilder (e.g., int[] derives from the TypeBuilder
11349         System.Array during mscorlib compilation).
11350         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11351         contain a method_hash, don't create one either.  Don't create a
11352         deep copy of the base cache's method_hash.
11353         (MemberCache.SetupCache): Rename back from DeepCopy.
11354         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11355         already initialized.  If we see an override function, add its
11356         underlying base virtual function to the member_hash too.
11357
11358         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11359
11360 2005-03-26  Raja R Harinath  <harinath@acm.org>
11361
11362         Fix #73038.
11363         * assign.cs (Assign.DoResolve): When the RHS of an assignment
11364         fails to resolve, ensure that the LHS is still resolved as an
11365         lvalue.
11366
11367 2005-03-25  Raja R Harinath  <harinath@acm.org>
11368
11369         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11370         ec.ContainerType.
11371         (Enum.current_ec): Remove.
11372         (Enum.LookupEnumValue): Remove EmitContext argument.
11373         Just uses the one created during DefineType.
11374         (Enum.FindMembers): Update.
11375         * expression.cs (MemberAccess.DoResolve): Update.
11376
11377 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
11378
11379         * assign.cs (Assign.DoResolve): Check for CS1717 when
11380         source and target are same (uses Equals).
11381
11382         * expression.cs (LocalVariableReference, ParameterReference,
11383         This): Implemented Equals, GetHashCode.
11384
11385         * statement.cs (Block.GetParameterReference): Removed useless
11386         local variable.
11387
11388 2005-03-22  Raja R Harinath  <rharinath@novell.com>
11389
11390         Fix cs0128.cs
11391         * statement.cs (Block.AddVariable): Ensure that we skip implicit
11392         blocks before deciding whether the error is cs0136 or cs0128.
11393
11394         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11395         (using_alias_directive, using_namespace_directive): Pass
11396         MemberName, not an expression to Namespace.UsingAlias and
11397         Namespace.Using.
11398         (MakeName): Use the MemberName of the namespace.
11399         * namespace.cs (Namespace.MemberName): New.
11400         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11401         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11402         Likewise.
11403         * decl.cs (MemberName.Name): Make readonly.
11404         (MemberName.FromDotted): New "constructor".
11405         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11406         (MemberCore.Name): Compute from MemberName on demand.
11407         (MemberCore.SetMemberName): Provide a way to change the
11408         MemberName.
11409         (MemberCore.AddToContainer): Don't take a fullname parameter.
11410         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11411         fully qualified name of the container to the member name.
11412         (TypeContainer.AddToTypeContainer): Use a fully qualified name
11413         only if the type is a member of the root container.
11414         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11415         MemberName.Left rather than searching for an embedded ".".
11416         (PartialContainer.CreatePart): Update to changes in RootContext.
11417         (MemberBase.ShortName): Turn into a property.  Use
11418         MemberCore.SetMemberName.
11419         (MemberBase.ExplicitInterfaceName): Remove.
11420         (MemberBase.UpdateMemberName): Remove.
11421         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11422         (PropertyBase.SetMemberName): New override.
11423         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11424         (Tree.GetDecl): New.
11425         (Tree.AllDecls): Rename from Decls.
11426         * attribute.cs, enum.cs, report.cs: Update to changes.
11427         * driver.cs (MainDriver): Use MemberName.FromDotted on
11428         RootContext.MainClass.
11429
11430 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
11431
11432         * class.cs (FixedField.Define): Check for CS1664 and more sanity
11433         checks.
11434
11435         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11436
11437 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
11438
11439         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11440         property accessor modifiers.
11441
11442         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11443         fixed buffer attribute (CS1716).
11444         (PropertyMethod.HasCustomAccessModifier): When property accessor
11445         has custom modifier.
11446
11447         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11448         modifiers.
11449         (PropertyExpr.DoResolveLValue): Add CS0272.
11450
11451 2005-03-17  Miguel de Icaza  <miguel@novell.com>
11452
11453         * convert.cs: When converting to a pointer, use the proper Conv.U
11454         or Conv.I depending on the source data type.
11455
11456         * cs-tokenizer.cs: Make the size for large decimal constants,
11457         fixes #72957.
11458
11459 2005-03-17  Martin Baulig  <martin@ximian.com>
11460
11461         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11462         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
11463
11464 2005-03-17  Martin Baulig  <martin@ximian.com>
11465
11466         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11467         to bool so we can return an error condition.
11468         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11469         returned an error.
11470
11471 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
11472
11473         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11474         attributes.
11475
11476 2005-03-16  Raja R Harinath  <rharinath@novell.com>
11477
11478         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11479         Refactor to avoid traversing the list of assemblies, and to avoid
11480         string concatenation.
11481         * typemanager.cs (guid_attr_type): Remove.
11482         (negative_hits, pointers, references): Remove hashes.
11483         (type_hash): New.
11484         (GetConstructedType): New.  Uses type_hash to handle constructed
11485         types (arrays, references, pointers).
11486         (GetReferenceType, GetPointerType): Use it.
11487         (GetNestedType): New.  Uses type_hash to handle nested types of
11488         reflected types.
11489         (LookupType, LookupTypeDirect): Remove.
11490         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
11491         'types' hash and LookupTypeReflection directly.
11492         (params_string, params_object): Use GetConstructedType.
11493         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
11494         top-level types.
11495         (Namespace.Lookup): Use cached_types.
11496         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
11497         provided by old TypeManager.LookupType.
11498         * rootcontext.cs (MakeFQN): Remove.
11499         * decl.cs (DeclSpace.MakeFQN): Likewise.
11500         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
11501         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11502         TypeManager.GetConstructedType.
11503         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
11504
11505 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
11506
11507         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
11508         indexers.
11509
11510         * cs-parser.jay: Reports CS1527 for any namespace element.
11511
11512         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
11513         Added CS0407.
11514
11515         * expression.cs (ParameterReference.IsAssigned): Changed error to
11516         CS0269.
11517         (Error_WrongNumArguments): Moved CS0245 detection here.
11518
11519         * statement.cs (Return.Resolve): Add CS1622 report.
11520
11521 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
11522
11523         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
11524
11525 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
11526
11527         * attribute.cs expression.cs: Get rid of some allocations.
11528
11529 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
11530
11531         * doc.cs : just eliminate the latest change.
11532
11533 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11534
11535         * doc.cs : commented out the latest change. It breaks xml-030.cs
11536
11537 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11538
11539         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
11540           fail. So invoke CreateType() in FindDocumentedType().
11541
11542 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11543
11544         * cs-tokenizer.cs : added IsKeyword().
11545         * doc.cs : Detect keyword incorrectly used as identifier.
11546           Allow identifiers prefixed by @.
11547
11548 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
11549
11550         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
11551         It caused exception in namespace resolving (again!).
11552         
11553         * class.cs (Class.ctor): Removed exit.
11554         (PropertyMethod.ctor): ditto.
11555         
11556         * codegen.cs (Codegen.Reset): Reset static data.
11557         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11558         
11559         * cs-tokenizer.cs (Cleanup): Removed.
11560         
11561         * driver.cs (GetSystemDir): Rewrote to one line command.
11562         It caused problem with unloaded dynamic modules.
11563         (UnixParseOption): Removed Exit.
11564         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
11565         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
11566         Now can be mcs used as library.
11567         
11568         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
11569         empty location.
11570         
11571         * location.cs (Reset): Reset static data.
11572         
11573         * namespace.cs (Reset): Reset static data.
11574         
11575         * report.cs (Report.Reset): Reset static data.
11576         
11577         * rootcontext.cs (RootContext.Reset): Reset static data.
11578         
11579         * tree.cs (RootTypes.ctor): Use Location.Null
11580         
11581         * typemanager.cs (TypeManager.Reset): Reset static data.
11582         (CoreLookupType): Removed Exit.
11583         (TypeHandle.Reset): Reset static data.
11584         
11585 2005-03-10  Raja R Harinath  <rharinath@novell.com>
11586
11587         Fix #73516.
11588         * typemanager.cs (ComputeNamespaces): Import namespaces from
11589         referenced modules too.
11590
11591 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11592
11593         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
11594         than '.'.
11595
11596 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11597
11598         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
11599         enclosing DeclSpace.  This ensures that a name-lookup populates
11600         more caches and there are fewer 'TypeExpression's.  Carve out
11601         nested type lookup into ...
11602         (LookupNestedTypeInHierarchy): ... this.
11603
11604 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11605
11606         Clean up a few partial-class semantics.  
11607         Fixes test-357.cs and cs1618-2.cs.
11608         * cs-parser.jay (struct_declaration): Use 'current_class' as
11609         parent of newly-created struct.  Remove call to Register ().
11610         Use 'pop_current_class' to complete handing the current struct.
11611         (interface_declaration): Likewise.
11612         (class_declaration): Likewise.
11613         (enum_declaration): Use 'current_class' as parent of newly created
11614         enum.
11615         (delegate_declaration): Likewise.
11616         (pop_current_class): New function.  This is used to handle closing
11617         up the 'current_class' and 'current_container', and pointing them
11618         to the enclosing class/container.
11619         (CSharpParser): Initialize 'current_class' too.
11620         * decl.cs (MemberCore): Add check for invariant: a partial
11621         container is not a parsed entity, and thus does not enclose any
11622         parsed members.
11623         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
11624         (DeclSpace.BaseTypeExpr): Use it.
11625         (DeclSpace.LookupType): Add check for invariant.
11626         * class.cs (TypeContainer): Add check for invariant: a nested
11627         class should have the same NamespaceEntry as its enclosing class.
11628         (TypeContainer.EmitFieldInitializers): Make virtual.
11629         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
11630         MemberCore.
11631         (TypeContainer.Register): Remove.
11632         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
11633         null.  Use TypeResolveEmitContext for resolving base types and
11634         interfaces.  Move initialization of Parts.TypeBuilder here from
11635         ...
11636         (TypeContainer.DefineNestedTypes): ... here.
11637         (PartialContainer): Take a Namespace not a NamespaceEntry.
11638         (PartialContainer.Create): Don't use Register.  Call the
11639         appropriate Add... function directly.
11640         (ClassPart): Take both the PartialContainer and the enclosing
11641         class as constructor arguments.
11642         (ClassPart.EmitFieldInitializers): Override.
11643         (ClassPart.PartFindNestedTypes): Remove.
11644         (FieldBase.GetInitializerExpression): Resolve the initializer
11645         expression in the emit context of the enclosing class.
11646         * tree.cs (RootTypes): Remove Register ().
11647         
11648 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
11649
11650         * cs-parser.jay: Removed CS0134.
11651         
11652         * driver.cs: Removed CS1901.
11653         
11654         * expression.cs (SizeOf.DoResolve): Don't report CS0233
11655         for predefined types.
11656
11657 2005-03-07  Duncan Mak  <duncan@novell.com>
11658
11659         * codegen.cs (Save):  Catch UnauthorizedAccessException as
11660         well. Fixes bug #73454.
11661
11662 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
11663
11664         * cs-tokenizer.cs (xtoken): Add CS1035.
11665         
11666         * class.cs (MethodData.Define): Add CS0683.
11667         (FieldMember.ctor): Add CS0681.
11668
11669 2005-03-07  Raja R Harinath  <rharinath@novell.com>
11670
11671         * ecore.cs (SimpleName.DoResolve): Rename from
11672         SimpleName.DoResolveAllowStatic.
11673         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
11674         Pass 'intermediate' flag to MemberStaticCheck.
11675         (SimpleName.MemberStaticCheck): Skip "static check" only in case
11676         of "intermediate" lookups via MemberAccess.
11677         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
11678         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
11679
11680 2005-03-07  Raja R Harinath  <rharinath@novell.com>
11681
11682         Fix #73394.
11683         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
11684         slipped in because of variable names that are identical to a
11685         builtin type's BCL equivalent ('string String;', 'int Int32;').
11686         (PropertyExpr.EmitInstance): Likewise.
11687
11688 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
11689
11690         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
11691         
11692         * report.cs (warning_ignore_table): Made public.
11693
11694 2005-03-04  Raja R Harinath  <rharinath@novell.com>
11695
11696         Fix #73282.
11697         * class.cs (MethodData.Emit): Pass 'container' to
11698         container.GetObsoleteAttribute instead of 'container.Parent'.
11699
11700 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
11701
11702         * cs-parser.jay: Add 1534 error test.
11703
11704         * iterators.cs (Yield.CheckContext): Add error 1629.
11705         (Iterator.ctor): Save unsafe modifier.
11706         (MoveNextMethod.DoEmit): Restore unsafe context.
11707
11708         * namespace.cs (UsingAlias): Better error message.
11709
11710 2005-03-03  Dan Winship  <danw@novell.com>
11711
11712         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
11713         the warning message [#73219]
11714
11715 2005-03-03  Raja R Harinath  <rharinath@novell.com>
11716
11717         Fix compile with MCS 1.0.0.0.
11718         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
11719         w_restore to not depend on string constant folding.
11720
11721 2005-03-03  Raja R Harinath  <rharinath@novell.com>
11722
11723         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
11724         CS0246 check to users who passed 'silent = false'.
11725         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
11726         check.
11727         (SimpleName.SimpleNameResolve): Update.
11728         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
11729         (MemberAccess.IdenticalNameAndTypeName): Update.
11730         * doc.cs (FindDocumentedTypeNonArray): Update.
11731
11732 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
11733
11734         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
11735         * parameters.cs (ComputeAndDefineParameters): Remove.
11736         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
11737         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
11738         Use GetParameterInfo.
11739
11740 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
11741
11742         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
11743
11744 2005-03-02  Raja R Harinath  <rharinath@novell.com>
11745
11746         Unify DeclSpace.LookupType and DeclSpace.FindType.
11747         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
11748         is in charge of defining nested types on demand.
11749         (DeclSpace.LookupType): Use it when the current_type is a
11750         TypeBuilder.  Use LookupTypeDirect for reflected types.
11751         (DeclSpace.FindType): Remove.
11752         (DeclSpace.LookupInterfaceOrClass): Likewise.
11753         (DeclSpace.DefineTypeAndParents): Likewise.
11754         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
11755         DeclSpace.LookupType.
11756         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
11757         * typemanager.cs (LookupType): Simplify.
11758         (AddUserType): Remove type from negative_hits.
11759         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
11760         * class.cs (TypeContainer.FindMembers): Move handling of nested
11761         types ...
11762         (TypeContainer.FindMembers_NestedTypes): ... here.
11763         (TypeContainer.FindNestedType): Implement override.
11764         (ClassPart.FindNestedType): Delegate to PartialContainer.
11765         (ClassPart.PartFindNestedType): Looks up the nested types of the
11766         part alone.
11767
11768 2005-03-02  Martin Baulig  <martin@ximian.com>
11769
11770         * class.cs (TypeContainer.DoDefineMembers): We also need a default
11771         static constructor in static classes.
11772
11773 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
11774
11775         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
11776         sizeParamIndex is not specified.
11777
11778 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
11779
11780         Fix #73117
11781         * report.cs (WarningMessage.IsEnabled): Missing null check.
11782
11783 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
11784
11785         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
11786         in the fields and not in the properties.
11787
11788 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
11789
11790         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
11791         fields as well.
11792
11793 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
11794
11795         * attribute.cs: Small refactoring (improved robustness).
11796         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
11797         (ValidateGuid): Removed.
11798         (Resolve): Removed referenced to above mentioned.
11799         (GetAttributeUsage): Made private and changed to work without
11800         class assistance.
11801         (GetIndexerAttributeValue): Don't crash.
11802         (GetConditionalAttributeValue): Ditto.
11803         (GetClsCompliantAttributeValue): Ditto.
11804         (ExtractSecurityPermissionSet): All attributes exceptions are
11805         error 648.
11806         (GetPropertyValue): New helper.
11807         (GetMethodImplOptions): New method.
11808         (DefinePInvokeMethod): Reuse common code. Implemented handling of
11809         some missing properties.
11810         
11811         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
11812         (Method.ApplyAttributeBuilder): Updated.
11813         
11814         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
11815         exception.
11816
11817 2005-02-28  Raja R Harinath  <rharinath@novell.com>
11818
11819         Fix #73052.
11820         * report.cs (Report.SymbolRelatedToPreviousError): Handle
11821         non-simple types (array, pointer, reference).
11822
11823 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
11824
11825         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
11826
11827         * class.cs (MethodCore.IsDuplicateImplementation): Special error
11828         for operators.
11829         (Method.CheckBase): Catch wrong destructor here.
11830         (MethodData.Define): Add errors 550, 668.
11831
11832         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
11833
11834         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
11835
11836         * pending.cs (VerifyPendingMethods): Add error 551.
11837
11838         * typemanager.cs (CSharpName): Next error report helper.
11839
11840 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
11841
11842         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
11843         attributes. Removed useless attribute double check.
11844         It saves almost 2MBs for corlib.
11845
11846 2005-02-25  Raja R Harinath  <rharinath@novell.com>
11847
11848         Fix #72924.
11849         * statement.cs (ExpressionStatement.Resolve): Make robust to being
11850         called twice in case of error.
11851
11852 2005-02-23  Chris Toshok  <toshok@ximian.com>
11853
11854         Fix compiler portions of #72827.
11855         * statement.cs (Block.Emit): call Begin/EndScope on the
11856         EmitContext instead of the ILGenerator.
11857
11858         * codegen.cs (EmitContext.BeginScope): new method, call
11859         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
11860         we have one.)
11861         (EmitContext.BeginScope): same, but EndScope and CloseScope
11862
11863         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
11864         offset and call the superclass's OpenScope(int) with it.
11865         (SymbolWriter.CloseScope): get the current il
11866         offset and call superclass's CloseScope(int) with it.
11867
11868 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
11869
11870         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
11871         CS1677 for out and ref as well.
11872
11873         * class.cs (Method.Define): Add error CS1599 detection.
11874         
11875         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
11876         
11877         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
11878         
11879         * delegate.cs (Delegate.Define): Add error CS1599 detection.
11880         
11881         * support.cs.cs (ModifierDesc): New helper method.
11882
11883 2005-02-23  Raja R Harinath  <rharinath@novell.com>
11884             Abin Thomas  <projectmonokochi@rediffmail.com>
11885             Anoob V E  <projectmonokochi@rediffmail.com>
11886             Harilal P R  <projectmonokochi@rediffmail.com>
11887
11888         Fix #57851, #72718.
11889         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
11890         MemberLookup (used for error reporting) actually returns a result.
11891         Fix error report number (122, not 112).
11892
11893 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
11894             Anoob V E  <projectmonokochi@rediffmail.com>
11895             Harilal P R  <projectmonokochi@rediffmail.com>
11896
11897         Fix #71134.
11898         * pending.cs (PendingImplementation.GetAbstractMethods):
11899         Find NonPublic members too.
11900
11901 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
11902
11903         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
11904         Fixed error 217.
11905         
11906         * class.cs (MethodCore.CheckMethodAgainstBase):
11907         Add error 239 report.
11908
11909 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11910
11911         Fix #68955.
11912         * expression.cs (Invocation.IsApplicable): Make public.
11913         (Invocation.IsParamsMethodApplicable): Likewise.
11914         * delegate.cs (Delegate.VerifyApplicability): Don't use
11915         Invocation.VerifyArgumentCompat for parameter applicability
11916         testing.  Use Invocation.IsApplicable and
11917         Invocation.IsParamsMethodApplicable.
11918
11919 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11920
11921         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
11922         
11923         * class.cs (Operator.Define): Add error 217 report.
11924         
11925 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11926
11927         * namespace.cs (UsingEntry.Resolve): Undo change below.
11928
11929 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11930
11931         Fix #72756.
11932         * ecore.cs (Expression.MemberLookupFailed): Add argument to
11933         disable the error message when the extended MemberLookup also
11934         fails.
11935         (Expression.MemberLookupFinal): Update.
11936         (SimpleName.DoSimpleNameResolve): Update.
11937         * expression.cs (MemberAccess.ResolveNamespaceOrType):
11938         Don't use MemberLookupFinal.
11939         (New.DoResolve): Update.
11940         (BaseAccess.CommonResolve): Update.
11941
11942 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11943
11944         Fix #72732.
11945         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11946         occured previously, don't resolve again.
11947
11948 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11949
11950         Fix #69949
11951         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11952         argument. Call ResolveAttributeUsage for unresolved.
11953         when types doesn't match ctor arguments.
11954         
11955         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11956         for nested attribute classes.
11957         (Class.attribute_usage): Removed.
11958         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11959         for attribute class.
11960         
11961         * ecore.cs (IsAttribute): Removed.
11962         
11963         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11964         
11965         * rootcontext.cs (RegisterAttribute): Removed, attributes are
11966         now normal types.
11967         (attribute_types): Removed.
11968         (EmitCode): Global attributes are emited as the latest.
11969
11970 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
11971
11972         * class.cs (EmitFieldInitializers): Don't emit field initializer
11973         for default values when optimilization is on.
11974         
11975         * constant.cs (Constant.IsDefaultValue): New property.
11976         
11977         * driver.cs: Add /optimize handling.
11978         
11979         * constant.cs,
11980         * ecore.cs,
11981         * literal.cs: Implement new IsDefaultValue property.
11982         
11983         * rootcontext.cs (Optimize): New field, holds /optimize option.
11984
11985 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11986
11987         Fix crasher in re-opened #72347.
11988         * namespace.cs (Namespace.Lookup): Return null if
11989         DeclSpace.DefineType returns null.
11990
11991         Fix #72678.
11992         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11993
11994 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11995
11996         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
11997         now returns null if it cannot resolve to an lvalue.
11998         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11999         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12000         returned null.  Remove check for SimpleName.
12001         (EventExpr.DoResolveLValue): New.
12002         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12003         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12004         error from ...
12005         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12006         avoid CS0131 error.
12007         (Unary.ResolveOperator): Move CS0211 check ...
12008         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12009         CS0131 error.
12010         (Unary.DoResolveLValue): Simplify.
12011         (AddressOf.DoResolveLValue): New.
12012         (ArrayAccess.DoResolveLValue): New.
12013
12014 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12015
12016         * attribute.cs (Attribute.Resolve): Add arguments casting for
12017         when types doesn't match ctor arguments.
12018
12019 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12020
12021         Fix parts of #63202.
12022         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12023         lookup of operator in base type.  Ensure that all checks happen
12024         when the operator resolves to an "op_..." method.
12025
12026 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12027
12028         Fix #71992.
12029         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12030         'ignore_cs0104' parameter.  Pass it to ...
12031         (NamespaceEntry.Lookup): ... this.
12032         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12033         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12034         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12035         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12036         Update.  Request that cs0104 errors be ignored.
12037         (ComposedCast.ResolveAsTypeStep): Update.
12038
12039 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12040
12041         Fix #59209.
12042         * expression.cs (Invocation.BetterFunction): Remove support for
12043         comparing virtual functions and their overrides.
12044         (Invocation.IsOverride): New.
12045         (Invocation.OverloadResolve): Don't consider 'override' functions
12046         during candidate selection.  Store them in a lookaside list.
12047         If the selected method is a 'virtual' function, use the list to
12048         find any overrides that are closer to the LHS type.
12049
12050 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12051
12052         * expression.cs (New.DoResolve): Add complex core type reduction.
12053         (New.Constantify): Converts complex core type syntax like 'new int ()'
12054         to simple constant.
12055         
12056 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12057
12058         * decl.cs (EntryType.EntryType): New constructor to create an
12059         updated copy of a cache entry.
12060         (MemberCache.AddMethods): Use it.
12061         (MemberCache.ClearDeclaredOnly): Remove.
12062         (MemberCache.MemberCache): Update.
12063
12064 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12065
12066         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12067         variable.  This one is represents the actual low-level declaration
12068         of the method, as opposed to the semantic level `IsStatic'.   
12069
12070         An anonymous method which is hosted into a static method might be
12071         actually an instance method.  IsStatic would reflect the
12072         container, while MethodIsStatic represents the actual code
12073         generated.
12074
12075         * expression.cs (ParameterReference): Use the new MethodIsStatic
12076         instead of IsStatic.
12077
12078         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12079         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12080         set on the current EmitContext. 
12081
12082         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12083         resolve our casted expression as an LValue.  This triggers the
12084         proper LValue processing that is later required by Assign.
12085
12086         This fixes 72347.
12087
12088         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12089
12090 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12091
12092         C# 2.0 Fixed buffer implementation
12093
12094         * anonymous.cs: Update after RegisterHelperClass renaming.
12095
12096         * attribute.cs (AttributeTester.fixed_buffer_cache):
12097         Cache of external fixed buffers.
12098         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12099         implementation if field is fixed buffer else null.
12100
12101         * class.cs
12102         (TypeContainer.AddField): Accept FieldMember instead of Field.
12103         (FieldBase.IsFieldClsCompliant): Extracted code from
12104         VerifyClsCompliance descendant customization.
12105         (FixedField): New class handles fixed buffer fields.
12106         (FixedFieldExternal): Keeps information about imported fixed
12107         buffer.
12108         (IFixedField): Make access to internal or external fixed buffer
12109         same.
12110
12111         * cs-parser.jay: Add fixed buffer parsing.
12112
12113         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12114         buffer.
12115
12116         * expression.cs (Indirection): Extended implementation to accept
12117         fixed buffer field.
12118         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12119         (ElementAccess.MakePointerAccess): Get type as parameter.
12120         (DoResolve): Add fixed buffer field expression conversion.
12121         (DoResolveLValue): Ditto.
12122         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12123         (ArrayPtr): Derives from FixedBufferPtr.
12124         (ArrayPtr.Emit): Add extra emit for array elements.
12125
12126         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12127
12128         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12129         for compiler generated types.
12130         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12131
12132         * statement.cs (Fixed): Refactored to be easier add fixed buffer
12133         and consume less memory.
12134         (Fixed.Resolve): Add fixed buffer case.
12135
12136         * typemanager.cs (compiler_generated_attr_ctor,
12137         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12138         (HasElementType): Add our own implementation to work on every
12139         runtime.
12140
12141 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12142
12143         * anonymous.cs (CaptureContext): Track whether `this' has been
12144         referenced.   
12145
12146         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
12147         only captured `this' if it was implicitly done (instance
12148         methods/variables were used). 
12149
12150         * codegen.cs (EmitContext.CaptureThis): New method to flag that
12151         `this' must be captured.
12152
12153 2005-01-30  Miguel de Icaza  <miguel@novell.com>
12154  
12155         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12156         is null it means that there has been no need to capture anything,
12157         so we just create a sibling.
12158
12159         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12160
12161         Just a partial fix.  The other half is fairly elusive.
12162         
12163 2005-02-10  Raja R Harinath  <rharinath@novell.com>
12164
12165         Fix #52586, cs0121-4.cs.
12166         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
12167         and return a hashtable.
12168         (MemberCache.ClearDeclaredOnly): New.
12169         (MemberCache.MemberCache): Update to change.  Make a deep copy of
12170         the method_hash of a base type too.
12171         (MemberCache.AddMethods): Adapt to having a deep copy of the base
12172         type methods.  Overwrite entries with the same MethodHandle so
12173         that the ReflectedType is correct.  The process leaves in base
12174         virtual functions and their overrides as distinct entries.
12175         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
12176         matters since it was boxed in a ArrayList before.
12177         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12178         modifier.
12179         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
12180         case of a virtual function and its override (choose the overload
12181         as better).
12182         (Invocation.OverloadResolve): Avoid 'override' members during
12183         'applicable_type' calculation.
12184
12185 2005-02-09  Raja R Harinath  <rharinath@novell.com>
12186
12187         Combine two near-redundant caches.
12188         * typemanager.cs (method_params): Rename from method_internal_params.
12189         (TypeManager.GetParameterData): New.  Replace
12190         Invocation.GetParameterData.
12191         (TypeManager.LookupParametersByBuilder): Remove.
12192         * expression.cs (Invocation.method_parameter_cache): Remove.
12193         (Invocation.GetParameterData): Remove.
12194         Update to changes.
12195         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12196         Update to changes.
12197
12198 2005-02-08  Raja R Harinath  <rharinath@novell.com>
12199
12200         Fix #72015.
12201         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12202         TypeManager.multicast_delegate_type is null, resolve it by looking
12203         up "System.MulticastDelegate".
12204         * rootcontext.cs (RootContext.ResolveCore): Simplify.
12205
12206 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
12207             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
12208             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
12209
12210         Fix cs0164.cs.
12211         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12212         (LabeledStatement.AddReference): New.  Set 'referenced'.
12213         (Goto.Resolve): Use it.
12214
12215 2005-02-05  John Luke  <john.luke@gmail.com>
12216
12217         * driver.cs: remove duplicate -doc line in Usage ()
12218
12219 2005-02-04  Raja R Harinath  <rharinath@novell.com>
12220
12221         * location.cs (Location.AddFile): Fix CS2002 error report.
12222
12223 2005-02-02  Martin Baulig  <martin@ximian.com>
12224
12225         * delegate.cs (Delegate.DefineType): Report an internal error if
12226         TypeManager.multicast_delegate_type is null.  See bug #72015 for
12227         details.        
12228
12229 2005-02-02  Raja R Harinath  <rharinath@novell.com>
12230
12231         Fix a crasher in a variant of #31984.
12232         * const.cs (Constant.CheckBase): New override that defers the
12233         new-or-override check in case the base type hasn't been populated
12234         yet.
12235         (Constant.Define): Ensure the new-or-override check is performed.
12236
12237 2005-02-01  Duncan Mak  <duncan@ximian.com>
12238
12239         * const.cs (LookupConstantValue): Check that `ce' is not null
12240         before calling GetValue ().
12241
12242 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12243
12244         Fix test-334.cs (#69519).
12245         * cs-parser.jay (using_alias_directive): Pass in an expression to
12246         NamespaceEntry.UsingAlias.
12247         (using_namespace_directive): Pass in an expression to
12248         NamespaceEntry.Using.
12249         (namespace_name): Don't flatten to a string.
12250         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12251         (NamespaceEntry.AliasEntry.Resolve): Lookup using
12252         ResolveAsTypeStep.
12253         (NamespaceEntry.UsingEntry): Likewise.
12254         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12255         changes.
12256         (NamespaceEntry.LookupForUsing): Remove.
12257         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12258         names.
12259         (NamespaceEntry.Lookup): Remove support for dotted names.
12260
12261 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12262
12263         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12264         split into two.
12265         (NamespaceEntry.ImplicitParent): Compute on demand.
12266         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12267         parallels the current.
12268         (NamespaceEntry.LookupForUsing): Use it.
12269         (NamespaceEntry.Lookup): If the current namespace-entry is
12270         implicit, don't search aliases and using tables.
12271
12272 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12273
12274         Fix #31984.
12275         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12276         BaseCache here.
12277         (TypeContainer.BaseCache): Compute on demand.
12278         (TypeContainer.FindMembers): Define constants and types if they're
12279         not already created.
12280         (FieldMember.Define): Move resetting of ec.InUnsafe before error
12281         check.
12282         * const.cs (Constant.Define): Make idempotent.
12283
12284 2005-01-29  Miguel de Icaza  <miguel@novell.com>
12285
12286         * pending.cs: Produce better code (no nops produced by using Ldarg
12287         + value).
12288         
12289         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12290         i - 1' it should be arg + 1.
12291
12292         Fixes bug #71819.
12293
12294 2005-01-28  Raja R Harinath  <rharinath@novell.com>
12295
12296         * attribute.cs (Attribute.CheckAttributeType): Make private
12297         non-virtual.
12298         (Attribute.ResolveType): Make virtual.
12299         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12300         handling of RootContext.Tree.Types.
12301
12302 2005-01-27  Raja R Harinath  <rharinath@novell.com>
12303
12304         Update attribute-handling to use the SimpleName/MemberAccess
12305         mechanisms.
12306         * cs-parser.jay (attribute): Pass in an expression to the
12307         constructors of Attribute and GlobalAttribute.
12308         * attribute.cs (Attribute): Take an expression for the name.
12309         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
12310         passed in attribute name expression.
12311         (Attribute.CheckAttributeType): Use it.
12312         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12313         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12314         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
12315         argument to prevent error messages if the lookup fails.
12316
12317 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
12318
12319         * expression.cs (Indirection): Implemented IVariable interface
12320         to support indirection in AddressOf operator.
12321         (PointerArithmetic.Emit): Add optimalization for case where
12322         result can be precomputed.
12323
12324 2005-01-26  Martin Baulig  <martin@ximian.com>
12325
12326         * class.cs (TypeContainer.AttributeTargets): Return the correct
12327         AttributeTargets depending on our `Kind' instead of throwing an
12328         exception; fixes #71632.
12329
12330 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
12331
12332         Fix #71257
12333         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12334         constant members.
12335
12336 2005-01-25  Raja R Harinath  <rharinath@novell.com>
12337
12338         Fix #71602.
12339         * expression.cs (MemberAccess.DoResolve): Don't complain with
12340         cs0572 when the LHS of a member access has identical name and type
12341         name.
12342
12343 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
12344
12345         Fix #71651, #71675
12346         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12347         CreatePermission.
12348         Create custom PermissionSet only for PermissionSetAttribute.
12349
12350 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
12351
12352         Fix #71649
12353         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12354         delegates in static class.
12355
12356 2005-01-24  Martin Baulig  <martin@ximian.com>
12357
12358         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12359         merging an implicit block, just use its reachability.
12360
12361         * statement.cs (Block.Resolve): Make the unreachable code check
12362         work wrt. implicit blocks; see test-337 from #63842.
12363
12364 2005-01-21  Alp Toker  <alp@atoker.com>
12365  
12366         * cs-parser.jay: destructor_declaration's container is PartialContainer
12367         not Class when partial types are used, so use Kind prop instead of
12368         'is'.
12369         
12370 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * cs-parser.jay: Improve error reporting when an interface
12373         declares new types.
12374
12375 2005-01-20  Dick Porter  <dick@ximian.com>
12376
12377         * support.cs: SeekableStreamReader fix from Sandor Dobos
12378         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12379         chars are read.  Fixes bug 70369.
12380
12381 2005-01-20  Raja R Harinath  <rharinath@novell.com>
12382
12383         * cs-parser.jay (catch_clause): Simplify current_block handling
12384         somewhat.
12385
12386 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * convert.cs (ImplicitStandardConversionExists): Synchronize the
12389         code with ImplicitStandardConversion to handle the implicit
12390         conversion of method groups into valid delegate invocations. 
12391
12392         The problem is that in parameter handling we were using this code
12393         path.  Fixes bug #64698
12394
12395 2005-01-19  Raja R Harinath  <rharinath@novell.com>
12396
12397         * cs-parser.jay: Fix several infelicities.
12398         - Avoid assigning to the parser value stack.  Code like 
12399           '$3 = null' is unclean.  Synthesize a value for the code block
12400           instead. 
12401         - Avoid using oob_stack for storing location information.  Use ...
12402         (_mark_): ... this.  New (empty) rule.  Saves the current location
12403         in $$.
12404         (foreach_statement): Avoid using oob_stack for current_block
12405         handling.  Use technique used in for_statement and
12406         using_statement.  Synthesize a value for the code block to store
12407         additional intermediate information.
12408
12409 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
12410
12411         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12412         of a different type is only allowed to private fields of a
12413         containing type, not on fields of a base class.
12414
12415         See test-174.cs and error cs0122-9.cs
12416
12417 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12418
12419         Fix test-335.cs (bug #58126).
12420         * cs-parser.jay (argument): Split out non-expression parts of the
12421         rule into 'non_simple_argument'.
12422         (invocation_expression): Support parenthesized invocations with
12423         multiple arguments, and with single non-simple arguments.
12424
12425 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12426
12427         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12428         places.
12429
12430 2005-01-12  Raja R Harinath  <rharinath@novell.com>
12431
12432         Fix cs0038-1.cs, cs1640-6.cs.
12433         * ecore.cs (Expression.Resolve): Remove special-case for
12434         SimpleName in error-handling.
12435         (Expression.almostMatchedMembers): Relax access permission to
12436         protected.
12437         (Expression.MemberLookupFailed): Handle duplicates in
12438         almostMatchedMembers list.
12439         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12440         * expression.cs (New.DoResolve): Report CS1540 for more cases.
12441         * typemanager.cs (GetFullNameSignature): Use the MethodBase
12442         overload if the passed in MemberInfo is a MethodBase.
12443
12444 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
12445
12446         Fix #70749
12447         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12448         for non-CAS & merge permission sets properly.
12449
12450 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12451
12452         Improve standard-compliance of simple name and member access 
12453         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
12454         * ecore.cs (FullNamedExpression): New abstract base class 
12455         for Namespaces and TypeExpressions.
12456         (ResolveFlags.SimpleName): Remove.
12457         (SimpleName): Remove support for dotted names.
12458         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
12459         DeclSpace.FindType and DeclSpace.LookupType.
12460         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12461         (Expression.ExprClassName): Make member function.
12462         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12463         a namespace.  Remove creation of dotted "SimpleName"s.
12464         (MemberAccess.DoResolve): Likewise.
12465         * decl.cs (DeclSpace.Cache): Make private.
12466         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12467         (DeclSpace.FindType): Update.
12468         (DeclSpace.LookupType): Move here from RootContext.  Return a 
12469         FullNamedExpression.
12470         * namespace.cs (Namespace): Derive from FullNamedExpression
12471         so that it can be part of expression resolution.
12472         (Namespace.Lookup): Return an FullNamedExpression.
12473         (NamespaceEntry.LookupAlias): Lookup aliases only in current
12474         namespace.
12475         * rootcontext.cs (NamespaceLookup): Remove.
12476         (LookupType): Move to DeclSpace.
12477         * attribute.cs (CheckAttributeType): Update.
12478         * doc.cs (FindDocumentedType): Remove allowAlias argument.
12479         (FindDocumentedTypeNonArray): Likewise.
12480
12481 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12482
12483         Fix cs0509.cs, cs1632.cs.
12484         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12485         is the same as IsInterface.
12486         (TypeContainer.GetClassBases): Likewise.
12487         * statement.cs (LabeledStatement.ig): New field.
12488         (LabeledStatement.LabelTarget): Save ILGenerator which created the
12489         label.
12490         (LabeledStatement.DoEmit): Check that the label was created with
12491         the same ILGenerator.
12492
12493 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
12494
12495         Fix #71058
12496         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
12497         accessors to its properties.
12498
12499         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
12500         from accessors to property.
12501         
12502 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
12503
12504         Fix #70722
12505         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
12506         only for overrides.
12507         
12508 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
12509
12510         * attribute.cs: Check for null and empty strings.  
12511
12512         I have lost another battle to Paolo.
12513
12514 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
12515
12516         Fix #70942
12517         * class.cs (PropertyMethod): Set Parent field in ctors.
12518         (SetMethod.InternalParameters): Add unsafe switch hack.
12519         Override MarkForDuplicationCheck where it is appropriate.
12520
12521         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
12522         It says whether container allows members with the same name.
12523         Base default is no.
12524         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
12525         Removed is_method parameter.
12526
12527 2005-01-06  Duncan Mak  <duncan@ximian.com>
12528
12529         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
12530         because the previous change led to incorrect reporting of CS1032
12531         ("Cannot define/undefine preprocessor symbols after first token in
12532         file"). Instead of using `tokens_seen' as the only flag that
12533         triggers CS1040, introduce `comments_seen'. This new flag is used
12534         to signify having seen comments on the current line, so it is
12535         unset after a newline.
12536
12537 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
12538
12539         * doc.cs : When searching for a type, find nested type too.
12540           This fixes bug #71040.
12541
12542 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
12543
12544         * doc.cs :
12545           - Warn missing member comment on those classes which also does not
12546             have doc comments. Fixed bug #71041.
12547           - Don't warn missing doc comment on default constructor.
12548             Fixed bug #71042.
12549
12550 2005-01-06  Duncan Mak  <duncan@ximian.com>
12551
12552         * cs-tokenizer.cs (xtoken): After handling traditional C-style
12553         comments, set `tokens_seen' to true. This allows us to detect
12554         misplaced preprocessor directives (i.e. not at the beginning of
12555         the a line, nor after whitespaces). In that case, report error
12556         CS1040. This fixes bug #56460.
12557
12558         * cs-parser.jay (interface_member_declaration): Add checks for
12559         IsExplicitImpl, and report CS0541 error if an interface member is
12560         defined as an explicit interface declaration.
12561
12562 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
12563
12564         Fix #70817
12565         * class.cs (PropertyMethod): Set Parent field in ctors.
12566         (SetMethod.InternalParameters): Add unsafe switch hack.
12567         
12568         * decl.cs (MemberCore.Parent): Cannot be readonly.
12569
12570 2005-01-06  Raja R Harinath  <rharinath@novell.com>
12571
12572         * decl.cs (DeclSpace.ResolveType): Remove.
12573         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
12574         Merge in code from ...
12575         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
12576         * class.cs, enum.cs: Update to changes.
12577
12578 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
12579
12580         * anonymous.cs: Ensure that we init the scope of our parent if it
12581         has not been initialized yet.
12582
12583 2004-12-30  Duncan Mak  <duncan@ximian.com>
12584
12585         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
12586         if field.FieldBuilder is null. Fixes #70758.
12587
12588         * convert.cs: Fixed some typos and updated some of the comments.
12589         (ImplicitStandardConversionExists):
12590         (TryImplicitIntConversion): If `target_type' is an interface and
12591         the type of `ic' implements this interface, return true or a new
12592         BoxedCast instead of null. This fixes #70468.
12593
12594 2004-12-29  Duncan Mak  <duncan@ximian.com>
12595
12596         * expression.cs (Argument.Emit): Check that Expr is
12597         IMemoryLocation before casting to it, and report CS1510 otherwise.
12598
12599         This fixes #70402.
12600
12601 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
12602
12603         * statement.cs (Block.ThisVariable): remove the recursion here, to
12604         make the --profile more sane.
12605
12606 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
12607
12608         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
12609         assembly, by JB Evain.
12610
12611 2004-12-17  Raja R Harinath  <rharinath@novell.com>
12612
12613         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
12614           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
12615         "parent" refers to enclosing type/class.  "base" refers to superclass.
12616
12617 2004-12-17  Raja R Harinath  <rharinath@novell.com>
12618
12619         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12620         Ensure that we only have GlobalAttributes.
12621         * attribute.cs (Attribute.Emit): Make non-virtual.
12622         (GlobalAttribute.Emit): Remove.
12623         (Attribute.Resolve): Make virtual.
12624         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
12625         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
12626         the argument. Don't create one.
12627         (Attribute.GetObsoleteAttribute): Likewise.
12628         (Attribute.GetClsCompliantAttributeValue): Likewise.
12629         * class.cs, decl.cs: Update to changes.
12630
12631 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
12632
12633         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
12634         
12635         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
12636         
12637         * statement.cs (Foreach.Resolve): Add error 186 report.
12638
12639 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
12640
12641         * expression.cs (Conditional.DoResolve): Add warning 429.
12642         
12643         * statement.cs (If.Resolve): Add warning 665.
12644
12645 2004-12-16  Raja R Harinath  <rharinath@novell.com>
12646
12647         New invariant: RootContext.Tree.Types.NamespaceEntry == null
12648         except when in the parser, and in GlobalAttribute.
12649         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
12650         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
12651         RootContext.Tree.Types.NamespaceEntry once work is done.
12652         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
12653         and resets RootContext.Tree.Types.NamespaceEntry.
12654
12655 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
12656
12657         * cs-parser.jay: Don't create a block for every variable.
12658
12659 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
12660
12661         * location.cs: Provide extra information.
12662
12663         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
12664         variables from the captured environment, it is the ldarg_0.
12665
12666 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
12667
12668         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
12669         find a conclusion.
12670         
12671         * class.cs: Changed warning level for 169 to avoid developer
12672         displeasure from warning flooding. It will be changed back when they
12673         fix most of current BCL warnings.
12674         
12675         * RootContext.cs: Pushed default WarningLevel to 3.
12676         
12677         * statement.cs: Removed unused variable.
12678
12679 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
12680
12681         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
12682         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
12683         Add error 502 report.
12684         (StaticClass.DefineType): Add error 441 report.
12685         (Class.AllowedModifiersProp): New virtual property as temporary
12686         extension to AllowedModifiers.
12687         (Class.DefineType): Add error 418 report. Moved ModFlags check here
12688         to share implementation with StaticClass and don't call virtual
12689         methods from ctor.
12690         
12691         * driver.cs (MainDriver): Add error 1558 test.
12692
12693         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
12694         report. Moved error 36 test here.
12695
12696         * statement.cs (Throw.Resolve): Add error 724 report.
12697
12698         * typemanager.cs: Add out_attribute_type core type.
12699         
12700 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
12701
12702         * class.cs (TypeContainer.VerifyClsCompliance): Add error
12703         3018 report.
12704         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
12705
12706         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
12707         3017 report.
12708         
12709         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
12710
12711         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
12712         Add error 3023 report.
12713         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
12714
12715         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
12716         implementation.
12717
12718 2004-12-12  John Luke  <john.luke@gmail.com>
12719
12720         * driver.cs (AddArgs): take -- into account when
12721         adding arguments, fixes bug 65710 
12722
12723 2004-12-12  Martin Baulig  <martin@ximian.com>
12724
12725         * expression.cs (Unary.TryReduceNegative): Added support for
12726         SByteConstant and ByteConstant.
12727         (Unary.Reduce): Check error values from TryReduceNegative().
12728
12729 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
12730
12731         * attributes.cs (Attribute.Resolve): Avoid multiple error report
12732         and report exception as error 182.
12733
12734 2004-12-10  Raja R Harinath  <rharinath@novell.com>
12735
12736         * driver.cs (Main): Fix message when there are warnings.
12737
12738 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
12739
12740         * delegate.cs: Fixed my fix from yesterday, sorry about that.
12741
12742 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
12743
12744         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
12745         Reduced number of warnings.
12746         
12747         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
12748
12749 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
12750
12751         * driver.cs: Removed message.
12752
12753         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
12754
12755 2004-12-08    <vargaz@freemail.hu>
12756
12757         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
12758
12759 2004-12-08  Martin Baulig  <martin@ximian.com>
12760
12761         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
12762         instead of a CS3002 for properties and indexer.
12763
12764 2004-12-08  Martin Baulig  <martin@ximian.com>
12765
12766         * decl.cs (MemberName.ToString): Make this work again.
12767
12768 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
12769
12770         * attribute.cs (Resolve): Add error 591 detection.
12771
12772         * class.cs (FieldMember.Define): Add error 1547 detection.
12773         (Indexer.Define): Add error 620 detection.
12774         (Operator.Define): Add error 590 detection.
12775
12776         * ecore.cs: Missing argument for error 79.
12777
12778         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
12779         detection.
12780
12781 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
12782
12783         Fix #70106
12784         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
12785         only.
12786
12787 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
12788
12789         * cs-parser.jay : handle doc comments on implicit/explicit operators.
12790           Some operator comments were suppressed.
12791         * doc.cs : Implicit/explicit operator name in doc comments are like
12792           "op_Explicit(type)~returnType", so added suffix handling.
12793
12794 2004-12-07  Martin Baulig  <martin@ximian.com>
12795
12796         * decl.cs
12797         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
12798         (MemberCore.GetClsCompliantAttributeValue): Likewise.
12799         (DeclSpace.ec): New protected field; store the EmitContext here.
12800         (DeclSpace.EmitContext): New public property; moved here from
12801         `TypeContainer'.
12802         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
12803         EmitContext.
12804
12805         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
12806         (Enum.Emit): Don't create a new EmitContext.
12807
12808         * delegate.cs (Delegate.DefineType): Always create the
12809         EmitContext.
12810
12811         * iterators.cs (Iterators.DefineIterator): Create a new
12812         EmitContext and store it in `ec'.
12813
12814 2004-08-24  Martin Baulig  <martin@ximian.com>
12815
12816         * typemanager.cs
12817         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
12818         this for accessibility checks.
12819         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
12820         IsNestedFamilyAccessible.
12821         (TypeManager.IsSubclassOf): New method, do what the name actually
12822         says.   
12823
12824 2004-12-06  Raja R Harinath  <rharinath@novell.com>
12825
12826         Fix crash on cs0657-17.cs.
12827         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12828         Use RootContext.Tree.Types, not 'new RootTypes ()'.
12829         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
12830         the case where the NamespaceEntry gets overwritten.
12831
12832 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
12833
12834         Fixed #69195, #56821
12835         * ecore.cs (ResolveBoolean): Tiny refactoring.
12836
12837         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
12838         of right expression resolving when left is false constant and
12839         operator is LogicalAnd OR true constant and operator is LogicalOr.
12840
12841         * statement.cs (ResolveUnreachable): Always reports warning.
12842
12843 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
12844
12845         * class.cs: Distinguish between 1721 and 1722 (just a little help
12846         for the programmer).
12847
12848 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
12849
12850         * delegate.cs: Only allow this on new versions of the language. 
12851
12852 2004-12-02  Duncan Mak  <duncan@ximian.com>
12853
12854         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
12855         Expression class.
12856         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
12857         here as a static method. Take an additional bool out parameter
12858         `must_do_cs1540_check' for signaling to InstanceResolve.
12859         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
12860         member field from PropertyExpr class and made it an argument of
12861         the method instead.
12862         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
12863         check for MarshalByRefObject, and report CS0122 instead of CS1540.
12864         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
12865         and `remove_accessor' as well as InstanceResolve: report CS0122
12866         where applicable.
12867
12868         Fixes #70129.
12869
12870 2004-12-03  Raja R Harinath  <rharinath@novell.com>
12871
12872         Fix test-327.cs, test-328.cs, and put in early infrastructure
12873         for eventually fixing #52697.
12874         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
12875         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
12876         from other methods.
12877         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
12878         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
12879         (VerifyUsing, error246): Update.
12880         * rootcontext.cs (RootContext.NamespaceLookup): Just use
12881         'NamespaceEntry.LookupNamespaceOrType'.
12882
12883 2004-12-03  Martin Baulig  <martin@ximian.com>
12884
12885         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12886         method as our child, call AnonymousMethod.Compatible() on it.
12887
12888 2004-12-03  Raja R Harinath  <rharinath@novell.com>
12889
12890         Disable XML documentation support in 'basic' profile.
12891         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
12892         Redirect XmlElement to System.Object.
12893         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
12894         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
12895         * mcs.exe.sources: Add doc-bootstrap.cs.
12896         * doc-bootstrap.cs: New file.  Contains empty stub implementation
12897         of doc.cs.
12898
12899 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
12900
12901         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
12902           comments are allowed.
12903
12904 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12905
12906         * delegate.cs: Add checks for subtypes in paramaters and return values
12907         in VerifyMethod () to add support for Covariance/Contravariance
12908         in delegates.
12909         
12910 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
12911
12912         * report.cs: Remove extra closing parenthesis.
12913
12914         * convert.cs (Error_CannotImplicitConversion): If the name of the
12915         types are the same, provide some extra information.
12916
12917         * class.cs (FieldBase): Use an unused bit field from the field to
12918         encode the `has_offset' property from the FieldMember.  This saves
12919         a couple of Ks on bootstrap compilation.
12920
12921         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12922         method as our child, return the AnonymousMethod resolved
12923         expression.
12924
12925         * expression.cs (New.DoResolve): Allow return values from
12926         NewDelegate to also include AnonymousMethods.
12927
12928         Fixes #70150.
12929
12930 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
12931
12932         Fix bug #70102
12933         * attribute.cs (Resolve): Improved implementation of params
12934         attribute arguments.
12935
12936         * support.cs (ParameterData): Add HasParams to be faster.
12937
12938 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
12939
12940         all things are for /doc support:
12941
12942         * doc.cs: new file that supports XML documentation generation.
12943         * mcs.exe.sources: added doc.cs.
12944         * driver.cs:
12945           Handle /doc command line option.
12946           Report error 2006 instead of 5 for missing file name for /doc.
12947           Generate XML documentation when required, after type resolution.
12948         * cs-tokenizer.cs:
12949           Added support for picking up documentation (/// and /** ... */),
12950           including a new XmlCommentState enumeration.
12951         * cs-parser.jay:
12952           Added lines to fill Documentation element for field, constant,
12953           property, indexer, method, constructor, destructor, operator, event
12954           and class, struct, interface, delegate, enum.
12955           Added lines to warn incorrect comment.
12956         * rootcontext.cs :
12957           Added Documentation field (passed only when /doc was specified).
12958         * decl.cs:
12959           Added DocComment, DocCommentHeader, GenerateDocComment() and
12960           OnGenerateDocComment() and some supporting private members for
12961           /doc feature to MemberCore.
12962         * class.cs:
12963           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12964         * delegate.cs:
12965           Added overriden DocCommentHeader.
12966         * enum.cs:
12967           Added overriden DocCommentHeader and GenerateDocComment().
12968
12969 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
12970
12971         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12972         unwrapping the enumeration values, chain to
12973         DoConstantNumericPromotions again, so we can promote things to the
12974         fundamental types (takes care of enums that are bytes, sbytes).
12975
12976         Fixes bug #62054.
12977
12978 2004-12-01  Raja R Harinath  <rharinath@novell.com>
12979
12980         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12981         Fix long-standing bug in type-lookup.  Use FindType instead of
12982         LookupType when ec.ResolvingTypeTree.
12983         (Attribute.ResolveType, Attribute.Resolve)
12984         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12985         Update to changes.
12986         (Attributes.Search): Remove internal version.  Update.
12987         (Attributes.SearchMulti): Update.
12988         (Attributes.GetClsCompliantAttribute): Remove.
12989         (Attributes.GetIndexerNameAttribute): Remove.
12990         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12991         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12992         * class.cs (Indexer.Define): Likewise.
12993
12994 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
12995
12996         Fix bug #68790
12997         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12998         MarshallByReference members access.
12999
13000         * expression.cs: Use CheckMarshallByRefAccess;
13001         Better error CS0197 message.
13002
13003         * report.cs: Print whole related error message.
13004
13005 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13006
13007         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13008         the current directory to help debugging.
13009
13010 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13011
13012         * class (GetClassBases): Better error 60 report.
13013         (EventProperty): Disabled warning 67 detection.
13014
13015 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13016
13017         Fix bug #60324
13018         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13019
13020         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13021         precise values.
13022
13023 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13024
13025         Fix bug #49488
13026         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13027
13028         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13029
13030 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13031
13032         * attribute.cs (Attribute.Resolve): Refine error reporting and
13033         report a cs0117 if the identifier does not exist, to distinguish
13034         from 0617 which is a miss-use of the actual identifier.
13035
13036         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13037         between cs0070 and cs0079.
13038
13039         * class.cs (MemberBase.DoDefine): When reporting a wrong
13040         accessibility level, we use MethodCore to compare instead of
13041         Method (this was a regression in some refactoring effort).
13042
13043         So now we correctly report cs0056 again.
13044
13045         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13046         testing the target_type (which was known to be object_type) and
13047         not the source type (which is anonymous_method).
13048
13049         Fixed reporting of error cs1660.
13050
13051         * expression.cs (UserCast.Source): Expose the underlying cast.
13052
13053         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13054         allowed types to find a match to int32 first (most common).
13055
13056         In addition, it ignores any ImplicitUserConversions that did an
13057         internal implicit conversion (as the switch statement allows only
13058         one integral conversion to exist).
13059
13060         * class.cs (PartialContainer.Create): rename `name' to
13061         `member_name' for clarity.  Then replace the string calls with a
13062         call to MemberName.GetPartialName, as now using
13063         MemberName.ToString is an error (this is due to the side effects
13064         it had, that were fixed in the past).
13065
13066         This will restore the error reporting on a number of partial class
13067         errors that were missusing this (and getting an exception as a
13068         results, which is now just a plain textual warning, because
13069         yyparse debug output would crash otherwise).
13070
13071 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13072
13073         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13074
13075 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13076
13077         * rootcontext.cs (LookupType): Make sure to cache lookups that
13078         don't give us a negative result. This saves about 5% of corlib
13079         compilation time.
13080
13081 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * report.cs (AbstractMessage.Print): messages are sent to stderr
13084
13085         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13086         non-interface in the list of interfaces (at this point, either
13087         parent was properly set, or a base class is being listed in the
13088         interfaces section).
13089
13090         This flags error 1722, and resolves the crash from bug 69259.
13091
13092 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13093
13094         * statement.cs (Using.EmitExpressionFinally): make this work right
13095         for valuetypes. Fixes 69926.
13096
13097 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13098
13099         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13100         converted to an enum" here, before we try to change the underlying
13101         type.  This code exists, but it is a different code path than the
13102         one used while encoding constants.
13103
13104         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13105         old bug: when converting from the null literal to a pointer,
13106         return an EmptyCast, not the NullLiteral.
13107
13108         This fixes #69921, the recent null_type changes probably made this
13109         bug more prominent.
13110
13111         (ImplicitReferenceConversionExists): In addition, resynchronized
13112         the code here, so it matches the same code in
13113         ImplicitReferenceConversionExists for the `from any class-type S
13114         to any interface-type T'.
13115         
13116
13117 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13118
13119         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13120
13121 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13122
13123         * cs-parser.jay: Use verbosity accordingly. 
13124
13125 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13126
13127         * expression.cs (Unary.ResolveOperator): Do not report warning;
13128         AddressOf reads from variable.
13129         
13130         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13131
13132 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13133
13134         Fix bug #69462
13135
13136         * attribute.cs (Attributable): Removed CheckTargets.
13137         (Attributes.Emit): Explicit attribute targets are tested here.
13138
13139         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13140         not enabled for interfaces.
13141
13142         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13143         (GetAssemblyName): Ouch next bug there.
13144
13145 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13146
13147         * expression.cs: Error 275 added.
13148         
13149 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
13150
13151         Fix bug #69177 (Implemented decimal constant support)
13152
13153         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13154         (BinaryFold): Add DecimalConstant.
13155
13156         * const.cs (Define): Decimal constant 
13157         (is not constant.
13158         (ChangeType): Add decimal type handling.
13159         (LookupConstantValue): Don't set value for decimal type but
13160         emit DecimalConstantAttribute. Needed for constant optimization.
13161
13162         * constant.cs (ToDecimal): New method.
13163         (ConvertToDecimal): New method.
13164         (IntConstant): Implemented ConvertToDecimal.
13165         (DecimalConstant.Emit): Emit optimized version for decimals in
13166         int range.
13167
13168         * expression.cs (ResolveOperator): Changed order of constant
13169         reduction to work correctly with native types which have
13170         overloaded operators.
13171         (ResolveMemberAccess): Extract constant value from attribute
13172         for decimal type.
13173
13174         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13175
13176         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13177         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13178         (ChangeType): Decimal is special.
13179         (TypeToCoreType): Add decimal type.
13180
13181 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13182
13183         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13184         decimal types.
13185
13186 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13187
13188         * class.cs (EventField.ApplyAttributeBuilder): Fix error
13189         test cs1667-5.cs.
13190
13191 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13192
13193         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13194
13195         * pending.cs (PendingImplementation): Grab only interfaces.
13196
13197 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13198
13199         * statement.cs (ForeachHelperMethods): Add location member and
13200         error 202 detection.
13201
13202 2004-11-19  Raja R Harinath  <rharinath@novell.com>
13203
13204         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
13205         automatically handled by executable.make.
13206         (PROGRAM): Make profile-specific.
13207
13208 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
13209
13210         * expression.cs (DoResolveBase): Fixed wrong warning for out
13211         variables.
13212
13213 2004-11-18  Martin Baulig  <martin@ximian.com>
13214
13215         Merged latest changes into gmcs.  Please keep this comment in
13216         here, it makes it easier for me to see what changed in MCS since
13217         the last time I merged.
13218
13219 2004-11-17  Raja R Harinath  <rharinath@novell.com>
13220
13221         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13222         (TypeHandle.GetMemberCache): New.
13223         (TypeHandle.TypeHandle): Update.
13224         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13225         (TypeManager.LookupParentInterfacesCache):
13226         Rename from LookupInterfaceCache.  Optimize slightly.
13227         (TypeManager.MemberLookup_FindMembers): Update.
13228         * decl.cs (MemberCache.MemberCache): Set Container to null in the
13229         multi-type variant.
13230         (AddCacheContents): Rename from AddHashtable.
13231         * class.cs (TypeContainer.parent_container): Remove.
13232         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13233         (TypeContainer.DoDefineMembers): Don't initialize it.
13234         Update to name changes.
13235         
13236 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
13237
13238         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13239         that factors the code to check access modifiers on override.  
13240
13241         (PropertyBase): Use the code here.
13242
13243         Patch from Lluis S'anchez, fixes bug #69361.
13244
13245 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
13246
13247         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13248         routine that is used to report the use of a captured variable
13249         whose address has been taken.
13250
13251         There are two checks: one when variables are being captured and
13252         the other check is when the address of a variable is taken. 
13253         
13254         (because an anonymous methods might be resolved before *or* after
13255         the address has been taken) and 
13256
13257         * expression.cs (Conditional.DoResolve): Remove the special
13258         casing that Martin added to trueExpr and falseExpr being both
13259         NullLiteral.  We get the right behavior now just by introducing
13260         the null_type into the compiler. 
13261
13262         * convert.cs (ExplicitConversion): Change the code to use
13263         null_type instead of testing `expr is NullLiteral'.
13264         (ImplicitConversionStandard): use null_type too.
13265         (ImplicitReferenceConversionExists): use null_type too.
13266         (ImplicitReferenceConversion): use null_type too.
13267
13268         * literal.cs: The type of `NullLiteral' is now null_type instead
13269         of object_type. 
13270         (Resolve): Set the type here.
13271
13272         * typemanager.cs: Introduce null_type.
13273
13274 2004-11-17  Martin Baulig  <martin@ximian.com>
13275
13276         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13277         direction, like FindMembers() does.  Fixes #69546, testcase is in
13278         test-315.cs.    
13279
13280 2004-11-16  Martin Baulig  <martin@ximian.com>
13281
13282         This is based on a patch from Marek Safar, see bug #69082.
13283         Fixes bugs #63705 and #67130.
13284
13285         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13286         method; create a MemberCache for an interface type and cache the
13287         result.
13288
13289         * decl.cs (IMemberContainer.ParentContainer): Removed.
13290         (IMemberContainer.ParentCache): New property.
13291         (MemberCache.SetupCacheForInterface): Removed.
13292         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13293         to create a cache for an interface's "parent".
13294
13295         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13296         interfaces too.
13297
13298 2004-11-16  Martin Baulig  <martin@ximian.com>
13299
13300         Merged back from gmcs; these changes already went into gmcs a
13301         couple of weeks ago.
13302
13303         * typemanager.cs
13304         (TypeManager.AddUserType): Removed the `ifaces' argument.
13305         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13306         `TypeExpr []'.
13307         (TypeManager.AddUserInterface): Removed.
13308         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13309         `TypeExpr []'.
13310         (TypeManager.GetInterfaces): Likewise.
13311         (TypeManager.GetExplicitInterfaces): Likewise.
13312
13313         * ecore.cs (TypeExpr.GetInterfaces): Removed.
13314
13315         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13316         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13317
13318 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
13319
13320         * statement.cs: Avoid adding bools to a hashtable.
13321
13322 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
13323
13324         * expression.cs (Invocation.OverloadResolve): Flag error if we are
13325         calling an unsafe method from a safe location.
13326
13327 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
13328
13329         Fix #69167
13330         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13331
13332 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * namespace.cs (VerifyUsing): use GetPartialName instead of
13335         ToString. 
13336
13337 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * statement.cs (Return.Resolve): Fix regression in typo: if
13340         `in_exc', we have to request a NeedReturnLabel, this was a typo
13341         introduced in the anonymous method check-in.  Fixes #69131.
13342
13343         * Indexers were using the ShortName when defining themselves,
13344         causing a regression in the compiler bootstrap when applying the
13345         patch from 2004-11-02 (first part), now they use their full name
13346         and the bug is gone.
13347
13348 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
13349
13350         * driver.cs: Strip the path from the names of embedded resources. Fixes
13351         #68519.
13352
13353 2004-11-04  Raja R Harinath  <rharinath@novell.com>
13354
13355         Fix error message regression: cs0104-2.cs.
13356         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13357         (AliasEntry.Resolve): Update.
13358         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
13359         'silent' flag.
13360         (RootContext.LookupType): Update.
13361
13362 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
13363
13364         * cs-parser.jay: Add support for handling accessor modifiers
13365         * class: Add support port accessor modifiers and error checking,
13366         define PropertyMethod.Define as virtual (not abstract anymore)
13367         * ecore.cs: Add checking for proeprties access with access modifiers
13368         * iterators.cs: Modify Accessor constructor call based in the modified
13369         constructor
13370 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
13371
13372         * expression.cs (StringConcat): Handle being called twice,
13373         as when we have a concat in a field init with more than two
13374         ctors in the class
13375
13376 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
13377
13378         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13379         special case explicit implementations, we should always produce
13380         the .property or .event declaration.
13381         
13382         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13383         since it will not return correct data if people use this
13384         unresolved in the presence of using statements (see test-313).
13385
13386         * class.cs (MethodData.Define): If we are an explicit interface
13387         implementation, set the method name to the full name of the
13388         interface plus the name of the method.  
13389
13390         Notice that using the method.MethodName.GetFullName() does not
13391         work, as it will only contain the name as declared on the source
13392         file (it can be a shorthand in the presence of using statements)
13393         and not the fully qualifed type name, for example:
13394
13395         using System;
13396
13397         class D : ICloneable {
13398                 object ICloneable.Clone ()  {
13399                 }
13400         }
13401
13402         Would produce a method called `ICloneable.Clone' instead of
13403         `System.ICloneable.Clone'.
13404
13405         * namespace.cs (Alias.Resolve): Use GetPartialName.
13406         
13407 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13408
13409         * cs-parser.jay: Add error 1055 report.
13410
13411 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
13412
13413         * assign.cs (Assign.DoResolve): Only do the transform of
13414         assignment into a New if the types are compatible, if not, fall
13415         through and let the implicit code deal with the errors and with
13416         the necessary conversions. 
13417
13418 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13419
13420         * cs-parser.jay: Add error 1031 report.
13421
13422         * cs-tokenizer.cs: Add location for error 1038.
13423
13424 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13425
13426         * cs-parser.jay: Add error 1016 report.
13427
13428 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13429
13430         * cs-parser.jay: Add errors 1575,1611 report.
13431
13432 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13433
13434         * cs-parser.jay: Add error 1001 report.
13435
13436 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13437
13438         Fix #68850
13439         * attribute.cs (GetMarshal): Add method argument for
13440         caller identification.
13441
13442         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13443         agument for GetMarshal and RuntimeMissingSupport.
13444
13445 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13446
13447         * attribute.cs (ExtractSecurityPermissionSet): Removed
13448         TypeManager.code_access_permission_type.
13449
13450         * typemanager.cs: Removed TypeManager.code_access_permission_type.
13451
13452 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
13453
13454         * expression.cs (LocalVariableReference.DoResolveLValue): Check
13455         for obsolete use of a variable here.   Fixes regression on errors
13456         cs0619-25 and cs0619-26.
13457
13458 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
13459
13460         Fix #62358, implemented security attribute encoding.
13461
13462         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13463         Tests permitted SecurityAction for assembly or other types.
13464         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13465         data from SecurityPermissionAttribute to PermisionSet class.
13466
13467         * class.cs (ApplyAttributeBuilder): Added special handling
13468         for System.Security.Permissions.SecurityAttribute based types.
13469
13470         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13471         special handling for System.Security.Permissions.SecurityAttribute
13472         based types.
13473
13474         * enum.cs (ApplyAttributeBuilder): Added special handling
13475         for System.Security.Permissions.SecurityAttribute based types.
13476
13477         * parameter.cs (ApplyAttributeBuilder): Added special handling
13478         for System.Security.Permissions.SecurityAttribute based types.
13479
13480         * rootcontext.cs: Next 2 core types.
13481
13482         * typemanager.cs (TypeManager.security_permission_attr_type):
13483         Built in type for the SecurityPermission Attribute.
13484         (code_access_permission_type): Build in type.
13485
13486 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
13487
13488         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
13489         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
13490         all of this information into
13491         EmitContext.EmitCapturedVariableInstance.
13492         
13493         * codegen.cs (EmitCapturedVariableInstance): move here the
13494         funcionality of emitting an ldarg.0 in the presence of a
13495         remapping.   This centralizes the instance emit code.
13496
13497         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
13498         then emit a load of this: it means that we have reached the
13499         topmost ScopeInfo: the one that contains the pointer to the
13500         instance of the class hosting the anonymous method.
13501
13502         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
13503         captures to the topmost CaptureContext.
13504
13505 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
13506
13507         * expression.cs (LocalVariableReference): Move the knowledge about
13508         the iterators into codegen's EmitCapturedVariableInstance.
13509
13510 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
13511
13512         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
13513         all code paths return a value from an anonymous method (it is the
13514         same as the 161 error, but for anonymous methods).
13515
13516 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
13517
13518         The introduction of anonymous methods in the compiler changed
13519         various ways of doing things in the compiler.  The most
13520         significant one is the hard split between the resolution phase
13521         and the emission phases of the compiler.
13522
13523         For instance, routines that referenced local variables no
13524         longer can safely create temporary variables during the
13525         resolution phase: they must do so from the emission phase,
13526         since the variable might have been "captured", hence access to
13527         it can not be done with the local-variable operations from the runtime.
13528         
13529         * statement.cs 
13530
13531         (Block.Flags): New flag `IsTopLevel' to indicate that this block
13532         is a toplevel block.
13533
13534         (ToplevelBlock): A new kind of Block, these are the blocks that
13535         are created by the parser for all toplevel method bodies.  These
13536         include methods, accessors and anonymous methods.
13537
13538         These contain some extra information not found in regular blocks:
13539         A pointer to an optional CaptureContext (for tracking captured
13540         local variables and parameters).  A pointer to the parent
13541         ToplevelBlock.
13542         
13543         (Return.Resolve): Catch missmatches when returning a value from an
13544         anonymous method (error 1662).
13545         Invoke NeedReturnLabel from the Resolve phase instead of the emit
13546         phase.
13547
13548         (Break.Resolve): ditto.
13549
13550         (SwitchLabel): instead of defining the labels during the
13551         resolution phase, we now turned the public ILLabel and ILLabelCode
13552         labels into methods called GetILLabelCode() and GetILLabel() that
13553         only define the label during the Emit phase.
13554
13555         (GotoCase): Track the SwitchLabel instead of the computed label
13556         (its contained therein).  Emit the code by using
13557         SwitchLabel.GetILLabelCode ().
13558
13559         (LocalInfo.Flags.Captured): A new flag has been introduce to track
13560         whether the Local has been captured or not.
13561
13562         (LocalInfo.IsCaptured): New property, used to tell whether the
13563         local has been captured.
13564         
13565         * anonymous.cs: Vastly updated to contain the anonymous method
13566         support.
13567
13568         The main classes here are: CaptureContext which tracks any
13569         captured information for a toplevel block and ScopeInfo used to
13570         track the activation frames for various local variables.   
13571
13572         Each toplevel block has an optional capture context associated
13573         with it.  When a method contains an anonymous method both the
13574         toplevel method and the anonymous method will create a capture
13575         context.   When variables or parameters are captured, they are
13576         recorded on the CaptureContext that owns them, for example:
13577
13578         void Demo () {
13579              int a;
13580              MyDelegate d = delegate {
13581                  a = 1;
13582              }
13583         }
13584
13585         Here `a' will be recorded as captured on the toplevel
13586         CapturedContext, the inner captured context will not have anything
13587         (it will only have data if local variables or parameters from it
13588         are captured in a nested anonymous method.
13589
13590         The ScopeInfo is used to track the activation frames for local
13591         variables, for example:
13592
13593         for (int i = 0; i < 10; i++)
13594                 for (int j = 0; j < 10; j++){
13595                    MyDelegate d = delegate {
13596                         call (i, j);
13597                    }
13598                 }
13599
13600         At runtime this captures a single captured variable `i', but it
13601         captures 10 different versions of the variable `j'.  The variable
13602         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
13603         recorded on a child.  
13604
13605         The toplevel ScopeInfo will also track information like the `this'
13606         pointer if instance variables were referenced (this is necessary
13607         as the anonymous method lives inside a nested class in the host
13608         type of the method). 
13609
13610         (AnonymousMethod): Expanded to track the Toplevel, implement
13611         `AnonymousMethod.Compatible' to tell whether an anonymous method
13612         can be converted to a target delegate type. 
13613
13614         The routine now also produces the anonymous method content
13615
13616         (AnonymousDelegate): A helper class that derives from
13617         DelegateCreation, this is used to generate the code necessary to
13618         produce the delegate for the anonymous method that was created. 
13619
13620         * assign.cs: API adjustments for new changes in
13621         Convert.ImplicitStandardConversionExists.
13622
13623         * class.cs: Adjustments to cope with the fact that now toplevel
13624         blocks are of type `ToplevelBlock'. 
13625
13626         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
13627         insteda of standard blocks.
13628
13629         Flag errors if params arguments are passed to anonymous methods.
13630
13631         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
13632         `CurrentAnonymousMethod' which points to the current Anonymous
13633         Method.  The variable points to the AnonymousMethod class that
13634         holds the code being compiled.  It is set in the new EmitContext
13635         created for the anonymous method.
13636
13637         (EmitContext.Phase): Introduce a variable and an enumeration to
13638         assist in enforcing some rules about when and where we are allowed
13639         to invoke certain methods (EmitContext.NeedsReturnLabel is the
13640         only one that enfonces this right now).
13641
13642         (EmitContext.HaveCaptureInfo): new helper method that returns
13643         whether we have a CapturedContext initialized.
13644
13645         (EmitContext.CaptureVariable): New method used to register that a
13646         LocalInfo must be flagged for capturing. 
13647
13648         (EmitContext.CapturedParameter): New method used to register that a
13649         parameters must be flagged for capturing. 
13650         
13651         (EmitContext.CapturedField): New method used to register that a
13652         field must be flagged for capturing. 
13653
13654         (EmitContext.HaveCapturedVariables,
13655         EmitContext.HaveCapturedFields): Return whether there are captured
13656         variables or fields. 
13657
13658         (EmitContext.EmitMethodHostInstance): This is used to emit the
13659         instance for the anonymous method.  The instance might be null
13660         (static methods), this (for anonymous methods that capture nothing
13661         and happen to live side-by-side with the current method body) or a
13662         more complicated expression if the method has a CaptureContext.
13663
13664         (EmitContext.EmitTopBlock): Routine that drives the emission of
13665         code: it will first resolve the top block, then emit any metadata
13666         and then emit the code.  The split is done so that we can extract
13667         any anonymous methods and flag any captured variables/parameters.
13668         
13669         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
13670         during this phase, the ILGenerator should not be used as labels
13671         and local variables declared here might not be accessible to any
13672         code that is part of an anonymous method.  
13673
13674         Exceptions to this include the temporary variables that are
13675         created by some statements internally for holding temporary
13676         variables. 
13677         
13678         (EmitContext.EmitMeta): New routine, in charge of emitting all the
13679         metadata for a cb
13680
13681         (EmitContext.TemporaryReturn): This method is typically called
13682         from the Emit phase, and its the only place where we allow the
13683         ReturnLabel to be defined other than the EmitMeta.  The reason is
13684         that otherwise we would have to duplicate a lot of logic in the
13685         Resolve phases of various methods that today is on the Emit
13686         phase. 
13687
13688         (EmitContext.NeedReturnLabel): This no longer creates the label,
13689         as the ILGenerator is not valid during the resolve phase.
13690
13691         (EmitContext.EmitThis): Extended the knowledge in this class to
13692         work in anonymous methods in addition to iterators. 
13693
13694         (EmitContext.EmitCapturedVariableInstance): This emits whatever
13695         code is necessary on the stack to access the instance to a local
13696         variable (the variable will be accessed as a field).
13697
13698         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
13699         EmitContext.EmitAddressOfParameter): Routines to support
13700         parameters (not completed at this point). 
13701         
13702         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
13703         will also remove the parameters.
13704
13705         * convert.cs (Convert): Define a `ConstantEC' which points to a
13706         null.  This is just to prefity some code that uses
13707         ImplicitStandardConversion code and do not have an EmitContext
13708         handy.
13709
13710         The idea is to flag explicitly that at that point in time, it is
13711         known that the conversion will not trigger the delegate checking
13712         code in implicit conversions (which requires a valid
13713         EmitContext). 
13714
13715         Everywhere: pass new EmitContext parameter since
13716         ImplicitStandardConversionExists now requires it to check for
13717         anonymous method conversions. 
13718
13719         (Convert.ImplicitStandardConversionExists): If the type of an
13720         expression is the anonymous_method_type, and the type is a
13721         delegate, we invoke the AnonymousMethod.Compatible method to check
13722         whether an implicit conversion is possible. 
13723
13724         (Convert.ImplicitConversionStandard): Only do implicit method
13725         group conversions if the language level is not ISO_1.
13726
13727         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
13728         MethodInfo for the Invoke method.  used by Delegate and
13729         AnonymousDelegate.
13730
13731         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
13732         method conversions if the target type is a delegate.
13733
13734         Removed extra debugging nops.
13735
13736         (LocalVariableReference): Turn the `local_info' into a public
13737         field. 
13738
13739         Add `prepared' field, the same hack used for FieldExprs to cope
13740         with composed assignments, as Local variables do not necessarily
13741         operate purely on the stack as they used to: they can be captured
13742         fields. 
13743
13744         Add `temp' for a temporary result, like fields.
13745
13746         Refactor DoResolve and DoResolveLValue into DoResolveBase.
13747
13748         It now copes with Local variables that are captured and emits the
13749         proper instance variable to load it from a field in the captured
13750         case. 
13751
13752         (ParameterReference.DoResolveBase): During the resolve phase,
13753         capture parameters if we are in an anonymous method.
13754
13755         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
13756         anonymous method, use the EmitContext helper routines to emit the
13757         parameter reference.
13758
13759         * iterators.cs: Set RemapToProxy to true/false during the
13760         EmitDispose class.
13761
13762         * parameters.cs (GetParameterByName): New helper method. 
13763
13764         * typemanager.cs (anonymous_method_type) a new type that
13765         represents an anonyous method.  This is always an internal type,
13766         used as a fencepost to test against the anonymous-methodness of an
13767         expression. 
13768         
13769 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
13770
13771         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
13772         561 report.
13773         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
13774
13775 2004-10-18  Martin Baulig  <martin@ximian.com>
13776
13777         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
13778         `Type' directly, but call ResolveType() on it.
13779         (Catch.Resolve): Likewise.
13780         (Foreach.Resolve): Likewise.
13781
13782 2004-10-18  Martin Baulig  <martin@ximian.com>
13783
13784         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
13785         `Type' directly, but call ResolveType() on it.
13786         (Probe.DoResolve): Likewise.
13787         (ArrayCreation.LookupType): Likewise.
13788         (TypeOf.DoResolve): Likewise.
13789         (SizeOf.DoResolve): Likewise.
13790
13791 2004-10-18  Martin Baulig  <martin@ximian.com>
13792
13793         * expression.cs (Invocation.BetterFunction): Put back
13794         TypeManager.TypeToCoreType().
13795
13796 2004-10-18  Raja R Harinath  <rharinath@novell.com>
13797
13798         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
13799         the ResolveType.
13800
13801 2004-10-18  Martin Baulig  <martin@ximian.com>
13802
13803         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
13804         `Type' directly, but call ResolveType() on it.
13805
13806 2004-10-18  Martin Baulig  <martin@ximian.com>
13807
13808         * class.cs (FieldMember.Define): Don't access the TypeExpr's
13809         `Type' directly, but call ResolveType() on it.
13810         (MemberBase.DoDefine): Likewise.
13811
13812         * expression.cs (New.DoResolve): Don't access the TypeExpr's
13813         `Type' directly, but call ResolveType() on it.
13814         (ComposedCast.DoResolveAsTypeStep): Likewise.
13815
13816         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
13817         `Type' directly, but call ResolveType() on it.
13818
13819 2004-10-17  John Luke  <john.luke@gmail.com>
13820
13821         * class.cs (Operator.GetSignatureForError): use CSharpName
13822
13823         * parameter.cs (Parameter.GetSignatureForError): Returns
13824         correct name even if was not defined.
13825
13826 2004-10-13  Raja R Harinath  <rharinath@novell.com>
13827
13828         Fix #65816.
13829         * class.cs (TypeContainer.EmitContext): New property.
13830         (DefineNestedTypes): Create an emitcontext for each part.
13831         (MethodCore.DoDefineParameters): Use container's emitcontext.
13832         Pass type array to InternalParameters.
13833         (MemberBase.DoDefine): Use container's emitcontext.
13834         (FieldMember.Define): Likewise.
13835         (Event.Define): Likewise.
13836         (SetMethod.GetParameterInfo): Change argument to EmitContext.
13837         Pass type array to InternalParameters.
13838         (SetIndexerMethod.GetParameterInfo): Likewise.
13839         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
13840         * delegate.cs (Define): Pass emitcontext to
13841         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
13842         array to InternalParameters.
13843         * expression.cs (ParameterReference.DoResolveBase): Pass
13844         emitcontext to GetParameterInfo.
13845         (ComposedCast.DoResolveAsTypeStep): Remove check on
13846         ec.ResolvingTypeTree.
13847         * parameter.cs (Parameter.Resolve): Change argument to
13848         EmitContext.  Use ResolveAsTypeTerminal.
13849         (Parameter.GetSignature): Change argument to EmitContext.
13850         (Parameters.ComputeSignature): Likewise.
13851         (Parameters.ComputeParameterTypes): Likewise.
13852         (Parameters.GetParameterInfo): Likewise.
13853         (Parameters.ComputeAndDefineParameterTypes): Likewise.
13854         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
13855         * support.cs (InternalParameters..ctor): Remove variant that takes
13856         a DeclSpace.
13857         * typemanager.cs (system_intptr_expr): New.
13858         (InitExpressionTypes): Initialize it.
13859
13860 2004-10-12  Chris Toshok  <toshok@ximian.com>
13861
13862         * cs-parser.jay: fix location for try_statement and catch_clause.
13863
13864 2004-10-11  Martin Baulig  <martin@ximian.com>
13865
13866         * report.cs: Don't make --fatal abort on warnings, we have
13867         -warnaserror for that.
13868
13869 2004-10-07  Raja R Harinath  <rharinath@novell.com>
13870
13871         More DeclSpace.ResolveType avoidance.
13872         * decl.cs (MemberCore.InUnsafe): New property.
13873         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
13874         with newly created EmitContext.
13875         (FieldMember.Define): Likewise.
13876         * delegate.cs (Delegate.Define): Likewise.
13877         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
13878         only if normal name-lookup fails.
13879         (TypeExpr.DoResolve): Enable error-checking.
13880         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
13881         (SizeOf.DoResolve): Likewise.
13882         (ComposedCast.DoResolveAsTypeStep): Likewise.
13883         (StackAlloc.DoResolve): Likewise.
13884         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
13885         (Block.Unsafe): New property.
13886         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
13887         (Unsafe): Set 'unsafe' flag of contained block.
13888         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
13889         (Fixed.Resolve): Likewise.
13890         (Catch.Resolve): Likewise.
13891         (Using.ResolveLocalVariableDecls): Likewise.
13892         (Foreach.Resolve): Likewise.
13893
13894 2004-10-05  John Luke <john.luke@gmail.com>
13895
13896         * cs-parser.jay: add location to error CS0175
13897
13898 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
13899
13900         * ecore.cs (Expression.Constantity): Add support for turning null
13901         into a constant.
13902
13903         * const.cs (Const.Define): Allow constants to be reference types
13904         as long as the value is Null.
13905
13906 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
13907
13908         * namespace.cs (NamespaceEntry.Using): No matter which warning
13909         level is set, check if this namespace name has already been added.
13910
13911 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
13912
13913         * expression.cs: reftype [!=]= null should always use br[true,false].
13914         # 67410
13915
13916 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
13917
13918         Fix #67108
13919         * attribute.cs: Enum conversion moved to 
13920         GetAttributeArgumentExpression to be applied to the all
13921         expressions.
13922
13923 2004-10-01  Raja R Harinath  <rharinath@novell.com>
13924
13925         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
13926         * class.c (TypeContainer.DefineType): Flag error if
13927         base types aren't accessible due to access permissions.
13928         * decl.cs (DeclSpace.ResolveType): Move logic to
13929         Expression.ResolveAsTypeTerminal.
13930         (DeclSpace.ResolveTypeExpr): Thin layer over
13931         Expression.ResolveAsTypeTerminal.
13932         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
13933         Refactor code into NestedAccess.  Use it.
13934         (DeclSpace.NestedAccess): New.
13935         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
13936         argument to silence errors.  Check access permissions.
13937         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13938         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13939         (Cast.DoResolve): Likewise.
13940         (New.DoResolve): Likewise.
13941         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13942         (TypeOf.DoResolve): Likewise.
13943
13944         * expression.cs (Invocation.BetterConversion): Return the Type of
13945         the better conversion.  Implement section 14.4.2.3 more faithfully.
13946         (Invocation.BetterFunction): Make boolean.  Make correspondence to
13947         section 14.4.2.2 explicit.
13948         (Invocation.OverloadResolve): Update.
13949         (Invocation): Remove is_base field.
13950         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
13951         (Invocation.Emit): Likewise.
13952
13953 2004-09-27  Raja R Harinath  <rharinath@novell.com>
13954
13955         * README: Update to changes.
13956
13957 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
13958
13959         * cs-parser.jay: Reverted 642 warning fix.
13960
13961 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13962
13963         Fix bug #66615
13964         * decl.cs (FindMemberWithSameName): Indexer can have more than
13965         1 argument.
13966
13967 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13968
13969         * expression.cs (LocalVariableReference.DoResolveLValue):
13970         Do not report warning 219 for out values.
13971         (EmptyExpression.Null): New member to avoid extra allocations.
13972
13973 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13974
13975         * cs-parser.jay: Fix wrong warning 642 report.
13976
13977         * cs-tokenizer.cs (CheckNextToken): New helper;
13978         Inspect next character if is same as expected.
13979
13980 2004-09-23  Martin Baulig  <martin@ximian.com>
13981
13982         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13983         (Convert.ImplicitReferenceConversionExists): Likewise.
13984
13985 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13986
13987         * class.cs (Operator.Define): Add error 448 and 559 report.
13988
13989 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13990
13991         * class.cs (MemberBase.IsTypePermitted): New protected
13992         method for checking error CS0610.
13993
13994 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13995
13996         * class.cs (TypeContainer.HasExplicitLayout): New property
13997         Returns whether container has StructLayout attribute set Explicit.
13998         (FieldMember): New abstract class for consts and fields.
13999         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14000         (Field): Reuse FieldMember.
14001
14002         * const.cs (Const): Reuse FieldMember.
14003
14004         * rootcontext.cs: EmitConstants call moved to class.
14005
14006 2004-09-22  Martin Baulig  <martin@ximian.com>
14007
14008         Thanks to Peter Sestoft for this bug report.
14009
14010         * expression.cs (Conditional): If both the `trueExpr' and the
14011         `falseExpr' is a NullLiteral, return a NullLiteral.
14012
14013 2004-09-22  Martin Baulig  <martin@ximian.com>
14014
14015         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14016         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14017         for the "get_Current" call.
14018
14019 2004-09-22  Martin Baulig  <martin@ximian.com>
14020
14021         Marek and me just fixed one of our oldest bugs: #28562 :-)
14022
14023         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14024
14025         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14026         we're an EnumConstant, just return that.
14027         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14028         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14029         to get the value which'll actually be written into the attribute.
14030         However, we have to use GetValue() to access the attribute's value
14031         in the compiler.        
14032
14033 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14034
14035         * constant.cs (Constant.IsNegative): New abstract property
14036         IsNegative.
14037
14038         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14039         (StackAlloc.DoResolve): Reused IsNegative.
14040
14041 2004-09-21  Martin Baulig  <martin@ximian.com>
14042
14043         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14044         if we're used in an iterator, we may be called from different
14045         methods.
14046
14047         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14048         we actually have an exception block.
14049
14050 2004-09-20  John Luke <jluke@cfl.rr.com>
14051
14052         * class.cs, cs-parser.jay: Improve the error report for 1520:
14053         report the actual line where the error happens, not where the
14054         class was declared.
14055
14056         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14057         Pass location information that was available elsewhere.
14058
14059 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14060
14061         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14062         runtime to delay sign assemblies.
14063
14064 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * cs-parser.jay: Do not report the stack trace, this is barely
14067         used nowadays.
14068
14069 2004-08-22  John Luke  <john.luke@gmail.com>
14070  
14071         * driver.cs : check that a resource id is not already used
14072         before adding it, report CS1508 if it is, bug #63637
14073
14074 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14075
14076         * ecore.cs: Removed dead code.
14077
14078 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14079
14080         * class.cs: Do not report warning CS0067 on the interfaces.
14081
14082 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14083
14084         * cs-parser.jay: Add error 504 report.
14085
14086 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14087
14088         * rootcontext.cs: WarningLevel is 4 by default now.
14089
14090         * statement.cs (Fixed.Resolve): Do not null
14091         VariableInfo.
14092
14093 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14094
14095         Fixed bug #55780
14096         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14097         deep search when property is not virtual.
14098         (PropertyExpr.ResolveAccessors): Make one call for both
14099         accessors.
14100
14101 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14102
14103         Fixed bug #65766
14104         * statement.cs: Error 152 report constains also location.
14105
14106 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14107
14108         Fixed bug #65766
14109         * const.cs: Explicitly set constant as static.
14110
14111 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14112
14113         Fixed bug #64226
14114         * cs-parser.jay: Add error 1017 report.
14115
14116 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14117
14118         Fixed bug #59980, #64224
14119         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14120
14121         * typemanager.cs (IsSpecialMethod): Simplified
14122
14123 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14124
14125         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14126         condition with better params.
14127
14128 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14129
14130         Fixed bug #65238
14131         * attribute.cs (Resolve): Property has to have both
14132         accessors.
14133
14134 2004-09-14  Martin Baulig  <martin@ximian.com>
14135
14136         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14137
14138 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14139
14140         Fixed bug #61902
14141         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14142         called and is obsolete then this member suppress message
14143         when call is inside next [Obsolete] method or type.
14144
14145         * expression.cs: Use TestObsoleteMethodUsage member.
14146
14147 2004-09-14  Martin Baulig  <martin@ximian.com>
14148
14149         * cs-parser.jay: Sync a bit with the GMCS version.
14150
14151 2004-09-14  Martin Baulig  <martin@ximian.com>
14152
14153         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14154         (CSharpParser.yacc_verbose_flag): New public field.
14155
14156         * genericparser.cs: Removed.
14157
14158 2004-09-14  Raja R Harinath  <rharinath@novell.com>
14159
14160         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14161
14162 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
14163
14164         * class.cs (MethodCore.CheckBase): Fix bug #65757.
14165
14166 2004-09-10  Martin Baulig  <martin@ximian.com>
14167
14168         Backported my MemberName changes from GMCS into MCS.
14169
14170         - we are now using a special `MemberName' class instead of using
14171         strings; in GMCS, the `MemberName' also contains the type
14172         arguments.
14173
14174         - changed the grammar rules a bit:
14175           * the old `member_name' is now a `namespace_or_type_name':
14176             The rule is that we use `namespace_or_type_name' everywhere
14177             where we expect either a "member name" (GetEnumerator) or a
14178             "member name" with an explicit interface name
14179             (IEnumerable.GetEnumerator).
14180             In GMCS, the explicit interface name may include type arguments
14181             (IEnumerable<T>.GetEnumerator).
14182           * we use `member_name' instead of just `IDENTIFIER' for
14183             "member names":
14184             The rule is that we use `member_name' wherever a member may
14185             have type parameters in GMCS.       
14186
14187         * decl.cs (MemberName): New public class.
14188         (MemberCore.MemberName): New public readonly field.
14189         (MemberCore.ctor): Take a `MemberName' argument, not a string.
14190         (DeclSpace): Likewise.
14191
14192         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14193         * enum.cs (Enum.ctor): Likewise.
14194
14195         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14196         MemberName.     
14197         (AliasEntry.ctor): Take a MemberName, not an Expression.
14198         (AliasEntry.UsingAlias): Likewise.
14199
14200         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14201         (IMethodData.MemberName): Changed type from string to MemberName.
14202         (MemberBase.ExplicitInterfaceName): Likewise.
14203         (AbstractPropertyEventMethod.SetupName): Make this private.
14204         (AbstractPropertyEventMethod.ctor): Added `string prefix'
14205         argument; compute the member name here.
14206         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14207         on the `member.MemberName' and the `prefix'.
14208
14209         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14210         not `type_name'.
14211         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14212         thus, we get a `MemberName' instead of a `string'.  These
14213         declarations may have type parameters in GMCS.
14214         (interface_method_declaration, delegate_declaration): Likewise.
14215         (class_declaration, interface_declaration): Likewise.
14216         (method_header): Use `namespace_or_type_name' instead of
14217         `member_name'.  We may be an explicit interface implementation.
14218         (property_declaration, event_declaration): Likewise.
14219         (member_name): This is now just an `IDENTIFIER', not a
14220         `namespace_or_type_name'.
14221         (type_name, interface_type): Removed.
14222         (namespace_or_type_name): Return a MemberName, not an Expression.
14223         (primary_expression): Use `member_name' instead of `IDENTIFIER';
14224         call GetTypeExpression() on the MemberName to get an expression.
14225         (IndexerDeclaration.interface_type): Changed type from string to
14226         MemberName.
14227         (MakeName): Operate on MemberName's instead of string's.
14228
14229 2004-09-13  Raja R Harinath  <rharinath@novell.com>
14230
14231         Fix bug #55770.
14232         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14233         (NamespaceEntry.Lookup): Add new argument to flag if we want the
14234         lookup to avoid symbols introduced by 'using'.
14235         * rootcontext.cs (NamespaceLookup): Update.
14236
14237 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14238
14239         * class.cs (TypeContainer.DoDefineMembers): Do not call
14240         DefineDefaultConstructor for static classes.
14241
14242 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14243
14244         * attribute.cs (Attribute.Resolve): Add error 653 report.
14245
14246         * class.cs (Class.ApplyAttributeBuilder): Add error 641
14247         report.
14248         (Method.ApplyAttributeBuilder): Add error 685 report.
14249         (Operator.Define): Add error 564 report.
14250
14251         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14252
14253         * expression.cs (Invocation.DoResolve): Add error
14254         245 and 250 report.
14255
14256         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14257         error 674 report.
14258
14259 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14260
14261         * class.cs (ConstructorInitializer.Resolve):
14262         Wrong error number (515->516).
14263
14264 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14265
14266         * class.cs (Indexer.Define): Add error 631 report.
14267
14268 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14269
14270         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14271
14272 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14273
14274         * expression.cs (Probe.DoResolve): Add error CS0241 report.
14275
14276 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
14277
14278         * cs-parser.jay: Added error CS0241 report.
14279
14280 2004-09-10  Raja R Harinath  <rharinath@novell.com>
14281
14282         * cs-parser.jay (fixed_statement): Introduce a scope for the
14283         declaration in the 'fixed' statement.
14284
14285 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14286
14287         * cs-parser.jay: Added CS0230 error report.
14288
14289 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14290
14291         * cs-parser.jay: Added errors CS0231 and CS0257 report.
14292
14293 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14294
14295         * expression.cs (Argument.Resolve): Added error CS0192 and
14296         CS0199 report.
14297
14298 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14299
14300         C# 2.0 #pragma warning feature
14301
14302         * cs-tokenizer.cs (PreProcessPragma): New method; 
14303         Handles #pragma directive.
14304
14305         * report.cs (WarningRegions): New class; Support
14306         class for #pragma warning directive. It tests whether
14307         warning is enabled for a given line.
14308
14309 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * const.cs: Add more descriptive error report, tahnks to
14312         Sebastien. 
14313
14314 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
14315
14316         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14317
14318 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * expression.cs: Apply patch from Ben: Remove dead code from
14321         ArrayCreation, and remove the TurnintoConstant call in const.cs,
14322         as that code just threw an exception anwyays.
14323
14324         * const.cs: Remove the call to the turnintoconstant, for details
14325         see bug: #63144
14326         
14327         * literal.cs: The type of the null-literal is the null type;  So
14328         we use a placeholder type (literal.cs:System.Null, defined here)
14329         for it.
14330
14331         * expression.cs (Conditional.DoResolve): Remove some old code that
14332         is no longer needed, conversions have been fixed.
14333
14334         (ArrayCreationExpression.DoResolve): Return false if we fail to
14335         resolve the inner expression.
14336
14337 2004-09-07  Raja R Harinath  <rharinath@novell.com>
14338
14339         Fix test-290.cs.
14340         * cs-parser.jay (delegate_declaration): Record a delegate
14341         declaration as a type declaration.
14342         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14343
14344 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
14345
14346         * parameter.cs: Do not crash if the type can not be resolved. 
14347
14348         * expression.cs: Report errors with unsafe pointers, fixes #64896
14349
14350 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14351
14352         * expression.cs: Pointer arith always needs to do a conv.i
14353         if the operand is a long. fix 65320
14354
14355 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14356
14357         Fixed cs0619-37.cs, cs0619-38.cs
14358
14359         * enum.cs (GetObsoleteAttribute): Removed.
14360
14361         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14362         on Enum member is double staged. The first is tested member
14363         and then enum.
14364
14365 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14366
14367         Fixed #56986, #63631, #65231
14368
14369         * class.cs: (TypeContainer.AddToMemberContainer): New method,
14370         adds member to name container.
14371         (TypeContainer.AddToTypeContainer): New method, adds type to
14372         name container.
14373         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14374         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14375         AddOperator): Simplified by reusing AddToMemberContainer.
14376         (TypeContainer.UserDefinedStaticConstructor): Changed to property
14377         instead of field.
14378         (Method.CheckForDuplications): Fixed implementation to test all
14379         possibilities.
14380         (MemberBase): Detection whether member is explicit interface
14381         implementation is now in constructor.
14382         (MemberBase.UpdateMemberName): Handles IndexerName.
14383         (Accessor): Changed to keep also location information.
14384         (AbstractPropertyEventMethod): Is derived from MemberCore.
14385         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14386         will be emited or not.
14387         (PropertyBase.AreAccessorsDuplicateImplementation):
14388         Tests whether accessors are not in collision with some method.
14389         (Operator): Is derived from MethodCore to simplify common
14390         operations.
14391
14392         * decl.cs (Flags.TestMethodDuplication): Test for duplication
14393         must be performed.
14394         (DeclSpace.AddToContainer): Adds the member to defined_names
14395         table. It tests for duplications and enclosing name conflicts.
14396
14397         * enum.cs (EnumMember): Clean up to reuse the base structures
14398
14399 2004-09-03  Martin Baulig  <martin@ximian.com>
14400
14401         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14402         into TypeContainer, to make partial classes work again.
14403
14404 2004-09-03  Martin Baulig  <martin@ximian.com>
14405
14406         * rootcontext.cs (RootContext.V2): Removed.
14407
14408 2004-03-23  Martin Baulig  <martin@ximian.com>
14409
14410         * expression.cs (Invocation.OverloadResolve): Added `bool
14411         may_fail' argument and use it instead of the Location.IsNull() hack.
14412
14413 2004-09-03  Martin Baulig  <martin@ximian.com>
14414
14415         Merged latest changes into gmcs.  Please keep this comment in
14416         here, it makes it easier for me to see what changed in MCS since
14417         the last time I merged.
14418
14419 2004-09-03  Raja R Harinath  <rharinath@novell.com>
14420
14421         Fix #61128.
14422         * expression.cs (BetterConversion): Don't allow either conversion 
14423         to be null.  Remove redundant implicit conversion test when 'q ==
14424         null' -- when this function is invoked, we already know that the
14425         implicit conversion exists.
14426         (BetterFunction): Assume that 'best' is non-null.  Remove
14427         redundant reimplementation of IsApplicable when 'best' is null.
14428         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14429         number of arguments.
14430         (IsAncestralType): Extract from OverloadResolve.
14431         (OverloadResolve): Make robust to the MethodGroupExpr being
14432         unsorted.  Implement all the logic of Section 14.5.5.1, and
14433         support overloading of methods from multiple applicable types.
14434         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
14435
14436         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14437         (RealError, Warning): Append type of report to related symbol.
14438
14439 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
14440
14441         * enum.cs: Fixed CLS-Compliance checks for enum members.
14442         Error tests cs3008-8.cs, cs3014-8.cs
14443
14444 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14445
14446         Fixed bug #62342, #63102
14447         * class.cs: ImplementIndexer uses member.IsExplicitImpl
14448         like ImplementMethod.
14449
14450 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14451
14452         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14453         Fixed bug #65170.
14454
14455 2004-09-02  Martin Baulig  <martin@ximian.com>
14456
14457         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14458         TypeManager.GetArgumentTypes() rather than calling GetParameters()
14459         on the MethodBase.
14460
14461 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
14462
14463         C# 2.0 Static classes implemented
14464
14465         * class.cs (TypeContainer): instance_constructors,
14466         initialized_fields, initialized_static_fields,
14467         default_constructor, base_inteface_types are protected to be
14468         accessible from StaticClass.
14469         (TypeContainer.DefineDefaultConstructor): New virtual method
14470         for custom default constructor generating
14471         (StaticClass): New class to handle "Static classes" feature.
14472
14473         * cs-parser.jay: Handle static keyword on class like instance
14474         of StaticClass.
14475
14476         * driver.cs: Added "/langversion" command line switch with two
14477         options (iso-1, default).
14478
14479 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
14480
14481         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14482
14483 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
14484
14485         * delegate.cs: Style.
14486
14487 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14488
14489         * delegate.cs: Add seperate instance expr field for miguel.
14490
14491 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14492
14493         * PointerArithmetic (Resolve): make sure we are not doing
14494         pointer arith on void*. Also, make sure we are resolved
14495         by not setting eclass until resolve.
14496
14497         All callers: Make sure that PointerArithmetic gets resolved.
14498
14499 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14500
14501         * ArrayCreation (LookupType): If the type does not resolve 
14502         to an array, give an error.
14503
14504 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
14505
14506         * statement.cs (Try.Resolve): Fixed bug #64222
14507
14508 2004-08-27  Martin Baulig  <martin@ximian.com>
14509
14510         * class.cs
14511         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
14512         crash here.     
14513
14514 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
14515
14516         * ecore.cs (Constantify): Get underlying type via
14517         System.Enum.GetUnderlyingType to avoid StackOverflow on the
14518         Windows in special cases.
14519
14520 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
14521
14522         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
14523         for obtaining also private methods.
14524         (GetRemoveMethod): Used GetRemoveMethod (true)
14525         for obtaining also private methods.
14526
14527 2004-08-24  Martin Baulig  <martin@ximian.com>
14528
14529         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
14530         MethodAttributes.HideBySig for operators.
14531
14532 2004-08-23  Martin Baulig  <martin@ximian.com>
14533
14534         Back to the old error reporting system :-)
14535
14536         * report.cs (Message): Removed.
14537         (Report.MessageData, ErrorData, WarningData): Removed.
14538         (Report.Error, Warning): Back to the old system.
14539
14540 2004-08-23  Martin Baulig  <martin@ximian.com>
14541
14542         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
14543
14544         * class.cs (TypeContainer.ParentContainer): New public virtual
14545         method; replaces the explicit interface implementation.
14546         (ClassPart.ParentContainer): Override.
14547
14548 2004-08-23  Martin Baulig  <martin@ximian.com>
14549
14550         * statement.cs (Switch): Added support for constant switches; see
14551         #59428 or test-285.cs.
14552
14553 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
14554
14555         Fixed bug #62740.
14556         * statement.cs (GetEnumeratorFilter): Removed useless
14557         logic because C# specs is strict. GetEnumerator must be
14558         public.
14559
14560 2004-08-22  Martin Baulig  <martin@ximian.com>
14561
14562         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14563         a switch and may break, reset the barrier.  Fixes #59867.
14564
14565 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
14566
14567         CLS-Compliance speed up (~5% for corlib)
14568
14569         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
14570         New method. Tests container for CLS-Compliant names
14571
14572         * class.cs (TypeContainer.VerifyClsName): New method.
14573         Checks whether container name is CLS Compliant.
14574         (Constructor): Implements IMethodData.
14575
14576         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
14577         low-case table for CLS Compliance test.
14578         (MemberCache.VerifyClsParameterConflict): New method.
14579         Checks method parameters for CS3006 error.
14580
14581         * enum.cs (EnumMember): Is derived from MemberCore.
14582         (Enum.VerifyClsName): Optimized for better performance.
14583
14584 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
14585
14586         * report.cs: Renamed Error_T to Error and changed all
14587         references.
14588
14589 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
14590
14591         * class.cs (TypeContainer.IndexerArrayList): New inner class
14592         container for indexers.
14593         (TypeContainer.DefaultIndexerName): New constant for default
14594         indexer name. Replaced all "Item" with this constant.
14595         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
14596
14597         * typemanager.cs (TypeManager.default_member_ctor): Cache here
14598         DefaultMemberAttribute constructor.
14599
14600 2004-08-05  Martin Baulig  <martin@ximian.com>
14601
14602         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14603         Fix bug #59429.
14604
14605 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
14606
14607         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
14608         multi platforms problem.
14609
14610         * compiler.csproj: Included shared files.
14611
14612 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14613
14614         Fix bug 60333, 55971 in the more general way
14615         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14616         Added arg_type argument for constant conversion.
14617         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
14618
14619 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14620
14621         Fix bug #59760
14622         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
14623         OperatorArrayList, MethodCoreArrayList for typecontainer
14624         containers. Changed class member types to these new types.
14625         (MethodArrayList.DefineMembers): Added test for CS0659.
14626
14627 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
14628
14629         * cfold.cs: Synchronize the folding with the code in expression.cs
14630         Binary.DoNumericPromotions for uint operands.
14631
14632         * attribute.cs: Revert patch from Raja, it introduced a regression
14633         while building Blam-1.2.1 (hard to isolate a test case).
14634
14635 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14636
14637         Fix for #55382
14638         * class.cs:
14639         (TypeContainer.Define): Renamed to DefineContainerMembers because of
14640         name collision.
14641         (MethodCore.parent_method): New member. The method we're overriding
14642         if this is an override method.
14643         (MethodCore.CheckBase): Moved from Method class and made common.
14644         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
14645         private.
14646         (MethodCore.CheckForDuplications): New abstract method. For custom
14647         member duplication search in a container
14648         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
14649         method and its return type.
14650         (Event.conflict_symbol): New member. Symbol with same name in the
14651         parent class.
14652
14653         * decl.cs:
14654         (MemberCache.FindMemberWithSameName): New method. The method
14655         is looking for conflict with inherited symbols.
14656
14657 2004-08-04  Martin Baulig  <martin@ximian.com>
14658
14659         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
14660
14661         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
14662
14663 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14664
14665         * report.cs (Message): New enum for better error, warning reference in
14666         the code.
14667         (MessageData): New inner abstract class. It generally handles printing of
14668         error and warning messages.
14669         Removed unused Error, Warning, Message methods.
14670
14671 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14672
14673         Fix for cs0592-8.cs test
14674         * attribute.cs
14675         (Attributable.ValidAttributeTargets): Made public.
14676         (Attribute.ExplicitTarget): New member for explicit target value.
14677         (Attribute.CheckTargets): Now we translate explicit attribute
14678         target to Target here.
14679
14680 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
14681
14682         * ecore.cs (MethodGroupExpr): new IsBase property.
14683
14684         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
14685
14686         * delegate.cs (DelegateCreation): store a MethodGroupExpr
14687         rather than an instance expr.
14688
14689         (DelegateCreation.Emit): Use the method group rather than
14690         the instance expression. Also, if you have base.Foo as the
14691         method for a delegate, make sure to emit ldftn, not ldftnvirt.
14692
14693         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
14694
14695         (NewDelegate.DoResolve): Only check for the existance of Invoke
14696         if the method is going to be needed. Use MethodGroupExpr.
14697
14698         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
14699
14700         * expression.cs: For pointer arith., make sure to use
14701         the size of the type, not the size of the pointer to
14702         the type.
14703
14704 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14705
14706         Fix for #60722
14707         * class.cs (Class): Added error CS0502 test.
14708
14709 2004-08-03  John Luke  <jluke@cfl.rr.com>
14710             Raja R Harinath  <rharinath@novell.com>
14711
14712         Fix for #60997.
14713         * attribute.cs (Attribute.complained_before): New flag.
14714         (Attribute.ResolveType, Attribute.Resolve),
14715         (Attribute.DefinePInvokeMethod): Set it.
14716         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
14717         
14718 2004-08-03  Martin Baulig  <martin@ximian.com>
14719
14720         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
14721         use a user-defined operator; we still need to do numeric
14722         promotions in case one argument is a builtin type and the other
14723         one has an implicit conversion to that type.  Fixes #62322.
14724
14725 2004-08-02  Martin Baulig  <martin@ximian.com>
14726
14727         * statement.cs (LocalInfo.Flags): Added `IsThis'.
14728         (LocalInfo.IsThis): New public property.
14729         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
14730
14731 2004-08-01  Martin Baulig  <martin@ximian.com>
14732
14733         * class.cs (TypeContainer.GetClassBases): Don't set the default
14734         here since we may get called from GetPartialBases().
14735         (TypeContainer.DefineType): If GetClassBases() didn't return a
14736         parent, use the default one.
14737
14738 2004-07-30  Duncan Mak  <duncan@ximian.com>
14739
14740         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
14741
14742 2004-07-30  Martin Baulig  <martin@ximian.com>
14743
14744         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
14745
14746         * class.cs (SourceMethod): New public class, derive from the
14747         symbol writer's ISourceMethod.
14748         (Method): Use the new symbol writer API.
14749
14750         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
14751         as argument and use the new symbol writer.
14752
14753         * location.cs
14754         (SourceFile): Implement the symbol writer's ISourceFile.
14755         (Location.SymbolDocument): Removed.
14756         (Location.SourceFile): New public property.
14757
14758         * symbolwriter.cs: Use the new symbol writer API.
14759
14760 2004-07-30  Raja R Harinath  <rharinath@novell.com>
14761
14762         * Makefile (install-local): Remove.  Functionality moved to
14763         executable.make.
14764
14765 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
14766
14767         * Makefile: Install mcs.exe.config file together with mcs.exe.
14768         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
14769         correct runtime version.
14770         
14771 2004-07-25  Martin Baulig  <martin@ximian.com>
14772
14773         * class.cs
14774         (TypeContainer.RegisterOrder): Removed, this was unused.
14775         (TypeContainer, interface_order): Removed.
14776         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
14777         TypeContainer as argument since we can also be called with a
14778         `PartialContainer' for a partial class/struct/interface.
14779         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
14780         of checking whether we're an `Interface' - we could be a
14781         `PartialContainer'.
14782         (PartialContainer.Register): Override; call
14783         AddClass()/AddStruct()/AddInterface() on our parent.
14784
14785         * cs-parser.jay (interface_member_declaration): Add things to the
14786         `current_container', not the `current_class'.
14787
14788         * rootcontext.cs (RegisterOrder): The overloaded version which
14789         takes an `Interface' was unused, removed.
14790
14791         * typemanager.cs (TypeManager.LookupInterface): Return a
14792         `TypeContainer', not an `Interface'.
14793         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
14794         contain a `PartialContainer' for an interface, so check it's
14795         `Kind' to figure out what it is.
14796
14797 2004-07-25  Martin Baulig  <martin@ximian.com>
14798
14799         * class.cs (Class.DefaultTypeAttributes): New public constant.
14800         (Struct.DefaultTypeAttributes): Likewise.
14801         (Interface.DefaultTypeAttributes): Likewise.
14802         (PartialContainer.TypeAttr): Override this and add the
14803         DefaultTypeAttributes.
14804
14805 2004-07-25  Martin Baulig  <martin@ximian.com>
14806
14807         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
14808         we can just use the `Parent' field instead.
14809
14810 2004-07-25  Martin Baulig  <martin@ximian.com>
14811
14812         * class.cs (TypeContainer.Emit): Renamed to EmitType().
14813
14814 2004-07-25  Martin Baulig  <martin@ximian.com>
14815
14816         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
14817         our parts before defining any methods.
14818         (TypeContainer.VerifyImplements): Make this virtual.
14819         (ClassPart.VerifyImplements): Override and call VerifyImplements()
14820         on our PartialContainer.
14821
14822 2004-07-25  Martin Baulig  <martin@ximian.com>
14823
14824         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
14825
14826         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
14827         argument, we can just use the `Parent' field instead.
14828
14829         * class.cs
14830         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
14831         (MemberBase.DoDefine): Likewise.
14832
14833 2004-07-24  Martin Baulig  <martin@ximian.com>
14834
14835         * decl.cs (MemberCore.Parent): New public field.
14836         (DeclSpace.Parent): Moved to MemberCore.
14837
14838         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
14839         (MemberBase.ctor): Added TypeContainer argument, pass it to our
14840         parent's .ctor.
14841         (FieldBase, Field, Operator): Likewise.
14842         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
14843         (EventField, Event): Likewise.
14844
14845 2004-07-23  Martin Baulig  <martin@ximian.com>
14846
14847         * class.cs (PartialContainer): New public class.
14848         (ClassPart): New public class.
14849         (TypeContainer): Added support for partial classes.
14850         (TypeContainer.GetClassBases): Splitted some of the functionality
14851         out into GetNormalBases() and GetPartialBases().
14852
14853         * cs-tokenizer.cs (Token.PARTIAL): New token.
14854         (Tokenizer.consume_identifier): Added some hacks to recognize
14855         `partial', but only if it's immediately followed by `class',
14856         `struct' or `interface'.
14857
14858         * cs-parser.jay: Added support for partial clases.
14859
14860 2004-07-23  Martin Baulig  <martin@ximian.com>
14861
14862         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
14863         a `DeclSpace' and also made it readonly.
14864         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
14865         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
14866         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
14867
14868         * cs-parser.jay: Pass the `current_class', not the
14869         `current_container' (at the moment, this is still the same thing)
14870         to a new Method, Property, Event, Indexer or Constructor.
14871
14872 2004-07-23  Martin Baulig  <martin@ximian.com>
14873
14874         * cs-parser.jay (CSharpParser): Added a new `current_class' field
14875         and removed the `current_interface' one.
14876         (struct_declaration, class_declaration, interface_declaration):
14877         Set `current_class' to the newly created class/struct/interface;
14878         set their `Bases' and call Register() before parsing their body.
14879
14880 2004-07-23  Martin Baulig  <martin@ximian.com>
14881
14882         * class.cs (Kind): New public enum.
14883         (TypeContainer): Made this class abstract.
14884         (TypeContainer.Kind): New public readonly field.
14885         (TypeContainer.CheckDef): New public method; moved here from
14886         cs-parser.jay.
14887         (TypeContainer.Register): New public abstract method.
14888         (TypeContainer.GetPendingImplementations): New public abstract
14889         method.
14890         (TypeContainer.GetClassBases): Removed the `is_class' and
14891         `is_iface' parameters.
14892         (TypeContainer.DefineNestedTypes): Formerly known as
14893         DoDefineType().
14894         (ClassOrStruct): Made this class abstract.
14895
14896         * tree.cs (RootTypes): New public type. 
14897
14898 2004-07-20  Martin Baulig  <martin@ximian.com>
14899
14900         * tree.cs (Tree.RecordNamespace): Removed.
14901         (Tree.Namespaces): Removed.
14902
14903         * rootcontext.cs (RootContext.IsNamespace): Removed.
14904
14905         * cs-parser.jay (namespace_declaration): Just create a new
14906         NamespaceEntry here.
14907
14908 2004-07-20  Martin Baulig  <martin@ximian.com>
14909
14910         * statement.cs (ExceptionStatement): New abstract class.  This is
14911         now used as a base class for everyone who's using `finally'.
14912         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
14913         our local variables before using them.
14914
14915         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
14916         virtual method.  This is used by Yield.Resolve() to "steal" an
14917         outer block's `finally' clauses.
14918         (FlowBranchingException): The .ctor now takes an ExceptionStatement
14919         argument.
14920
14921         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
14922         version which takes an ExceptionStatement.  This version must be
14923         used to create exception branchings.
14924
14925         * iterator.cs
14926         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
14927         (Iterator.EmitMoveNext): Added exception support; protect the
14928         block with a `fault' clause, properly handle 'finally' clauses.
14929         (Iterator.EmitDispose): Run all the `finally' clauses here.
14930
14931 2004-07-20  Martin Baulig  <martin@ximian.com>
14932
14933         * iterator.cs: This is the first of a set of changes in the
14934         iterator code.  Match the spec more closely: if we're an
14935         IEnumerable, then GetEnumerator() must be called.  The first time
14936         GetEnumerator() is called, it returns the current instance; all
14937         subsequent invocations (if any) must create a copy.
14938
14939 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
14940
14941         * expression.cs: Resolve the constant expression before returning
14942         it. 
14943
14944 2004-07-19  Martin Baulig  <martin@ximian.com>
14945
14946         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14947         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14948         the return type of the new EmitContext.
14949
14950 2004-07-18  Martin Baulig  <martin@ximian.com>
14951
14952         * class.cs (Property.Define): Fix iterators.
14953
14954         * iterators.cs (Iterator.Define): Moved the
14955         `container.AddInterator (this)' call here from the .ctor; only do
14956         it if we resolved successfully.
14957
14958 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14961         `true' for preprocessing directives that we parse.  The return
14962         value indicates whether we should return to regular tokenizing or
14963         not, not whether it was parsed successfully.
14964
14965         In the past if we were in: #if false ... #line #endif, we would
14966         resume parsing after `#line'.  See bug 61604.
14967
14968         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14969         building: IsEnumType should return true only for enums, not for
14970         enums or System.Enum itself.  This fixes #61593.
14971
14972         Likely what happened is that corlib was wrong: mcs depended on
14973         this bug in some places.  The bug got fixed, we had to add the
14974         hack, which caused bug 61593.
14975
14976         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14977         that was a workaround for the older conditions.
14978
14979 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
14980
14981         * assign.cs: IAssignMethod has a new interface, as documented
14982         inline. All assignment code now uses this new api.
14983
14984         * ecore.cs, expression.cs: All classes which implement
14985         IAssignMethod now use the new interface.
14986
14987         * expression.cs (Invocation): add a hack to EmitCall so that
14988         IndexerAccess can be the target of a compound assignment without
14989         evaluating its arguments twice.
14990
14991         * statement.cs: Handle changes in Invocation api.
14992
14993 2004-07-16  Martin Baulig  <martin@ximian.com>
14994
14995         * iterators.cs: Rewrote this.  We're now using one single Proxy
14996         class for both the IEnumerable and the IEnumerator interface and
14997         `Iterator' derives from Class so we can use the high-level API.
14998
14999         * class.cs (TypeContainer.AddIterator): New method.
15000         (TypeContainer.DoDefineType): New protected virtual method, which
15001         is called from DefineType().
15002         (TypeContainer.DoDefineMembers): Call DefineType() and
15003         DefineMembers() on all our iterators.
15004         (TypeContainer.Emit): Call Emit() on all our iterators.
15005         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15006
15007         * codegen.cs (EmitContext.CurrentIterator): New public field.
15008
15009 2004-07-15  Martin Baulig  <martin@ximian.com>
15010
15011         * typemanager.cs
15012         (TypeManager.not_supported_exception_type): New type.   
15013
15014 2004-07-14  Martin Baulig  <martin@ximian.com>
15015
15016         * iterators.cs: Use real error numbers.
15017
15018 2004-07-14  Martin Baulig  <martin@ximian.com>
15019
15020         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15021         requires this to be a System.Collection.IEnumerable and not a
15022         class implementing that interface.
15023         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15024
15025 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15026
15027         * class.cs: Fixed previous fix, it broke some error tests.
15028
15029 2004-07-12  Martin Baulig  <martin@ximian.com>
15030
15031         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15032         Fixes #61293.
15033
15034 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15035
15036         * assign.cs (LocalTemporary): Add new argument: is_address,If
15037         `is_address' is true, then the value that we store is the address
15038         to the real value, and not the value itself.
15039         
15040         * ecore.cs (PropertyExpr): use the new local temporary
15041         stuff to allow us to handle X.Y += z (where X is a struct)
15042
15043 2004-07-08  Martin Baulig  <martin@ximian.com>
15044
15045         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15046         not always return, just like we're doing in Using.Resolve().
15047
15048 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15049
15050         * cs-parser.jay (fixed_statement): flag this as Pinned.
15051
15052 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15053
15054         * typemanager.cs (TypeManager): Removed MakePinned method, this
15055         mechanism is replaced with the .NET 2.x compatible mechanism of
15056         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15057
15058         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15059         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15060         `IsFixed' property which has a different meaning.
15061
15062 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15063
15064         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15065         visible from inside a nested class, not just the names of the
15066         immediately enclosing class.
15067         Fix for bug #60730.
15068
15069 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15070
15071         * expression.cs (BetterConversion): Remove buggy special-case
15072         handling of "implicit constant expression conversions".  At this
15073         point, we already know that the conversion is possible -- we're
15074         only checking to see which is better.
15075
15076 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15077
15078         * cs-parser.jay: Added error CS0210 test.
15079
15080 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15081
15082         * cs-parser.jay: Added error CS0134 test.
15083
15084 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15085
15086         Fix bug #52507
15087         * cs-parser.jay: Added error CS0145 test.
15088
15089 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15090
15091         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15092
15093 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15094         
15095         * expression.cs (StackAlloc.Resolve): The argument may not
15096         be a constant; deal with this case.
15097         
15098 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15099
15100         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15101         GetIndexerAttributeValue.
15102         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15103
15104         * class.cs (Indexer.Define): Added error tests for CS0415,
15105         CS0609.
15106
15107 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15108
15109         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15110         property code.
15111
15112 2004-06-23  Martin Baulig  <martin@ximian.com>
15113
15114         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15115         neither return nor throw, reset the barrier as well.  Fixes #60457.
15116
15117 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15118
15119         * class.cs : EventAttributes is now set to None by default.
15120           This fixes bug #60459.
15121
15122 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15123
15124         Fix bug #60219
15125         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15126         Don't throw exception but return null (it's sufficient now).
15127
15128 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15129
15130         * typemanager.cs (GetArgumentTypes): Faster implementation.
15131
15132 2004-06-18  Martin Baulig  <martin@ximian.com>
15133
15134         * attribute.cs (Attribute.Resolve): Check whether we're an
15135         EmptyCast which a Constant child.  Fixes #60333.
15136
15137 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
15138
15139         * statement.cs (EmitCollectionForeach): Account for the fact that
15140         not all valuetypes are in areas which we can take the address of.
15141         For these variables, we store to a temporary variable. Also, make
15142         sure that we dont emit a `callvirt' on a valuetype method.
15143
15144 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15145
15146         * expression.cs (StackAlloc.DoReSolve): Added test for
15147         negative parameter (CS0247).
15148
15149 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15150
15151         Fix bug #59792
15152         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15153
15154 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15155
15156         Fix bug #59781
15157         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15158         ulong.
15159
15160 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15161
15162         Fix bug #58254 & cs1555.cs, cs1556.cs
15163         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15164
15165 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15166
15167         * cs-parser.jay: Added error CS1669 test for indexers.
15168
15169 2004-06-11  Martin Baulig  <martin@ximian.com>
15170
15171         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15172         call this twice: for params and varargs methods.
15173
15174 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15175
15176         * class.cs:
15177         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15178
15179 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15180
15181         * attribute.cs (Attribute.GetValidTargets): Made public.
15182
15183         * class.cs: 
15184         (AbstractPropertyEventMethod): New class for better code sharing.
15185         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15186         CS1667 report.
15187         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15188
15189 2004-06-11  Raja R Harinath  <rharinath@novell.com>
15190
15191         Fix bug #59477.
15192         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15193         that the call to Resolve is part of a MemberAccess.
15194         (Expression.Resolve): Use it for SimpleName resolution.
15195         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15196         Add 'intermediate' boolean argument.
15197         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
15198         error message when the SimpleName can be resolved ambiguously
15199         between an expression and a type.
15200         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15201         public.
15202         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15203         call on the left-side.
15204
15205 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15206
15207         * class.cs:
15208         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15209
15210 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15211
15212         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15213
15214 2004-06-11  Martin Baulig  <martin@ximian.com>
15215
15216         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15217         varargs methods if applicable.
15218
15219 2004-06-11  Martin Baulig  <martin@ximian.com>
15220
15221         * expression.cs (Invocation.EmitCall): Don't use
15222         `method.CallingConvention == CallingConventions.VarArgs' since the
15223         method could also have `CallingConventions.HasThis'.
15224
15225 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15226
15227         * class.cs (Event.GetSignatureForError): Implemented.
15228         Fixed crash in error test cs3010.cs
15229
15230 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * cs-tokenizer.cs: Change the way we track __arglist to be
15233         consistent with the other keywords.
15234
15235 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
15236
15237         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15238         tomorrow.
15239
15240 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
15241
15242         * codegen.cs: Check that all referenced assemblies have a strongname
15243         before strongnaming the compiled assembly. If not report error CS1577.
15244         Fix bug #56563. Patch by Jackson Harper.
15245         * typemanager.cs: Added a method to return all referenced assemblies.
15246         Fix bug #56563. Patch by Jackson Harper.
15247
15248 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15249
15250         * class.cs:
15251         (Method.ApplyAttributeBuilder): Moved and added conditional
15252         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15253
15254         * delegate.cs:
15255         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15256
15257 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15258
15259         Fixed #59640
15260         * class.cs: (EventField.attribute_targets): Changed default target.
15261
15262 2004-06-08  Martin Baulig  <martin@ximian.com>
15263
15264         * expression.cs (Invocation.EmitCall): Enable varargs methods.
15265
15266 2004-06-08  Martin Baulig  <martin@ximian.com>
15267
15268         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15269
15270 2004-06-07  Martin Baulig  <martin@ximian.com>
15271
15272         Added support for varargs methods.
15273
15274         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15275         keyword.
15276
15277         * cs-parser.jay: Added support for `__arglist'.
15278
15279         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15280
15281         * expression.cs (Argument.AType): Added `ArgList'.
15282         (Invocation): Added support for varargs methods.
15283         (ArglistAccess): New public class.
15284         (Arglist): New public class.
15285
15286         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15287
15288         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
15289         a method's top-level block if the method has varargs.
15290
15291         * support.cs (ReflectionParameters, InternalParameters): Added
15292         support for varargs methods.    
15293
15294 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * class.cs: Provide location in indexer error report.
15297
15298         * driver.cs: Use standard names.
15299
15300         * namespace.cs: Catch the use of using after a namespace has been
15301         declared also on using aliases.
15302
15303 2004-06-03  Raja R Harinath  <rharinath@novell.com>
15304
15305         Bug #50820.
15306         * typemanager.cs (closure_private_ok, closure_invocation_type)
15307         (closure_qualifier_type, closure_invocation_assembly)
15308         (FilterWithClosure): Move to ...
15309         (Closure): New internal nested class.
15310         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15311         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15312         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15313         (MemberLookup, MemberLookupFailed): Use it.
15314         * expression.cs (New.DoResolve): Treat the lookup for the
15315         constructor as being qualified by the 'new'ed type.
15316         (Indexers.GetIndexersForTypeOrInterface): Update.
15317
15318 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
15319
15320         * attribute.cs
15321         (GetConditionalAttributeValue): New method. Returns
15322         condition of ConditionalAttribute.
15323         (SearchMulti): New method.  Returns all attributes of type 't'.
15324         Use it when attribute is AllowMultiple = true.
15325         (IsConditionalMethodExcluded): New method.
15326
15327         * class.cs
15328         (Method.IsExcluded): Implemented. Returns true if method has conditional
15329         attribute and the conditions is not defined (method is excluded).
15330         (IMethodData): Extended interface for ConditionalAttribute support.
15331         (PropertyMethod.IsExcluded): Implemented.
15332
15333         * decl.cs
15334         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15335
15336         * expression.cs
15337         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15338         on the method.
15339
15340 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15341
15342         * expression.cs (ArrayCreationExpression): Make this just an
15343         `expression'. It can't be a statement, so the code here was
15344         dead.
15345
15346 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15347
15348         Fixed #59072
15349         * typemanager.cs (GetFullNameSignature): New method for
15350         MethodBase types.
15351
15352 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15353
15354         Fixed #56452
15355         * class.cs (MemberBase.GetSignatureForError): New virtual method.
15356         Use this method when MethodBuilder is null.
15357         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15358         Added test for error CS0626 (MONO reports error for this situation).
15359         (IMethodData.GetSignatureForError): Extended interface.
15360
15361 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15362
15363         * attribute.cs
15364         (AttributeTester.GetObsoleteAttribute): Returns instance of
15365         ObsoleteAttribute when type is obsolete.
15366
15367         * class.cs
15368         (TypeContainer.VerifyObsoleteAttribute): Override.
15369         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15370         (MethodCode.VerifyObsoleteAttribute): Override.
15371         (MemberBase.VerifyObsoleteAttribute): Override.
15372
15373         * decl.cs
15374         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15375         and report proper error.
15376
15377         *delegate.cs
15378         Delegate.VerifyObsoleteAttribute): Override.
15379
15380         * ecore.cs
15381         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15382         and report proper error.
15383         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15384
15385         * enum.cs
15386         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15387         and enum member.
15388
15389         * expression.cs
15390         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15391         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15392         Added test for ObsoleteAttribute.
15393
15394         * statement.cs
15395         (Catch): Derived from Statement.
15396
15397 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15398  
15399         Fixed bug #59071 & cs0160.cs
15400  
15401         * statement.cs (Try.Resolve): Check here whether order of catch
15402         clauses matches their dependencies.
15403
15404 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
15405
15406         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
15407         caused a regression: #59343.  Referencing nested classes from an
15408         assembly stopped working.
15409
15410 2004-05-31  Martin Baulig  <martin@ximian.com>
15411
15412         MCS is now frozen for beta 2.
15413
15414 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15415
15416         * convert.cs: add a trivial cache for overload operator resolution.
15417
15418 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15419
15420         * decl.cs: If possible, use lookuptypedirect here. We can only do
15421         this if there is no `.' after the namespace. Avoids using
15422         LookupType, which does lots of slow processing.
15423         (FindNestedType) New method, does what it says :-).
15424         * namespace.cs: use LookupTypeDirect.
15425         * rootcontext.cs: use membercache, if possible.
15426         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15427
15428 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15429
15430         * expression.cs:
15431         According to the spec, 
15432
15433         In a member access of the form E.I, if E is a single identifier,
15434         and if the meaning of E as a simple-name (§7.5.2) is a constant,
15435         field, property, localvariable, or parameter with the same type as
15436         the meaning of E as a type-name (§3.8), then both possible
15437         meanings of E are permitted.
15438
15439         We did not check that E as a simple-name had the same type as E as
15440         a type name.
15441
15442         This trivial check gives us 5-7% on bootstrap time.
15443
15444 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15445
15446         * expression.cs (Invocation.OverloadResolve): Avoid the
15447         use of hashtables and boxing here by allocating on demand.
15448
15449 2004-05-30  Martin Baulig  <martin@ximian.com>
15450
15451         * rootcontext.cs (RootContext.LookupType): Don't cache things if
15452         we're doing a silent lookup.  Don't try to lookup nested types in
15453         TypeManager.object_type (thanks to Ben Maurer).
15454
15455 2004-05-30  Martin Baulig  <martin@ximian.com>
15456
15457         Committing a patch from Ben Maurer.
15458
15459         * rootcontext.cs (RootContext.LookupType): Cache negative results.
15460
15461 2004-05-29  Martin Baulig  <martin@ximian.com>
15462
15463         * class.cs (IMethodData.ShouldIgnore): New method.
15464
15465         * typemanager.cs (TypeManager.MethodFlags): Don't take a
15466         `Location' argument, we don't need it anywhere.  Use
15467         `IMethodData.ShouldIgnore ()' instead of
15468         `MethodData.GetMethodFlags ()'.
15469         (TypeManager.AddMethod): Removed.
15470         (TypeManager.AddMethod2): Renamed to AddMethod.
15471
15472 2004-05-29  Martin Baulig  <martin@ximian.com>
15473
15474         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15475
15476         * convert.cs (Convert.ImplicitReferenceConversion): If we're
15477         converting from a class type S to an interface type and we already
15478         have an object on the stack, don't box it again.  Fixes #52578.
15479
15480 2004-05-29  Martin Baulig  <martin@ximian.com>
15481
15482         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15483         Added support for `params' parameters.  Fixes #59267.
15484
15485 2004-05-29  Martin Baulig  <martin@ximian.com>
15486
15487         * literal.cs (NullPointer): Provide a private .ctor which sets
15488         `type' to TypeManager.object_type.  Fixes #59048.
15489
15490 2004-05-29  Martin Baulig  <martin@ximian.com>
15491
15492         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
15493         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
15494
15495         * ecore.cs (EventExpr.instance_expr): Make the field private.
15496
15497 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
15498
15499         Fixed bug #50080 & cs0214-2.cs
15500         * expression.cs (Cast.DoResolve): Check unsafe context here.
15501         
15502         * statement.cs (Resolve.DoResolve): Likewise.
15503
15504 2004-05-26  Martin Baulig  <martin@ximian.com>
15505
15506         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
15507
15508         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
15509         (RootContext.LookupType): Pass down the `silent' flag.
15510
15511 2004-05-25  Martin Baulig  <martin@ximian.com>
15512
15513         * expression.cs
15514         (MethodGroupExpr.IdenticalTypeName): New public property.
15515         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
15516         expression actually refers to a type.
15517
15518 2004-05-25  Martin Baulig  <martin@ximian.com>
15519
15520         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
15521         for #56176 and made it actually work.
15522
15523 2004-05-25  Martin Baulig  <martin@ximian.com>
15524
15525         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
15526         (FieldExpr, PropertyExpr): Override and implement
15527         CacheTemporaries.  Fixes #52279.
15528
15529 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * location.cs: In the new compiler listing a file twice is a
15532         warning, not an error.
15533
15534 2004-05-24  Martin Baulig  <martin@ximian.com>
15535
15536         * enum.cs (Enum.DefineType): For the `BaseType' to be a
15537         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
15538
15539 2004-05-24  Martin Baulig  <martin@ximian.com>
15540
15541         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
15542         walking the `using' list.  Fixes #53921.
15543
15544 2004-05-24  Martin Baulig  <martin@ximian.com>
15545
15546         * const.cs (Const.LookupConstantValue): Added support for
15547         EmptyCast's; fixes #55251.
15548
15549 2004-05-24  Martin Baulig  <martin@ximian.com>
15550
15551         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
15552         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
15553         which does the CS0135 check.  The reason is that we first need to
15554         check whether the variable actually exists.
15555
15556 2004-05-24  Martin Baulig  <martin@ximian.com>
15557
15558         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
15559         than RootContext.LookupType() to find the explicit interface
15560         type.  Fixes #58584.
15561
15562 2004-05-24  Raja R Harinath  <rharinath@novell.com>
15563
15564         * Makefile: Simplify.  Use executable.make.
15565         * mcs.exe.sources: New file.  List of sources of mcs.exe.
15566
15567 2004-05-24  Anders Carlsson  <andersca@gnome.org>
15568
15569         * decl.cs:
15570         * enum.cs:
15571         Use the invariant culture when doing String.Compare for CLS case
15572         sensitivity.
15573         
15574 2004-05-23  Martin Baulig  <martin@ximian.com>
15575
15576         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
15577         don't have any dots.  Fixes #52622, added cs0246-8.cs.
15578
15579         * namespace.cs (NamespaceEntry.Lookup): Likewise.
15580         
15581 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
15582
15583         * class.cs (MemberBase.Define): Reuse MemberType member for 
15584         resolved type. Other methods can use it too.
15585
15586 2004-05-23  Martin Baulig  <martin@ximian.com>
15587
15588         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
15589         the variable also exists in the current block (otherwise, we need
15590         to report a CS0103).  Fixes #58670.
15591
15592 2004-05-23  Martin Baulig  <martin@ximian.com>
15593
15594         * flowanalysis.cs (Reachability.Reachable): Compute this
15595         on-the-fly rather than storing it as a field.
15596
15597 2004-05-23  Martin Baulig  <martin@ximian.com>
15598
15599         * flowanalysis.cs (Reachability.And): Manually compute the
15600         resulting `barrier' from the reachability.      
15601        
15602 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
15603
15604         Fix bug #57835
15605         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
15606         instance of ObsoleteAttribute when symbol is obsolete.
15607
15608         * class.cs
15609         (IMethodData): Extended interface for ObsoleteAttribute support.
15610
15611 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
15612
15613         * attribute.cs: Fix bug #55970
15614
15615 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
15616
15617         Fix bug #52705
15618         * attribute.cs
15619         (GetObsoleteAttribute): New method. Creates the instance of
15620         ObsoleteAttribute.
15621         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
15622         ObsoleteAttribute when member is obsolete.
15623         (AttributeTester.Report_ObsoleteMessage): Common method for
15624         Obsolete error/warning reporting.
15625
15626         * class.cs
15627         (TypeContainer.base_classs_type): New member for storing parent type.
15628
15629         * decl.cs
15630         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
15631         for this MemberCore.
15632
15633 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15634
15635         * attribute.cs, const.cs: Fix bug #58590
15636
15637 2004-05-21  Martin Baulig  <martin@ximian.com>
15638
15639         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
15640         out parameters if the end of the method is unreachable.  Fixes
15641         #58098. 
15642
15643 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15644
15645         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
15646         Hari was right, why extra method.
15647
15648 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15649
15650         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
15651
15652 2004-05-20  Martin Baulig  <martin@ximian.com>
15653
15654         Merged this back from gmcs to keep the differences to a minumum.
15655
15656         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
15657         instead of a Declspace.
15658         (Attribute.ResolveType): Likewise.
15659         (Attributes.Search): Likewise.
15660         (Attributes.Contains): Likewise.
15661         (Attributes.GetClsCompliantAttribute): Likewise.
15662
15663         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
15664         argument.
15665         (MethodData.ApplyAttributes): Take an EmitContext instead of a
15666         DeclSpace.
15667
15668 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
15669
15670         Fix bug #58688 (MCS does not report error when the same attribute
15671         is assigned twice)
15672
15673         * attribute.cs (Attribute.Emit): Distinction between null and default.
15674
15675 2004-05-19  Raja R Harinath  <rharinath@novell.com>
15676
15677         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
15678         of a top-level attribute without an attribute target.
15679         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
15680         Make non-static.
15681         (Attribute.Conditional_GetConditionName), 
15682         (Attribute.Obsolete_GetObsoleteMessage): Update.
15683         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
15684         part of ScanForIndexerName.
15685         (Attribute.CanIgnoreInvalidAttribute): New function.
15686         (Attribute.ScanForIndexerName): Move to ...
15687         (Attributes.ScanForIndexerName): ... here.
15688         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
15689         (Attributes.Search): New internal variant that can choose not to
15690         complain if types aren't resolved.  The original signature now
15691         complains.
15692         (Attributes.GetClsCompliantAttribute): Use internal variant, with
15693         complaints suppressed.
15694         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
15695         only if it not useful.
15696         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
15697         top-level for attributes that are shared between the assembly
15698         and a top-level class.
15699         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
15700         * class.cs: Update to reflect changes.
15701         (DefineIndexers): Fuse loops.
15702         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
15703         a couple more variants of attribute names.
15704
15705 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
15706
15707         Fix bug #52585 (Implemented explicit attribute declaration)
15708
15709         * attribute.cs:
15710         (Attributable.ValidAttributeTargets): New abstract method. It gets
15711         list of valid attribute targets for explicit target declaration.
15712         (Attribute.Target): It holds target itself.
15713         (AttributeSection): Removed.
15714         (Attribute.CheckTargets): New method. It checks whether attribute
15715         target is valid for the current element.
15716
15717         * class.cs:
15718         (EventProperty): New class. For events that are declared like
15719         property (with add and remove accessors).
15720         (EventField): New class. For events that are declared like field.
15721         class.cs
15722
15723         * cs-parser.jay: Implemented explicit attribute target declaration.
15724
15725         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
15726         Override ValidAttributeTargets.
15727
15728         * parameter.cs:
15729         (ReturnParameter): Class for applying custom attributes on 
15730         the return type.
15731         (ParameterAtribute): New class. Class for applying custom
15732         attributes on the parameter type.
15733
15734 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
15735
15736         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
15737         definitions. 
15738
15739         (Method): Allow UNSAFE here.
15740
15741         * modifiers.cs: Support unsafe reporting.
15742
15743 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
15744
15745         * decl.cs: Fix bug #58478.
15746
15747 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15748
15749         * statement.cs: When checking for unreachable code on an EmptyStatement,
15750         set the location. Fixes bug #58488.
15751
15752 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
15753
15754         * driver.cs: Add -pkg handling.
15755
15756         From Gonzalo: UseShelLExecute=false
15757
15758 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
15759
15760         * attribute.cs:
15761         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
15762         for attribute.
15763         (Attribute.IsClsCompliaceRequired): Moved to base for better
15764         accesibility.
15765         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
15766         when attribute is AttributeUsageAttribute.
15767         (Attribute.GetValidTargets): Simplified.
15768         (Attribute.GetAttributeUsage): New method returns AttributeUsage
15769         attribute for this type.
15770         (Attribute.ApplyAttributes): Method renamed to Emit and make
15771         non-static.
15772         (GlobalAttributeSection): New class for special handling of global
15773         attributes (assembly, module).
15774         (AttributeSection.Emit): New method.
15775
15776         * class.cs: Implemented Attributable abstract methods.
15777         (MethodCore.LabelParameters): Moved to Parameter class.
15778         (Accessor): Is back simple class.
15779         (PropertyMethod): Implemented Attributable abstract class.
15780         (DelegateMethod): Implemented Attributable abstract class.
15781         (Event): New constructor for disctintion between normal Event
15782         and Event with accessors.
15783
15784         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
15785
15786         * codegen.cs, const.cs, decl.cs, delegate.cs:
15787         (CommonAssemblyModulClass): Implemented Attributable abstract class
15788         and simplified.
15789
15790         * enum.cs: Implement IAttributeSupport interface.
15791         (EnumMember): New class for emum members. Implemented Attributable
15792         abstract class
15793
15794         * parameter.cs:
15795         (ParameterBase): Is abstract.
15796         (ReturnParameter): New class for easier [return:] attribute handling.
15797
15798         * typemanager.cs: Removed builder_to_attr.
15799
15800 2004-05-11  Raja R Harinath  <rharinath@novell.com>
15801
15802         Fix bug #57151.
15803         * attribute.cs (Attribute.GetPositionalValue): New function.
15804         * class.cs (TypeContainer.VerifyMembers): New function.
15805         (TypeContainer.Emit): Use it.
15806         (ClassOrStruct): New base class for Class and Struct.
15807         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
15808         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
15809         class.
15810         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
15811         then each non-static field should have a FieldOffset attribute.
15812         Otherwise, none of the fields should have a FieldOffset attribute.
15813         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
15814         and FieldOffset attributes.
15815         * typemanager.cs (TypeManager.struct_layout_attribute_type)
15816         (TypeManager.field_offset_attribute_type): New core types.
15817         (TypeManager.InitCoreTypes): Initialize them.
15818
15819 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
15820
15821         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
15822         Return correct type.
15823         From bug #58270.
15824
15825 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
15828         be implicitly converted to ulong.
15829         
15830         * expression.cs: The logic for allowing operator &, | and ^ worked
15831         was wrong, it worked before because we did not report an error in
15832         an else branch.  Fixes 57895.
15833
15834         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
15835         allow volatile fields to be reference types.
15836
15837 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
15838
15839         * driver.cs: Add support for /debug-
15840
15841 2004-05-07  Raja R Harinath  <rharinath@novell.com>
15842
15843         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
15844         Add a 'complain' parameter to silence errors.
15845         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
15846         silently overlooked type-resolutions.
15847         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
15848         to reflect changes.
15849         (Attributes.Search): New function.
15850         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
15851         (Attributes.GetAttributeFullName): Remove hack.
15852         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
15853         Update to reflect changes.
15854         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15855         Use Attributes.Search instead of nested loops.
15856
15857 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
15858
15859         * decl.cs:
15860         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
15861         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
15862         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
15863
15864         * report.cs: (Report.Warning): Renamed to Warning_T because of
15865         parameter collision.
15866
15867 2004-05-05  Raja R Harinath  <rharinath@novell.com>
15868
15869         * expression.cs (MemberAccess.ResolveMemberAccess):
15870         Exit with non-zero status after Report.Error.
15871         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
15872         Likewise.
15873         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
15874
15875 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
15876
15877         * support.cs: Don't hang when the file is empty.
15878
15879 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
15880
15881         * support.cs: In SeekableStreamReader, compute the preamble size of the
15882           underlying stream. Position changes should take into account that initial
15883           count of bytes.
15884
15885 2004-05-03  Todd Berman  <tberman@sevenl.net>
15886
15887         * driver.cs: remove unused GetSysVersion function.
15888
15889 2004-05-03  Todd Berman  <tberman@sevenl.net>
15890
15891         * driver.cs: Remove the hack from saturday, as well as the hack
15892         from jackson (LoadAssemblyFromGac), also adds the CWD to the
15893         link_paths to get that bit proper.
15894
15895 2004-05-01  Todd Berman  <tberman@sevenl.net>
15896
15897         * driver.cs: Try a LoadFrom before a Load, this checks the current
15898         path. This is currently a bug in mono that is be fixed, however, this
15899         provides a workaround for now. This will be removed when the bug
15900         is fixed.
15901
15902 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
15903
15904         * CryptoConvert.cs: Updated to latest version. Fix issue with 
15905         incomplete key pairs (#57941).
15906
15907 2004-05-01  Todd Berman  <tberman@sevenl.net>
15908
15909         * driver.cs: Remove '.' from path_chars, now System.* loads properly
15910         from the GAC
15911
15912 2004-04-30  Jackson Harper  <jackson@ximian.com>
15913
15914         * codegen.cs: Open keys readonly.
15915         
15916 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15917
15918         * typemanager.cs: don't report cyclic struct layout when a struct
15919         contains 2 or more fields of the same type. Failed for Pango.AttrShape
15920         which has 2 Pango.Rectangle fields.
15921
15922 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15923
15924         * expression.cs: Handle IntPtr comparisons with IL code
15925         rather than a method call.
15926
15927 2004-04-29  Martin Baulig  <martin@ximian.com>
15928
15929         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
15930         the list of PropertyInfo's in class hierarchy and find the
15931         accessor.  Fixes #56013.
15932
15933 2004-04-29  Martin Baulig  <martin@ximian.com>
15934
15935         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
15936
15937 2004-04-29  Martin Baulig  <martin@ximian.com>
15938
15939         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15940
15941         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15942
15943 2004-04-29  Martin Baulig  <martin@ximian.com>
15944
15945         * class.cs (ConstructorInitializer.Resolve): Check whether the
15946         parent .ctor is accessible.  Fixes #52146.
15947
15948 2004-04-29  Martin Baulig  <martin@ximian.com>
15949
15950         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15951
15952         * statement.cs (Using.EmitLocalVariableDecls): Use
15953         TypeManager.idisposable_type, not typeof (IDisposable).
15954         (Foreach.EmitCollectionForeach): Added support for valuetypes.
15955
15956 2004-04-29  Martin Baulig  <martin@ximian.com>
15957
15958         * class.cs (Event.Define): Don't emit the field and don't set
15959         RTSpecialName and SpecialName for events on interfaces.  Fixes
15960         #57703. 
15961
15962 2004-04-29  Raja R Harinath  <rharinath@novell.com>
15963
15964         Refactor Attribute.ApplyAttributes.
15965         * attribute.cs (Attributable): New base class for objects that can
15966         have Attributes applied on them.
15967         (Attribute): Make AttributeUsage fields public.
15968         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15969         (Attribute.IsInternalCall): New property.
15970         (Attribute.UsageAttr): Convert to a public read-only property.
15971         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15972         (Attribute.ResolveType, Attribute.Resolve)
15973         (Attribute.ScanForIndexerName): Update to reflect changes.
15974         (Attribute.CheckAttributeTarget): Re-format.
15975         (Attribute.ApplyAttributes): Refactor, to various
15976         Attributable.ApplyAttributeBuilder methods.
15977         * decl.cs (MemberCore): Make Attributable.
15978         * class.cs (Accessor): Make Attributable.
15979         (MethodData.ApplyAttributes): Use proper attribute types, not
15980         attribute names.
15981         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15982         (TypeContainer.ApplyAttributeBuilder)
15983         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15984         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
15985         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15986         (Operator.ApplyAttributeBuilder): New factored-out methods.
15987         * const.cs (Const.ApplyAttributeBuilder): Likewise.
15988         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15989         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15990         * parameter.cs (ParameterBase): New Attributable base class
15991         that can also represent Return types.
15992         (Parameter): Update to the changes.
15993
15994 2004-04-29  Jackson Harper  <jackson@ximian.com>
15995
15996         * driver.cs: Prefer the corlib system version when looking for
15997         assemblies in the GAC. This is still a hack, but its a better hack
15998         now.
15999         
16000 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16001
16002         * decl.cs, enum.cs: Improved error 3005 reporting.
16003   
16004         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16005         (related_symbols): New private member for list of symbols
16006         related to reported error/warning.
16007         
16008         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16009
16010 2004-04-29  Martin Baulig  <martin@ximian.com>
16011
16012         * ecore.cs (Expression.Constantify): If we're an enum and
16013         TypeManager.TypeToCoreType() doesn't give us another type, use
16014         t.UnderlyingSystemType.  Fixes #56178.  
16015
16016 2004-04-29  Martin Baulig  <martin@ximian.com>
16017
16018         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16019         interfaces and for each interface, only add members directly
16020         declared in that interface.  Fixes #53255.
16021
16022 2004-04-28  Martin Baulig  <martin@ximian.com>
16023
16024         * expression.cs (ConditionalLogicalOperator): Use a temporary
16025         variable for `left' to avoid that we evaluate it more than once;
16026         bug #52588.
16027
16028 2004-04-28  Martin Baulig  <martin@ximian.com>
16029
16030         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16031         `void[]' (CS1547).
16032
16033 2004-04-28  Martin Baulig  <martin@ximian.com>
16034
16035         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16036         void (CS1547).
16037
16038         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16039         whether the type is not void (CS1547).
16040
16041 2004-04-28  Martin Baulig  <martin@ximian.com>
16042
16043         * expression.cs (Unary.DoResolveLValue): Override this and report
16044         CS0131 for anything but Operator.Indirection.
16045
16046 2004-04-28  Martin Baulig  <martin@ximian.com>
16047
16048         Committing a patch from Ben Maurer; see bug #50820.
16049
16050         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16051         check for classes.
16052
16053         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16054         classes.        
16055
16056 2004-04-28  Martin Baulig  <martin@ximian.com>
16057
16058         Committing a patch from Ben Maurer; see bug #50820.
16059
16060         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16061         check for classes.
16062
16063         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16064         classes.        
16065
16066 2004-04-28  Martin Baulig  <martin@ximian.com>
16067
16068         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16069         (Block.AddLabel): Call DoLookupLabel() to only search in the
16070         current block.
16071
16072 2004-04-28  Martin Baulig  <martin@ximian.com>
16073
16074         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16075         comparing StringConstants and NullLiterals in Equality and Inequality.
16076
16077 2004-04-28  Jackson Harper  <jackson@ximian.com>
16078
16079         * driver.cs: Attempt to load referenced assemblies from the
16080         GAC. This is the quick and dirty version of this method that
16081         doesnt take into account versions and just takes the first
16082         canidate found. Will be good enough for now as we will not have more
16083         then one version installed into the GAC until I update this method.
16084
16085 2004-04-28  Martin Baulig  <martin@ximian.com>
16086
16087         * typemanager.cs (TypeManager.CheckStructCycles): New public
16088         static method to check for cycles in the struct layout.
16089
16090         * rootcontext.cs (RootContext.PopulateTypes): Call
16091         TypeManager.CheckStructCycles() for each TypeContainer.
16092         [Note: We only need to visit each type once.]
16093
16094 2004-04-28  Martin Baulig  <martin@ximian.com>
16095
16096         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16097
16098         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16099         success and added `out object value'.  Use a `bool resolved' field
16100         to check whether we've already been called rather than
16101         `ConstantValue != null' since this breaks for NullLiterals.
16102
16103 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16104
16105         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16106         setting of this flag, since the 'set' method may be non-public.
16107
16108 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16109
16110         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16111         check on current_vector.Block.
16112
16113 2004-04-27  Martin Baulig  <martin@ximian.com>
16114
16115         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16116         a field initializer.  Fixes #56459.
16117
16118 2004-04-27  Martin Baulig  <martin@ximian.com>
16119
16120         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16121         we're not attempting to use an indexer.  Fixes #52154.
16122
16123 2004-04-27  Martin Baulig  <martin@ximian.com>
16124
16125         * statement.cs (Return): Don't create a return label if we don't
16126         need it; reverts my change from January 20th.  Thanks to Ben
16127         Maurer for this.
16128
16129 2004-04-27  Martin Baulig  <martin@ximian.com>
16130
16131         According to the spec, `goto' can only leave a nested scope, but
16132         never enter it.
16133
16134         * statement.cs (Block.LookupLabel): Only lookup in the current
16135         block, don't recurse into parent or child blocks.
16136         (Block.AddLabel): Check in parent and child blocks, report
16137         CS0140/CS0158 if we find a duplicate.
16138         (Block): Removed this indexer for label lookups.
16139         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16140         this already does the error reporting for us.
16141
16142         * flowanalysis.cs
16143         (FlowBranching.UsageVector.Block): New public variable; may be null.
16144         (FlowBranching.CreateSibling): Added `Block' argument.
16145         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
16146         label for the target of a `goto' and check whether we're not
16147         leaving a `finally'.
16148
16149 2004-04-27  Martin Baulig  <martin@ximian.com>
16150
16151         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16152         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16153         just for returns).
16154
16155 2004-04-27  Martin Baulig  <martin@ximian.com>
16156
16157         * statement.cs (Block.AddLabel): Also check for implicit blocks
16158         and added a CS0158 check.
16159
16160 2004-04-27  Martin Baulig  <martin@ximian.com>
16161
16162         * flowanalysis.cs (FlowBranchingLoop): New class.
16163         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16164         UsageVector's instead of an ArrayList.
16165         (FlowBranching.Label): Likewise.
16166         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16167         (FlowBranching.AddBreakVector): New method.
16168
16169 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
16170
16171         * attribute.cs: Small regression fix: only convert the type if we
16172         the type is different, fixes System.Drawing build.
16173
16174 2004-04-27  Martin Baulig  <martin@ximian.com>
16175
16176         * attribute.cs (Attribute.Resolve): If we have a constant value
16177         for a named field or property, implicity convert it to the correct
16178         type.
16179
16180 2004-04-27  Raja R Harinath  <rharinath@novell.com>
16181
16182         * statement.cs (Block.Block): Implicit blocks share
16183         'child_variable_names' fields with parent blocks.
16184         (Block.AddChildVariableNames): Remove.
16185         (Block.AddVariable): Mark variable as "used by a child block" in
16186         every surrounding block.
16187         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16188         been used in a child block, complain about violation of "Invariant
16189         meaning in blocks" rule.
16190         * cs-parser.jay (declare_local_variables): Don't use
16191         AddChildVariableNames.
16192         (foreach_statement): Don't create an implicit block: 'foreach'
16193         introduces a scope.
16194
16195 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
16196
16197         * convert.cs (ImplicitNumericConversion): 0 is also positive when
16198         converting from 0L to ulong.  Fixes 57522.
16199
16200 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16201
16202         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16203         derived class hides via 'new' keyword field from base class (test-242.cs).
16204         TODO: Handle this in the more general way.
16205         
16206         * class.cs (CheckBase): Ditto.
16207
16208 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16209
16210         * decl.cs (caching_flags): New member for storing cached values
16211         as bit flags.
16212         (MemberCore.Flags): New enum where bit flags for caching_flags
16213         are defined.
16214         (MemberCore.cls_compliance): Moved to caching_flags.
16215         (DeclSpace.Created): Moved to caching_flags.
16216
16217         * class.cs: Use caching_flags instead of DeclSpace.Created
16218         
16219 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
16220
16221         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16222         if we are only a derived class, not a nested class.
16223
16224         * typemanager.cs: Same as above, but do this at the MemberLookup
16225         level (used by field and methods, properties are handled in
16226         PropertyExpr).   Allow for the qualified access if we are a nested
16227         method. 
16228
16229 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
16230
16231         * class.cs: Refactoring.
16232         (IMethodData): New inteface; Holds links to parent members
16233         to avoid member duplication (reduced memory allocation).
16234         (Method): Implemented IMethodData interface.
16235         (PropertyBase): New inner classes for get/set methods.
16236         (PropertyBase.PropertyMethod): Implemented IMethodData interface
16237         (Event): New inner classes for add/remove methods.
16238         (Event.DelegateMethod): Implemented IMethodData interface.
16239
16240         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16241         EmitContext (related to class.cs refactoring).
16242
16243 2004-04-21  Raja R Harinath  <rharinath@novell.com>
16244
16245         * delegate.cs (Delegate.VerifyApplicability): If the number of
16246         arguments are the same as the number of parameters, first try to
16247         verify applicability ignoring  any 'params' modifier on the last
16248         parameter.
16249         Fixes #56442.
16250
16251 2004-04-16  Raja R Harinath  <rharinath@novell.com>
16252
16253         * class.cs (TypeContainer.AddIndexer): Use
16254         'ExplicitInterfaceName' to determine if interface name was
16255         explicitly specified.  'InterfaceType' is not initialized at this time.
16256         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
16257         Indexers array is already in the required order.  Initialize
16258         'IndexerName' only if there are normal indexers.
16259         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16260         (TypeContainer.Emit): Emit DefaultMember attribute only if
16261         IndexerName is initialized.
16262         Fixes #56300.
16263
16264 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
16265
16266         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16267         Fixes #57007
16268
16269 2004-04-15  Raja R Harinath  <rharinath@novell.com>
16270
16271         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16272         attributes.
16273         Fix for #56456.
16274
16275         * attribute.cs (Attribute.Resolve): Check for duplicate named
16276         attributes.
16277         Fix for #56463.
16278
16279 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
16280
16281         * iterators.cs (MarkYield): track whether we are in an exception,
16282         and generate code accordingly.  Use a temporary value to store the
16283         result for our state.
16284
16285         I had ignored a bit the interaction of try/catch with iterators
16286         since their behavior was not entirely obvious, but now it is
16287         possible to verify that our behavior is the same as MS .NET 2.0
16288
16289         Fixes 54814
16290
16291 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
16292
16293         * iterators.cs: Avoid creating temporaries if there is no work to
16294         do. 
16295
16296         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16297         Enumerations, use TypeManager.EnumToUnderlying and call
16298         recursively. 
16299
16300         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16301         bug #57013
16302
16303         (This.Emit): Use EmitContext.EmitThis to emit our
16304         instance variable.
16305
16306         (This.EmitAssign): Ditto.
16307
16308         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16309         codepaths, we will move all the functionality into
16310         Mono.CSharp.This 
16311
16312         (FieldExpr.EmitAssign): Ditto.
16313
16314         This fixes several hidden bugs that I uncovered while doing a code
16315         review of this today.
16316
16317         * codegen.cs (EmitThis): reworked so the semantics are more clear
16318         and also support value types "this" instances.
16319
16320         * iterators.cs: Changed so that for iterators in value types, we
16321         do not pass the value type as a parameter.  
16322
16323         Initialization of the enumerator helpers is now done in the caller
16324         instead of passing the parameters to the constructors and having
16325         the constructor set the fields.
16326
16327         The fields have now `assembly' visibility instead of private.
16328
16329 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
16330
16331         * expression.cs (Argument.Resolve): Check if fields passed as ref
16332         or out are contained in a MarshalByRefObject.
16333
16334         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16335         another compiler type.
16336
16337 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16338
16339         * class.cs (Indexer.Define): use the new name checking method.
16340         Also, return false on an error.
16341         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16342         (is_identifier_[start/part]_character): make static.
16343
16344 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
16345
16346         * expression.cs (Binary.ResolveOperator): Do no append strings
16347         twice: since we can be invoked more than once (array evaluation)
16348         on the same concatenation, take care of this here.  Based on a fix
16349         from Ben (bug #56454)
16350
16351 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
16352
16353         * codegen.cs: Fix another case where CS1548 must be reported (when 
16354         delay-sign isn't specified and no private is available #56564). Fix
16355         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
16356         error when MCS is used on the MS runtime and we need to delay-sign 
16357         (which seems unsupported by AssemblyBuilder - see #56621).
16358
16359 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
16360
16361         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16362         (TypeManager.ComputeNamespaces): Faster implementation for
16363         Microsoft runtime.
16364
16365         * compiler.csproj: Updated AssemblyName to mcs.
16366
16367 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * rootcontext.cs: Add new types to the boot resolution.
16370
16371         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16372         MulticastDelegate is not allowed.
16373
16374         * typemanager.cs: Add new types to lookup: System.TypedReference
16375         and ArgIterator.
16376
16377         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16378         check for TypedReference or ArgIterator, they are not allowed. 
16379
16380         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16381         makes us properly catch 1510 in some conditions (see bug 56016 for
16382         details). 
16383
16384 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
16385
16386         * CryptoConvert.cs: update from corlib version
16387         with endian fixes.
16388
16389 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
16390
16391         * class.cs (Indexer.Define): Check indexername declaration
16392
16393 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
16394
16395         * attribute.cs (IsClsCompliant): Fixed problem with handling
16396         all three states (compliant, not-compliant, undetected).
16397
16398 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
16399
16400         * attribute.cs (Attribute): Location is now public.
16401         (Resolve): Store resolved arguments (pos_values) in attribute class.
16402         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16403         (GetClsCompliantAttributeValue): New method that gets
16404         CLSCompliantAttribute value.
16405         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16406         if exists else null.
16407         (AttributeTester): New class for CLS-Compliant verification routines.
16408
16409         * class.cs (Emit): Add CLS-Compliant verification.
16410         (Method.GetSignatureForError): Implemented.
16411         (Constructor.GetSignatureForError): Implemented
16412         (Constructor.HasCompliantArgs): Returns if constructor has
16413         CLS-Compliant arguments.
16414         (Constructor.Emit): Override.
16415         (Construcor.IsIdentifierClsCompliant): New method; For constructors
16416         is needed to test only parameters.
16417         (FieldBase.GetSignatureForError): Implemented.
16418         (TypeContainer): New member for storing base interfaces.
16419         (TypeContainer.FindMembers): Search in base interfaces too.
16420
16421         * codegen.cs (GetClsComplianceAttribute): New method that gets
16422         assembly or module CLSCompliantAttribute value.
16423         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16424         for assembly.
16425         (ModuleClass.Emit): Add error 3012 test.
16426
16427         * const.cs (Emit): Override and call base for CLS-Compliant tests.
16428
16429         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16430         state for all decl types.
16431         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16432         if CLS-Compliant tests are required.
16433         (IsClsCompliaceRequired): New method. Analyze whether code
16434         must be CLS-Compliant.
16435         (IsExposedFromAssembly): New method. Returns true when MemberCore
16436         is exposed from assembly.
16437         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16438         value or gets cached value.
16439         (HasClsCompliantAttribute): New method. Returns true if MemberCore
16440         is explicitly marked with CLSCompliantAttribute.
16441         (IsIdentifierClsCompliant): New abstract method. This method is
16442         used to testing error 3005.
16443         (IsIdentifierAndParamClsCompliant): New method. Common helper method
16444         for identifier and parameters CLS-Compliant testing.
16445         (VerifyClsCompliance): New method. The main virtual method for
16446         CLS-Compliant verifications.
16447         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16448         null. I don't know why is null (too many public members !).
16449         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16450         and get value of first CLSCompliantAttribute that found.
16451
16452         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16453         (VerifyClsCompliance): Override and add extra tests.
16454
16455         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16456         clscheck- disable CLS-Compliant verification event if assembly is has
16457         CLSCompliantAttribute(true).
16458
16459         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16460         ApllyAttribute is now called in emit section as in the other cases.
16461         Possible future Emit integration.
16462         (IsIdentifierClsCompliant): New override.
16463         (VerifyClsCompliance): New override.
16464         (GetEnumeratorName): Returns full enum name.
16465
16466         * parameter.cs (GetSignatureForError): Implemented.
16467
16468         * report.cs (WarningData): New struct for Warning message information.
16469         (LocationOfPreviousError): New method.
16470         (Warning): New method. Reports warning based on the warning table.
16471         (Error_T): New method. Reports error based on the error table.
16472
16473         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16474         verifications are done here.
16475
16476         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16477
16478         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16479         CLSCompliantAttribute.
16480         (all_imported_types): New member holds all imported types from other
16481         assemblies.
16482         (LoadAllImportedTypes): New method fills static table with exported types
16483         from all referenced assemblies.
16484         (Modules): New property returns all assembly modules.
16485
16486 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
16487
16488         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
16489         throwing a parser error.
16490
16491         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
16492         which removes the hardcoded get_/set_ prefixes for properties, as
16493         IL allows for the properties to be named something else.  
16494
16495         Bug #56013
16496
16497         * expression.cs: Do not override operand before we know if it is
16498         non-null.  Fix 56207
16499
16500 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16501
16502         * typemanager.cs: support for pinned variables.
16503
16504 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16505
16506         * decl.cs, typemanager.cs: Avoid using an arraylist
16507         as a buffer if there is only one result set.
16508
16509 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16510
16511         * expression.cs: Make sure you cant call a static method
16512         with an instance expression, bug #56174.
16513
16514 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * class.cs (IsDuplicateImplementation): Improve error reporting to
16517         flag 663 (method only differs in parameter modifier).
16518
16519         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
16520         in preprocessor directives.
16521
16522         * location.cs (LookupFile): Allow for the empty path.
16523
16524         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
16525         better approach for some of that patch, but its failing with the
16526         CharSet enumeration.  For now try/catch will do.
16527
16528         * typemanager.cs: Do not crash if a struct does not have fields.
16529         Fixes 56150.
16530
16531 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16532
16533         * expression.cs: cs0213, cant fix a fixed expression.
16534         fixes 50231.
16535
16536 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16537
16538         * cs-parser.jay: detect invalid embeded statements gracefully.
16539         bug #51113.
16540
16541 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16542
16543         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
16544         As a regex:
16545         s/
16546         the invocation type may not be a subclass of the tye of the item/
16547         The type of the item must be a subclass of the invocation item.
16548         /g
16549
16550         Fixes bug #50820.
16551
16552 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
16553
16554         * attribute.cs: Added methods to get a string and a bool from an
16555         attribute. Required to information from AssemblyKeyFileAttribute,
16556         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
16557         * codegen.cs: Modified AssemblyName creation to include support for
16558         strongnames. Catch additional exceptions to report them as CS1548.
16559         * compiler.csproj: Updated include CryptoConvert.cs.
16560         * compiler.csproj.user: Removed file - user specific configuration.
16561         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
16562         Mono.Security assembly. The original class is maintained and tested in
16563         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
16564         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
16565         like CSC 8.0 (C# v2) supports.
16566         * Makefile: Added CryptoConvert.cs to mcs sources.
16567         * rootcontext.cs: Added new options for strongnames.
16568
16569 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
16570
16571         * driver.cs: For --expect-error, report error code `2'
16572         if the program compiled with no errors, error code `1' if
16573         it compiled with an error other than the one expected.
16574
16575 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
16576
16577         * compiler.csproj: Updated for Visual Studio .NET 2003.
16578         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
16579         * compiler.sln: Updated for Visual Studio .NET 2003.
16580
16581 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
16582
16583         * expression.cs: Fix bug #47234. We basically need to apply the
16584         rule that we prefer the conversion of null to a reference type
16585         when faced with a conversion to 'object' (csc behaviour).
16586
16587 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16588
16589         * statement.cs: Shorter form for foreach, eliminates
16590         a local variable. r=Martin.
16591
16592 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16593
16594         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
16595         checks if we can use brtrue/brfalse to test for 0.
16596         * expression.cs: use the above in the test for using brtrue/brfalse.
16597         cleanup code a bit.
16598
16599 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16600
16601         * expression.cs: Rewrite string concat stuff. Benefits:
16602
16603         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
16604         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
16605         rather than a concat chain.
16606
16607         * typemanager.cs: Add lookups for more concat overloads.
16608
16609 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16610
16611         * expression.cs: Emit shorter il code for array init.
16612
16613         newarr
16614         dup
16615         // set 1
16616
16617         // set 2
16618
16619         newarr
16620         stloc.x
16621
16622         ldloc.x
16623         // set 1
16624
16625         ldloc.x
16626         // set 2
16627
16628 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
16629
16630         * statement.cs: Before, two switch blocks would be merged if the
16631         total size of the blocks (end_item - begin_item + 1) was less than
16632         two times the combined sizes of the blocks.
16633
16634         Now, it will only merge if after the merge at least half of the
16635         slots are filled.
16636
16637         fixes 55885.
16638
16639 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
16640
16641         * class.cs : csc build fix for GetMethods(). See bug #52503.
16642
16643 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
16644
16645         * expression.cs: Make sure fp comparisons work with NaN.
16646         This fixes bug #54303. Mig approved this patch a long
16647         time ago, but we were not able to test b/c the runtime
16648         had a related bug.
16649
16650 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
16651
16652         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
16653
16654 2004-03-19  Martin Baulig  <martin@ximian.com>
16655
16656         * class.cs (MemberCore.IsDuplicateImplementation): Report the
16657         error here and not in our caller.
16658
16659 2004-03-19  Martin Baulig  <martin@ximian.com>
16660
16661         * interface.cs: Completely killed this file.
16662         (Interface): We're now a TypeContainer and live in class.cs.
16663
16664         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
16665         argument; we're now also called for interfaces.
16666         (TypeContainer.DefineMembers): Allow this method being called
16667         multiple times.
16668         (TypeContainer.GetMethods): New public method; formerly known as
16669         Interface.GetMethod().  This is used by PendingImplementation.
16670         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
16671         it's now private and non-static.
16672         (Interface): Moved this here; it's now implemented similar to
16673         Class and Struct.
16674         (Method, Property, Event, Indexer): Added `bool is_interface'
16675         argument to their .ctor's.
16676         (MemberBase.IsInterface): New public field.
16677
16678         * cs-parser.jay: Create normal Method, Property, Event, Indexer
16679         instances instead of InterfaceMethod, InterfaceProperty, etc.
16680         (opt_interface_base): Removed; we now use `opt_class_base' instead.
16681         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
16682
16683 2004-03-19  Martin Baulig  <martin@ximian.com>
16684
16685         * class.cs (MethodCore.IsDuplicateImplementation): New private
16686         method which does the CS0111 checking.
16687         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
16688         Use IsDuplicateImplementation().
16689
16690 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
16691
16692         * decl.cs (FindMemberToOverride): New method to find the correct
16693         method or property to override in the base class.
16694         * class.cs
16695             - Make Method/Property use the above method to find the
16696               version in the base class.
16697             - Remove the InheritableMemberSignatureCompare as it is now
16698               dead code.
16699
16700         This patch makes large code bases much faster to compile, as it is
16701         O(n) rather than O(n^2) to do this validation.
16702
16703         Also, it fixes bug 52458 which is that nested classes are not
16704         taken into account when finding the base class member.
16705
16706         Reviewed/Approved by Martin.
16707
16708 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
16709
16710         * interface.cs: In all interface classes removed redundant
16711         member initialization.
16712
16713 2004-03-16  Martin Baulig  <martin@ximian.com>
16714
16715         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
16716
16717 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
16718
16719         * decl.cs (DefineTypeAndParents): New helper method to define a
16720         type's containers before the type itself is defined;  This is a
16721         bug exposed by the recent changes to Windows.Forms when an
16722         implemented interface was defined inside a class that had not been
16723         built yet.   
16724
16725         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
16726
16727         (Check): Loop correctly to report errors modifiers
16728         (UNSAFE was not in the loop, since it was the same as TOP).
16729
16730         * interface.cs: Every interface member now takes a ModFlags,
16731         instead of a "is_new" bool, which we set on the base MemberCore. 
16732
16733         Every place where we called "UnsafeOk" in the interface, now we
16734         call the proper member (InterfaceMethod.UnsafeOK) instead to get
16735         the unsafe settings from the member declaration instead of the
16736         container interface. 
16737
16738         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
16739
16740         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
16741         `set_indexer_name' to the pending bits (one per type).
16742
16743         We fixed a bug today that was picking the wrong method to
16744         override, since for properties the existing InterfaceMethod code
16745         basically ignored the method name.  Now we make sure that the
16746         method name is one of the valid indexer names.
16747
16748 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
16749  
16750         * support.cs (SeekableStreamReader): Keep track of stream byte
16751         positions and don't mix them with character offsets to the buffer.
16752
16753         Patch from Gustavo Giráldez
16754
16755 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
16756
16757         * interface.cs (InterfaceSetGetBase): Removed double member
16758         initialization, base class does it as well.
16759
16760 2004-03-13  Martin Baulig  <martin@ximian.com>
16761
16762         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
16763         when compiling corlib.
16764
16765 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
16766
16767         * convert.cs (ExplicitConversion): We were reporting an error on
16768         certain conversions (object_type source to a value type, when the
16769         expression was `null') before we had a chance to pass it through
16770         the user defined conversions.
16771
16772         * driver.cs: Replace / and \ in resource specifications to dots.
16773         Fixes 50752
16774
16775         * class.cs: Add check for duplicate operators.  Fixes 52477
16776
16777 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
16778
16779         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
16780         that are in the middle of the statements, not only at the end.
16781         Fixes #54987
16782
16783         * class.cs (TypeContainer.AddField): No longer set the
16784         `HaveStaticConstructor' flag, now we call it
16785         `UserDefineStaticConstructor' to diferentiate the slightly
16786         semantic difference.
16787
16788         The situation is that we were not adding BeforeFieldInit (from
16789         Modifiers.TypeAttr) to classes that could have it.
16790         BeforeFieldInit should be set to classes that have no static
16791         constructor. 
16792
16793         See:
16794
16795         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
16796
16797         And most importantly Zoltan's comment:
16798
16799         http://bugzilla.ximian.com/show_bug.cgi?id=44229
16800
16801         "I think beforefieldinit means 'it's ok to initialize the type sometime 
16802          before its static fields are used', i.e. initialization does not need
16803          to be triggered by the first access to the type. Setting this flag
16804          helps the JIT to compile better code, since it can run the static
16805          constructor at JIT time, and does not need to generate code to call it
16806          (possibly lots of times) at runtime. Unfortunately, mcs does not set
16807          this flag for lots of classes like String. 
16808          
16809          csc sets this flag if the type does not have an explicit static 
16810          constructor. The reasoning seems to be that if there are only static
16811          initalizers for a type, and no static constructor, then the programmer
16812          does not care when this initialization happens, so beforefieldinit
16813          can be used.
16814          
16815          This bug prevents the AOT compiler from being usable, since it 
16816          generates so many calls to mono_runtime_class_init that the AOT code
16817          is much slower than the JITted code. The JITted code is faster, 
16818          because it does not generate these calls if the vtable is type is
16819          already initialized, which is true in the majority of cases. But the
16820          AOT compiler can't do this."
16821
16822 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
16823
16824         * class.cs (MethodData.Emit): Refactor the code so symbolic
16825         information is generated for destructors;  For some reasons we
16826         were taking a code path that did not generate symbolic information
16827         before. 
16828
16829 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
16830
16831         * class.cs: Create a Constructor.CheckBase method that
16832         takes care of all validation type code. The method
16833         contains some code that was moved from Define.
16834
16835         It also includes new code that checks for duplicate ctors.
16836         This fixes bug #55148.
16837
16838 2004-03-09  Joshua Tauberer <tauberer@for.net>
16839
16840         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
16841         a { ... }-style array creation invokes EmitStaticInitializers
16842         which is not good for reference-type arrays.  String, decimal
16843         and now null constants (NullCast) are not counted toward
16844         static initializers.
16845
16846 2004-03-05  Martin Baulig  <martin@ximian.com>
16847
16848         * location.cs (SourceFile.HasLineDirective): New public field;
16849         specifies whether the file contains or is referenced by a "#line"
16850         directive.
16851         (Location.DefineSymbolDocuments): Ignore source files which
16852         either contain or are referenced by a "#line" directive.        
16853
16854 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
16855
16856         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
16857         direct access to our parent, so check the method inline there.
16858
16859 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
16860
16861         * expression.cs (Invocation.EmitCall): Miguel's last commit
16862         caused a regression. If you had:
16863
16864             T t = null;
16865             t.Foo ();
16866
16867         In Foo the implict this would be null.
16868
16869 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
16870
16871         * expression.cs (Invocation.EmitCall): If the method is not
16872         virtual, do not emit a CallVirt to it, use Call.
16873
16874         * typemanager.cs (GetFullNameSignature): Improve the method to
16875         cope with ".ctor" and replace it with the type name.
16876
16877         * class.cs (ConstructorInitializer.Resolve): Now the method takes
16878         as an argument the ConstructorBuilder where it is being defined,
16879         to catch the recursive constructor invocations.
16880
16881 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
16882
16883         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
16884         routines to check if a type is an enumerable/enumerator allow
16885         classes that implement the IEnumerable or IEnumerator interfaces.
16886
16887         * class.cs (Property, Operator): Implement IIteratorContainer, and
16888         implement SetYields.
16889
16890         (Property.Define): Do the block swapping for get_methods in the
16891         context of iterators.   We need to check if Properties also
16892         include indexers or not.
16893
16894         (Operator): Assign the Block before invoking the
16895         OperatorMethod.Define, so we can trigger the Iterator code
16896         replacement. 
16897
16898         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
16899         Property and Operator classes are not created when we parse the
16900         declarator but until we have the block completed, so we use a
16901         singleton SimpleIteratorContainer.Simple to flag whether the
16902         SetYields has been invoked.
16903
16904         We propagate this setting then to the Property or the Operator to
16905         allow the `yield' to function.
16906
16907 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
16908
16909         * codegen.cs: Implemented attribute support for modules.
16910         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
16911         Assembly/Module functionality.
16912
16913         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
16914         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
16915         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
16916
16917 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
16918
16919         * interface.cs (FindMembers): The operation is performed on all base
16920         interfaces and not only on the first. It is required for future CLS Compliance patch.
16921
16922 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16923
16924         * statement.cs, codegen.cs:
16925         This patch deals with patterns such as:
16926
16927         public class List : IEnumerable {
16928
16929                 public MyEnumerator GetEnumerator () {
16930                         return new MyEnumerator(this);
16931                 }
16932
16933                 IEnumerator IEnumerable.GetEnumerator () {
16934                         ...
16935                 }
16936                 
16937                 public struct MyEnumerator : IEnumerator {
16938                         ...
16939                 }
16940         }
16941
16942         Before, there were a few things we did wrong:
16943         1) we would emit callvirt on a struct, which is illegal
16944         2) we emited ldarg when we needed to emit ldarga
16945         3) we would mistakenly call the interface methods on an enumerator
16946         type that derived from IEnumerator and was in another assembly. For example:
16947
16948         public class MyEnumerator : IEnumerator
16949
16950         Would have the interface methods called, even if there were public impls of the
16951         method. In a struct, this lead to invalid IL code.
16952
16953 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
16954
16955         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16956           renamed to Emit.
16957
16958         * delegate.cs (Define): Fixed crash when delegate type is undefined.
16959
16960 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
16961
16962         * cs-parser.jay: Fix small regression: we were not testing V2
16963         compiler features correctly.
16964
16965         * interface.cs: If the emit context is null, then create one
16966
16967 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
16968
16969         * decl.cs (GetSignatureForError): New virtual method to get full name
16970           for error messages.
16971
16972         * attribute.cs (IAttributeSupport): New interface for attribute setting.
16973           Now it is possible to rewrite ApplyAttributes method to be less if/else.
16974
16975         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16976           Duplicated members and code in these classes has been removed.
16977           Better encapsulation in these classes.
16978
16979 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
16980
16981         * assign.cs (Assign.DoResolve): When dealing with compound
16982         assignments, there is a new rule in ECMA C# 2.4 (might have been
16983         there before, but it is documented here) that states that in:
16984
16985         a op= b;
16986
16987         If b is of type int, and the `op' is a shift-operator, then the
16988         above is evaluated as:
16989
16990         a = (int) a op b 
16991
16992         * expression.cs (Binary.ResolveOperator): Instead of testing for
16993         int/uint/long/ulong, try to implicitly convert to any of those
16994         types and use that in pointer arithmetic.
16995
16996         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16997         method to print information for from the type, not from the
16998         null-method we were given.
16999
17000 2004-02-01  Duncan Mak  <duncan@ximian.com>
17001
17002         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17003         parsing for cmd, fixes bug #53694.
17004
17005 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17006
17007         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17008         in the member name duplication tests. Property and operator name duplication
17009         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17010
17011 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17012
17013         * interface.cs (PopulateMethod): Fixed crash when interface method
17014         returns not existing type (error test cs0246-3.cs).
17015
17016 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17017
17018         * cs-parser.jay (interface_accessors): Re-write actions to also
17019         store attributes attached to get and set methods. Fix spelling
17020         while at it.
17021
17022         (inteface_property_declaration): Modify accordingly.
17023
17024         (InterfaceAccessorInfo): New helper class to store information to pass
17025         around between rules that use interface_accessors.
17026
17027         * interface.cs (Emit): Apply attributes on the get and set
17028         accessors of properties and indexers too.
17029
17030         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17031         right MethodBuilder when applying attributes to the get and set accessors.
17032
17033 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17034
17035         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17036
17037 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17040
17041 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17044         changes that treat `yield' specially when present before `break'
17045         or `return' tokens.
17046
17047         * cs-tokenizer.cs: yield is no longer a keyword.
17048
17049 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17050
17051         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17052         setting for default constructors.
17053         For default constructors are almost every time set wrong Modifier. The
17054         generated IL code has been alright. But inside mcs this values was
17055         wrong and this was reason why several of my CLS Compliance tests
17056         failed.
17057
17058 2004-01-22  Martin Baulig  <martin@ximian.com>
17059
17060         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17061         not a QualifiedIdentifier.  This is what `type_name_expression'
17062         was previously doing.
17063         (type_name_expression): Removed; the code is now in
17064         `namespace_or_type_name'.
17065         (qualified_identifier): Removed, use `namespace_or_type_name'
17066         instead.
17067         (QualifiedIdentifier): Removed this class.      
17068
17069 2004-01-22  Martin Baulig  <martin@ximian.com>
17070
17071         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17072         not a string as alias name.
17073
17074 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17075
17076         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17077         #52730 bug, and instead compute correctly the need to use a
17078         temporary variable when requesting an address based on the
17079         static/instace modified of the field and the constructor.
17080  
17081 2004-01-21  Martin Baulig  <martin@ximian.com>
17082
17083         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17084         class and namespace before looking up aliases.  Fixes #52517.
17085
17086 2004-01-21  Martin Baulig  <martin@ximian.com>
17087
17088         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17089         assinged in a 'try'; fixes exception4.cs.
17090
17091 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17092         * class.cs : Implemented parameter-less constructor for TypeContainer
17093
17094         * decl.cs: Attributes are now stored here. New property OptAttributes
17095
17096         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17097
17098         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17099
17100 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17101
17102         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17103           (CSharpSignature): New method for indexer and property signature.
17104
17105 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17106
17107         * pending.cs (IsVirtualFilter): Faster implementation.
17108
17109 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17110
17111         * typemanager.cs: Avoid inclusion of same assembly more than once.
17112
17113 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17114
17115         * cs-parser.jay: Fixed problem where the last assembly attribute
17116           has been applied also to following declaration (class, struct, etc.)
17117           
17118 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17119
17120         * class.cs: Added error CS0538, CS0539 reporting.
17121         Fixed crash on Microsoft runtime when field type is void.
17122
17123         * cs-parser.jay: Added error CS0537 reporting.
17124
17125         * pending.cs: Added error CS0535 reporting.
17126         Improved error report for errors CS0536, CS0534.
17127
17128 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
17129
17130         Merge a few bits from the Anonymous Method MCS tree.
17131
17132         * statement.cs (ToplevelBlock): New class for toplevel methods,
17133         will hold anonymous methods, lifted variables.
17134
17135         * cs-parser.jay: Create toplevel blocks for delegates and for
17136         regular blocks of code. 
17137
17138 2004-01-20  Martin Baulig  <martin@ximian.com>
17139
17140         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17141         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17142         and `NeedExplicitReturn'; added `IsLastStatement'.
17143         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17144         have a `ReturnLabel' or we're not unreachable.
17145
17146         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17147         child's reachability; don't just override ours with it.  Fixes
17148         #58058 (lluis's example).
17149         (FlowBranching): Added public InTryOrCatch(), InCatch(),
17150         InFinally(), InLoop(), InSwitch() and
17151         BreakCrossesTryCatchBoundary() methods.
17152
17153         * statement.cs (Return): Do all error checking in Resolve().
17154         Unless we are the last statement in a top-level block, always
17155         create a return label and jump to it.
17156         (Break, Continue): Do all error checking in Resolve(); also make
17157         sure we aren't leaving a `finally'.
17158         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17159         statement in a top-level block.
17160         (Block.Flags): Added `IsDestructor'.
17161         (Block.IsDestructor): New public property.
17162
17163 2004-01-20  Martin Baulig  <martin@ximian.com>
17164
17165         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17166
17167 2004-01-20  Martin Baulig  <martin@ximian.com>
17168
17169         * statement.cs (Statement.ResolveUnreachable): New public method.
17170         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17171         (Block.Resolve): Resolve unreachable statements.
17172
17173 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17174
17175         * expression.cs: We need to fix the case where we do
17176         not have a temp variable here.
17177
17178         * assign.cs: Only expression compound assignments need
17179         temporary variables.
17180
17181 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17182
17183         * flowanalysis.cs: Reduce memory allocation in a few ways:
17184           - A block with no variables should not allocate a bit
17185             vector for itself.
17186           - A method with no out parameters does not need any tracking
17187             for assignment of the parameters, so we need not allocate
17188             any data for it.
17189           - The arrays:
17190                 public readonly Type[] VariableTypes;
17191                 public readonly string[] VariableNames;
17192             Are redundant. The data is already stored in the variable
17193             map, so we need not allocate another array for it.
17194           - We need to add alot of checks for if (params | locals) == null
17195             due to the first two changes.
17196
17197 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
17198
17199         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17200         implement IMemoryLocation, we store a copy on a local variable and
17201         take the address of it.  Patch from Benjamin Jemlich
17202
17203         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17204         to use a special "type_name_expression" rule which reduces the
17205         number of "QualifiedIdentifier" classes created, and instead
17206         directly creates MemberAccess expressions.
17207
17208 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
17209
17210         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17211         that fixes #52853.  Null literal assignment to ValueType
17212
17213         * class.cs (MethodData.Emit): Instead of checking the name of the
17214         method to determine if its a destructor, create a new derived
17215         class from Method called Destructor, and test for that.  
17216
17217         * cs-parser.jay: Create a Destructor object instead of a Method.  
17218
17219         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17220
17221         Fixes: 52933
17222
17223 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
17224
17225         * expression.cs (Binary.ResolveOperator): Perform an implicit
17226         conversion from MethodGroups to their delegate types on the
17227         Addition operation.
17228
17229         * delegate.cs: Introduce a new class DelegateCreation that is the
17230         base class for `NewDelegate' and `ImplicitDelegateCreation',
17231         factor some code in here.
17232
17233         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17234         conversion from MethodGroups to compatible delegate types. 
17235
17236         * ecore.cs (Expression.Resolve): Do not flag error 654
17237         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17238         we allow conversions from MethodGroups to delegate types now.
17239
17240         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17241         assignments in v2 either.
17242
17243 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
17244
17245         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17246         static read-only fields in ctors.
17247
17248         Applied patch from Benjamin Jemlich 
17249
17250         * expression.cs (UnaryMutator): Avoid leaking local variables. 
17251
17252 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * cs-tokenizer.cs (IsCastToken): Allow the various native types
17255         here to return true, as they can be used like this:
17256
17257                 (XXX) int.MEMBER ()
17258
17259         Fixed 49836 and all the other dups
17260
17261 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
17262
17263         * driver.cs: Implement /win32res and /win32icon.
17264
17265 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
17266
17267         * cs-parser.jay: Add a rule to improve error handling for the
17268         common mistake of placing modifiers after the type.
17269
17270 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
17271
17272         * cs-parser.jay (interface_event_declaration): Catch
17273         initialization of events on interfaces, and report cs0068
17274
17275         * cs-parser.jay (interface_event_declaration): Catch
17276         initialization of events. 
17277
17278         * ecore.cs: Better report missing constructors.
17279
17280         * expression.cs (Binary.ResolveOperator): My previous bug fix had
17281         the error reporting done in the wrong place.  Fix.
17282
17283         * expression.cs (Binary.ResolveOperator): Catch the 
17284         operator + (E x, E y) error earlier, and later allow for implicit
17285         conversions in operator +/- (E e, U x) from U to the underlying
17286         type of E.
17287
17288         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17289         52596, if the container class is abstract, the default constructor
17290         is protected otherwise its public (before, we were always public).
17291
17292         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17293         fixed statement.
17294
17295         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17296         Jemlich that fixes bug #52597, MCS was generating invalid code for
17297         idisposable structs.   Thanks to Ben for following up with this
17298         bug as well.
17299
17300 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
17301
17302         * driver.cs: Allow assemblies without code to be generated, fixes
17303         52230.
17304
17305 2004-01-07  Nick Drochak <ndrochak@gol.com>
17306
17307         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17308
17309 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
17310
17311         * cs-parser.jay: Add rules to improve error reporting if fields or
17312         methods are declared at the namespace level (error 116)
17313
17314         * Add rules to catch event add/remove
17315
17316 2004-01-04  David Sheldon <dave-mono@earth.li>
17317
17318   * expression.cs: Added matching ")" to error message for 
17319   CS0077
17320
17321 2004-01-03 Todd Berman <tberman@gentoo.org>
17322
17323         * ecore.cs, attribute.cs:
17324         Applying fix from #52429.
17325
17326 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17327
17328         * ecore.cs, expression.cs, statement.cs:
17329         Total rewrite of how we handle branching. We
17330         now handle complex boolean expressions with fewer
17331         jumps. As well if (x == 0) no longer emits a ceq.
17332
17333         if (x is Foo) is much faster now, because we generate
17334         better code.
17335
17336         Overall, we get a pretty big improvement on our benchmark
17337         tests. The code we generate is smaller and more readable.
17338
17339         I did a full two-stage bootstrap. The patch was reviewed
17340         by Martin and Miguel.
17341
17342 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17343
17344         * cs-parser.jay: Make primary_expression not take a QI.
17345         we dont need this because the member_access rule covers
17346         us here. So we replace the rule with just IDENTIFIER.
17347
17348         This has two good effects. First, we remove a s/r conflict.
17349         Second, we allocate many fewer QualifiedIdentifier objects.
17350
17351 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17352
17353         * attribute.cs: Handle MarshalAs attributes as pseudo, and
17354         set the correct information via SRE. This prevents
17355         hanging on the MS runtime. Fixes #29374.
17356
17357 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17358
17359         * convert.cs: correctly handle conversions to value types
17360         from Enum and ValueType as unboxing conversions.
17361
17362         Fixes bug #52569. Patch by Benjamin Jemlich.
17363
17364 2004-01-02  Ravi Pratap  <ravi@ximian.com>
17365
17366         * expression.cs (BetterConversion): Prefer int -> uint
17367         over int -> ulong (csc's behaviour). This fixed bug #52046.
17368
17369 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17370
17371         * decl.cs (MemberCache.FindMembers): now returns a
17372         MemberInfo [].
17373
17374         * typemanager.cs: In general, go with with ^^.
17375         (CopyNewMethods): take an IList.
17376         (RealMemberLookup): Only allocate an arraylist
17377         if we copy from two sets of methods.
17378
17379         This change basically does two things:
17380         1) Fewer array lists allocated due to CopyNewMethods.
17381         2) the explicit cast in MemberList costed ALOT.
17382
17383 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
17384
17385         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17386         a hashtable to avoid needless string allocations when an identifier is
17387         used more than once (the common case).
17388
17389 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17390
17391         * pending.cs: MS's TypeBuilder.GetInterfaces ()
17392         is broken, it will not return anything. So, we
17393         have to use the information we have in mcs to
17394         do the task.
17395
17396         * typemanager.cs: Add a cache for GetInterfaces,
17397         since this will now be used more often (due to ^^)
17398
17399         (GetExplicitInterfaces) New method that gets the
17400         declared, not effective, interfaces on a type
17401         builder (eg, if you have interface IFoo, interface
17402         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17403         { IBar }.
17404
17405         This patch makes MCS able to bootstrap itself on
17406         Windows again.
17407
17408 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17409
17410         * expression.cs: Remove the Nop's that Miguel put
17411         in by mistake.
17412
17413 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17414
17415         * report.cs, codegen.cs: Give the real stack trace to
17416         the error when an exception is thrown.
17417
17418 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17419
17420         * decl.cs: only allocate hashtables for ifaces if 
17421         it is an iface!
17422
17423 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17424
17425         * expression.cs: fix the error from cs0121-2.cs
17426         (a parent interface has two child interfaces that
17427         have a function with the same name and 0 params
17428         and the function is called through the parent).
17429
17430 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17431
17432         * class.cs, rootcontext.cs, typmanager.cs: do not
17433         leak pointers.
17434
17435 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17436
17437         * codegen.cs: remove stack for the ec flow branching.
17438         It is already a linked list, so no need.
17439
17440 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17441
17442         * Makefile: Allow custom profiler here.
17443
17444 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17445
17446         * typemanager.cs (LookupType):
17447           - Use a static char [], because split takes
17448             a param array for args, so it was allocating
17449             every time.
17450           - Do not store true in a hashtable, it boxes.
17451
17452 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17453
17454         * flowanalysis.cs: bytify common enums.
17455
17456 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17457
17458         * modifiers.cs: Add a new set of flags for the
17459         flags allowed on explicit interface impls.
17460         * cs-parser.jay: catch the use of modifiers in
17461         interfaces correctly.
17462         * class.cs: catch private void IFoo.Blah ().
17463
17464         All related to bug #50572.
17465
17466 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17467
17468         * decl.cs: Rewrite the consistant accessability checking.
17469         Accessability is not linear, it must be implemented in
17470         a tableish way. Fixes #49704.
17471
17472 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17473
17474         * expression.cs: Handle negation in a checked context.
17475         We must use subtraction from zero. Fixes #38674.
17476
17477 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17478
17479         * class.cs: Ignore static void main in DLLs.
17480         * rootcontext.cs: Handle the target type here,
17481         since we are have to access it from class.cs
17482         * driver.cs: account for the above.
17483
17484 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17485
17486         * report.cs: Give line numbers and files if available.
17487
17488 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
17489
17490         * driver.cs: Implement /addmodule.
17491
17492         * typemanager.cs:  Change 'modules' field so it now contains Modules not
17493         ModuleBuilders.
17494
17495 2003-12-20  Martin Baulig  <martin@ximian.com>
17496
17497         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
17498         (FieldBase.IsAssigned): Removed this field.
17499         (FieldBase.SetAssigned): New public method.
17500         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
17501
17502 2003-12-20  Martin Baulig  <martin@ximian.com>
17503
17504         * expression.cs (LocalVariableReference.DoResolve): Don't set
17505         `vi.Used' if we're called from DoResolveLValue().
17506
17507         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
17508         returns the usage vector it just merged into the current one -
17509         pass this one to UsageWarning().
17510         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
17511         of the `EmitContext', don't call this recursively on our children.
17512
17513 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
17514
17515         * driver.cs: Implement /target:module.
17516
17517 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
17518
17519         * support.cs (CharArrayHashtable): New helper class.
17520
17521         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
17522         char arrays, not strings, so we can avoid creating a string in
17523         consume_identifier if the identifier is a keyword.
17524
17525 2003-12-16  Martin Baulig  <martin@ximian.com>
17526
17527         * statement.cs (LocalInfo.Assigned): Removed this property.
17528         (LocalInfo.Flags): Removed `Assigned'.
17529         (LocalInfo.IsAssigned): New public method; takes the EmitContext
17530         and uses flow analysis.
17531         (Block.UsageWarning): Made this method private.
17532         (Block.Resolve): Call UsageWarning() if appropriate.
17533
17534         * expression.cs (LocalVariableReference.DoResolve): Always set
17535         LocalInfo.Used here.
17536
17537 2003-12-13  Martin Baulig  <martin@ximian.com>
17538
17539         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
17540         any value here; we're now using flow analysis to figure out
17541         whether a statement/block returns a value.
17542
17543 2003-12-13  Martin Baulig  <martin@ximian.com>
17544
17545         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
17546         working again.
17547         (FlowBranching.MergeFinally): Don't call
17548         `branching.CheckOutParameters()' here, this is called in
17549         MergeTopBlock().
17550         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
17551         when adding the `finally' vector.       
17552
17553 2003-12-13  Martin Baulig  <martin@ximian.com>
17554
17555         * flowanalysis.cs
17556         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
17557         actually work and also fix #48962.
17558
17559 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17560
17561         * decl.cs: Do not check System.Object for nested types,
17562         since we know it does not have any. Big bang for buck:
17563
17564         BEFORE:
17565            Run 1:   8.35 seconds
17566            Run 2:   8.32 seconds
17567            corlib:  17.99 seconds
17568         AFTER:
17569            Run 1:   8.17 seconds
17570            Run 2:   8.17 seconds
17571            corlib:  17.39 seconds
17572
17573 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17574
17575         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
17576         time we are returning 0 members, so we save alot here.
17577
17578 2003-12-11  Martin Baulig  <martin@ximian.com>
17579
17580         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
17581         `MergeChild()', also just take the `FlowBranching' as argument;
17582         call Merge() on it and return the result.
17583         (FlowBranching.Merge): We don't need to do anything if we just
17584         have one sibling.
17585
17586 2003-12-11  Martin Baulig  <martin@ximian.com>
17587
17588         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
17589         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
17590         Maurer for this idea.
17591
17592 2003-12-11  Martin Baulig  <martin@ximian.com>
17593
17594         * flowanalysis.cs (MergeResult): This class is now gone; we now
17595         use the `UsageVector' for this.  The reason for this is that if a
17596         branching just has one sibling, we don't need to "merge" them at
17597         all - that's the next step to do.
17598         (FlowBranching.Merge): We now return a `UsageVector' instead of a
17599         `MergeResult'.
17600
17601 2003-12-11  Martin Baulig  <martin@ximian.com>
17602
17603         Reworked flow analyis and made it more precise and bug-free.  The
17604         most important change is that we're now using a special `Reachability'
17605         class instead of having "magic" meanings of `FlowReturns'.  I'll
17606         do some more cleanups and optimizations and also add some more
17607         documentation this week.
17608
17609         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
17610         largely reworked this class.
17611         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
17612         the new `Reachability' class instead of having "magic" values here.
17613         (FlowBranching): We're now using an instance of `Reachability'
17614         instead of having separate `Returns', `Breaks' etc. fields.
17615
17616         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
17617         based on flow analysis; ignore the return value of block.Emit ().
17618
17619 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
17620
17621         * driver.cs typemanager.cs: Find the mono extensions to corlib even
17622         if they are private.
17623
17624 2003-12-09  Martin Baulig  <martin@ximian.com>
17625
17626         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
17627         call them directly on the UsageVector.
17628
17629 2003-12-09  Martin Baulig  <martin@ximian.com>
17630
17631         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
17632         Changed return type from `FlowReturns' to `Reachability'.
17633
17634 2003-12-09  Martin Baulig  <martin@ximian.com>
17635
17636         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
17637         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
17638         `Reachable' fields with a single `Reachability' one.
17639
17640 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17641
17642         * class.cs (FindMembers): Remove foreach's.
17643
17644         Bootstrap times:
17645
17646         BEFORE
17647                 Run 1:   8.74 seconds
17648                 Run 2:   8.71 seconds
17649
17650         AFTER
17651                 Run 1:   8.64 seconds
17652                 Run 2:   8.58 seconds
17653
17654
17655 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17656
17657         * cs-parser.jay:
17658         * gen-treedump.cs:
17659         * statement.cs:
17660         This patch does a few things:
17661                 1. EmptyStatement is now a singleton, so it is never reallocated.
17662                 2. All blah is EmptyStatement constructs have been changed to
17663                    blah == EmptyStatement.Value, which is much faster and valid
17664                    now that EmptyStatement is a singleton.
17665                 3. When resolving a block, rather than allocating a new array for
17666                    the non-empty statements, empty statements are replaced with
17667                    EmptyStatement.Value
17668                 4. Some recursive functions have been made non-recursive.
17669         Mainly the performance impact is from (3), however (1) and (2) are needed for
17670         this to work. (4) does not make a big difference in normal situations, however
17671         it makes the profile look saner.
17672
17673         Bootstrap times:
17674
17675         BEFORE
17676         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17677         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17678         Total memory allocated: 56397 KB
17679
17680         AFTER
17681         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
17682         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
17683         Total memory allocated: 55666 KB
17684
17685 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17686
17687         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
17688         than the hashtable in a hashtable version
17689
17690         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
17691         we always end up concating a string. This results in a huge perf
17692         loss, because many strings have to be tracked by the GC. In this
17693         patch, we first use a hashtable that works with two keys, so that
17694         the strings do not need to be concat'ed.
17695
17696         Bootstrap times:
17697         BEFORE
17698                 Run 1:   8.74 seconds
17699                 Run 2:   8.71 seconds
17700
17701         AFTER
17702                 Run 1:   8.65 seconds
17703                 Run 2:   8.56 seconds
17704
17705 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17706
17707         * Makefile: Add a new target `do-time' that does a quick and simple
17708         profile, leaving easy to parse output.
17709
17710 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
17711
17712         * codegen.cs (Init): Create the dynamic assembly with 
17713         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
17714
17715 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17716
17717         * support.cs: Make the PtrHashtable use only one
17718         instance of its comparer.
17719
17720 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
17721
17722         * typemanager.cs: Fix lookup of GetNamespaces.
17723
17724 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * expression.cs: Removed redundant line.
17727
17728         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
17729         ArrayLists, use for loops with bounds.  
17730
17731         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
17732         arraylist.
17733
17734         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
17735         arraylists, use for loop with bounds.
17736
17737         The above three changes give us a 0.071 second performance
17738         improvement out of 3.294 seconds down to 3.223.  On my machine
17739         the above changes reduced the memory usage by 1,387 KB during
17740         compiler bootstrap.
17741
17742         * cs-parser.jay (QualifiedIdentifier): New class used to represent
17743         QualifiedIdentifiers.  Before we created a new string through
17744         concatenation, and mostly later on, the result would be
17745         manipulated by DecomposeQI through string manipulation.
17746
17747         This reduced the compiler memory usage for bootstrapping from
17748         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
17749         compile times in 0.05 seconds.
17750
17751 2003-11-28  Dick Porter  <dick@ximian.com>
17752
17753         * support.cs: Do string compares with the Invariant culture.
17754
17755         * rootcontext.cs: 
17756         * gen-treedump.cs: 
17757         * expression.cs: 
17758         * driver.cs: 
17759         * decl.cs: 
17760         * codegen.cs: 
17761         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
17762         the comparison is done with the Invariant culture.
17763
17764 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
17765
17766         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
17767         GetEnumerator method.
17768
17769         (ProbeCollectionType): Iterate starting at the most specific type
17770         upwards looking for a GetEnumerator
17771
17772         * expression.cs: Shift count can be up to 31 for int/uint and 63
17773         for long/ulong.
17774
17775 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
17776
17777         * statement.cs (Block.LookupLabel): Also look for the label on the
17778         children blocks.  Use a hash table to keep track of visited
17779         nodes. 
17780
17781         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
17782         we actually did transform the other operand, otherwise fall back
17783         to the common codepath that casts to long.
17784
17785         * cs-tokenizer.cs: Use the same code pattern as the int case.
17786         Maybe I should do the parsing myself, and avoid depending on the
17787         Parse routines to get this done.
17788
17789 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
17790
17791         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
17792         which fixes bug 51347.  This time test it.
17793
17794         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
17795         attributes for example can not tell the difference between these.
17796         The difference was only a syntax feature of the language. 
17797
17798         * attribute.cs: Apply attributes to delegates.
17799
17800         * delegate.cs: Call the apply attributes method.
17801
17802 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
17805         comparing 0 vs Byte.MinValue, not the value
17806
17807         (ImplicitConversionRequired): When reporting a conversion error,
17808         use error 31 to print out the constant error instead of the
17809         simpler 29.
17810
17811         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
17812         which fixes bug 51347.
17813
17814 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
17817         which fixes the -warnaserror command line option.
17818
17819 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * cfold.cs (DoNumericPromotions): During constant folding of
17822         additions on UIntConstant, special case intconstants with
17823         IntConstants like we do on the expression binary operator. 
17824
17825 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
17826
17827         * convert.cs (ImplicitReferenceConversion): We were missing a case
17828         (System.Enum are not value types or class types, so we need to
17829         classify them separatedly).
17830
17831         * driver.cs: We do not support error 2007.
17832
17833 2003-11-12 Jackson Harper <jackson@ximian.com>
17834
17835         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
17836         system directory. Also use the full file name so users can
17837         libraries names mscorlib-o-tron.dll in a non system dir.
17838
17839 2003-11-10  Martin Baulig  <martin@ximian.com>
17840
17841         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
17842         (TypeManager.InitCoreTypes): Initialize them here, but instead of
17843         calling `ResolveType()' on them, directly assign their `Type'.
17844
17845 2003-11-08  Martin Baulig  <martin@ximian.com>
17846
17847         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
17848         return value and the `out parent' parameter.
17849         (TypeContainer.DefineType): Moved the CS0644 check into
17850         GetClassBases().  Don't pass the interface types to the
17851         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
17852         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
17853
17854         * ecore.cs (TypeExpr.IsAttribute): New property.
17855         (TypeExpr.GetInterfaces): New method.
17856
17857         * interface.cs (Interface.GetInterfaceTypeByName): Return a
17858         TypeExpr instead of a Type.
17859         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
17860         (Interface.DefineType): Don't pass the interface types to the
17861         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
17862         them later and then call `TypeBulider.AddInterfaceImplementation()'.
17863
17864         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
17865         instead of a `Type[]'.
17866         (TypeManager.RegisterBuilder): Likewise.
17867         (TypeManager.AddUserInterface): Likewise.
17868         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
17869         `Type[]' and also return a `TypeExpr[]'.
17870         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
17871
17872 2003-11-08  Martin Baulig  <martin@ximian.com>
17873
17874         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
17875         Expression.     
17876
17877 2003-11-08  Martin Baulig  <martin@ximian.com>
17878
17879         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
17880         TypeManager.ResolveExpressionTypes().
17881
17882         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
17883         instead of an Expression.
17884         (TypeExpr): This is now an abstract base class for `TypeExpression'.
17885         (TypeExpression): New public class; formerly known as `TypeExpr'.
17886
17887         * expression.cs (ComposedCast): Derive from TypeExpr.
17888
17889         * typemanager.cs (TypeManager.system_*_expr): These are now
17890         TypExpr's instead of Expression's.
17891         (TypeManager.ResolveExpressionTypes): New public static function;
17892         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
17893         of them.        
17894
17895 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * expression.cs (New.DoResolve): Do not dereference value that
17898         might be a null return.
17899
17900         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
17901         sure that the constant value has the right type.  Fixes an
17902         unreported bug, similar to 50425.
17903
17904         * const.cs (Const.LookupConstantValue): Call
17905         ImplicitStandardConversionExists before doing a conversion to
17906         avoid havng the TypeManager.ChangeType do conversions.
17907
17908         Reduced the number of casts used
17909
17910         (Const.ChangeType): New routine to enable reuse of the constant
17911         type changing code from statement.
17912
17913         * typemanager.cs (ChangeType): Move common initialization to
17914         static global variables.
17915
17916         Fixes #50425.
17917
17918         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
17919         every value type to go through, even if it was void.  Fix that. 
17920
17921         * cs-tokenizer.cs: Use is_identifier_start_character on the start
17922         character of the define, and the is_identifier_part_character for
17923         the rest of the string.
17924
17925 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
17926
17927         * expression.cs (UnaryMutator.EmitCode): When I updated
17928         LocalVariableReference.DoResolve, I overdid it, and dropped an
17929         optimization done on local variable references.
17930
17931 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * ecore.cs: Convert the return from Ldlen into an int.
17934
17935 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
17936
17937         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17938         the accessibility, this is a special case for toplevel non-public
17939         classes (internal for instance).
17940
17941 2003-10-20  Nick Drochak <ndrochak@gol.com>
17942
17943         * ecore.cs: Fix typo and build.  Needed another right paren.
17944
17945 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
17946
17947         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
17948         `internal' case regular and protected, but not allowing protected
17949         to be evaluated later.  Bug 49840
17950
17951 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17954         to kb.Nlast, and not the kb.nFirst to isolate the switch
17955         statement.
17956
17957         Extract the underlying type, so enumerations of long/ulong are
17958         treated like long/ulong.
17959
17960 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * expression.cs (New): Overload the meaning of RequestedType to
17963         track the possible creation of the NewDelegate type, since
17964         DoResolve is invoked more than once for new constructors on field
17965         initialization.
17966
17967         See bugs: #48800 and #37014
17968
17969         * cs-parser.jay (declare_local_constants): Take an arraylist
17970         instead of a single constant.
17971
17972         (local_constant_declaration): It should take a
17973         constant_declarators, not a constant_declarator.  Fixes 49487
17974
17975         * convert.cs: Fix error report.
17976
17977 2003-10-13 Jackson Harper <jackson@ximian.com>
17978
17979         * typemanager.cs (TypeToCoreType): Add float and double this fixes
17980         bug #49611
17981
17982 2003-10-09  Martin Baulig  <martin@ximian.com>
17983
17984         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17985         to the .ctor.
17986         (MethodCore.DoDefineParameters): Removed the TypeContainer
17987         argument; use the DeclSpace which was passed to the .ctor instead.
17988         (MethodCore.CheckParameter): Take a DeclSpace instead of a
17989         TypeContainer; we only need a DeclSpace here.
17990
17991 2003-10-09  Martin Baulig  <martin@ximian.com>
17992
17993         * class.cs (MethodData): Added additional `DeclSpace ds' argument
17994         to the .ctor.
17995         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17996         EmitContext's .ctor.    
17997
17998 2003-10-09  Martin Baulig  <martin@ximian.com>
17999
18000         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18001         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18002         AsAccessible(), moved them as well.
18003
18004         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18005
18006 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18007
18008         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18009
18010 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18011
18012         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18013         generation for >=, as spotted by Paolo, bug 48679.  
18014         Patch from David Waite.
18015
18016         * cs-tokenizer.cs: Add handling for #pragma.
18017
18018         * cs-parser.jay: Allow for both yield and yield return in the
18019         syntax.  The anti-cobolization of C# fight will go on!
18020
18021         * class.cs (TypeBuilder.DefineType): Catch error condition here
18022         (Parent.DefineType erroring out and returning null).
18023
18024         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18025         coping with enumerations variables, we were mistakenly processing
18026         them as a regular value type instead of built-in types.  Fixes the
18027         bug #48063
18028
18029         * typemanager.cs (IsBuiltinOrEnum): New method.
18030
18031 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18032
18033         * cs-parser.jay: Upgrade: yield now needs the return clause.
18034
18035 2003-09-19  Martin Baulig  <martin@ximian.com>
18036
18037         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18038         `MemberCache parent' argument.  Normally, an interface doesn't
18039         have a parent type except System.Object, but we use this in gmcs
18040         for generic type parameters.
18041
18042 2003-09-18  Martin Baulig  <martin@ximian.com>
18043
18044         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18045         on `type.IsInterface'; don't check whether the type has a parent
18046         to determine whether it's an interface.
18047
18048 2003-09-15  Martin Baulig  <martin@ximian.com>
18049
18050         * class.cs (TypeContainer.DefineType): Added an error flag to
18051         avoid reporting duplicate CS0146's ("class definition is
18052         circular.").
18053
18054         * driver.cs (Driver.MainDriver): Abort if
18055         RootContext.ResolveTree() reported any errors.
18056
18057 2003-09-07  Martin Baulig  <martin@ximian.com>
18058
18059         * report.cs (Error, Warning): Added overloaded versions which take
18060         a `params object[] args' and call String.Format().
18061
18062 2003-09-07  Martin Baulig  <martin@ximian.com>
18063
18064         * decl.cs (DeclSpace..ctor): Don't call
18065         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18066         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18067         (DeclSpace.RecordDecl): New method.
18068
18069         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18070
18071 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18072
18073         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18074         value attributes to be applied to ParameterBuilders.
18075
18076         * class.cs (MethodCore.LabelParameters): Make static and more
18077         generic so that it can be used from other places - like interface
18078         methods, for instance.
18079
18080         * interface.cs (Interface.Emit): Call LabelParameters before
18081         emitting attributes on the InterfaceMethod.
18082
18083 2003-08-26  Martin Baulig  <martin@ximian.com>
18084
18085         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18086         resolving aliases; fixes #47927.
18087
18088 2003-08-26  Martin Baulig  <martin@ximian.com>
18089
18090         * statement.cs (Using.DoResolve): This is internally emitting a
18091         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18092         do not always return.  Fixes #47681.
18093
18094 2003-08-26  Martin Baulig  <martin@ximian.com>
18095
18096         * decl.cs (MemberCore): Moved WarningNotHiding(),
18097         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18098         into MemberBase.
18099         (AdditionResult): Make this nested in DeclSpace.
18100         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18101         argument; call NamespaceEntry.Define() unless we're nested in a
18102         class or struct.
18103
18104         * namespace.cs (Namespace.DefineName): New public function.  This
18105         is called from DeclSpace's .ctor to add 
18106         (Namespace.Lookup): Include DeclSpaces in the lookup.
18107
18108         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18109
18110         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18111
18112 2003-08-25  Martin Baulig  <martin@ximian.com>
18113
18114         * convert.cs (Convert.ExplicitReferenceConversion): When
18115         converting from an interface type to a class, unbox if the target
18116         type is a struct type.  Fixes #47822.
18117
18118 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18119
18120         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18121         #47854.
18122
18123 2003-08-22  Martin Baulig  <martin@ximian.com>
18124
18125         * class.cs (TypeManager.DefineType): When defining a nested type,
18126         call DefineType() on our parent; fixes #47801.
18127
18128 2003-08-22  Martin Baulig  <martin@ximian.com>
18129
18130         * class.cs (MethodData.Define): While checking if a method is an
18131         interface implementation, improve the test a bit more to fix #47654.
18132
18133 2003-08-22  Martin Baulig  <martin@ximian.com>
18134
18135         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18136         correctly; fixes #47722.
18137
18138 2003-08-22  Martin Baulig  <martin@ximian.com>
18139
18140         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18141         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
18142
18143         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
18144
18145 2003-08-22  Martin Baulig  <martin@ximian.com>
18146
18147         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18148         can only be assigned in static constructors.  Fixes #47161.
18149
18150 2003-08-22  Martin Baulig  <martin@ximian.com>
18151
18152         Rewrote and improved the flow analysis code.
18153
18154         * flowbranching.cs (FlowBranching): Make this class abstract.
18155         (FlowBranching.CreateBranching): New static function to create a
18156         new flow branching.
18157         (FlowBranchingBlock, FlowBranchingException): New classes.
18158         (FlowBranching.UsageVector.Type): New public readonly field.
18159         (FlowBranching.UsageVector.Breaks): Removed the setter.
18160         (FlowBranching.UsageVector.Returns): Removed the setter.
18161         (FlowBranching.UsageVector): Added Break(), Return(),
18162         NeverReachable() and Throw() methods to modify the reachability.
18163         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18164         done by FlowBranching.Merge().
18165         (FlowBranching.UsageVector.MergeChild): New method; merges the
18166         merge result into the current vector.
18167         (FlowBranching.Merge): New abstract method to merge a branching.
18168
18169 2003-08-12  Martin Baulig  <martin@ximian.com>
18170
18171         * expression.cs (Indirection.CacheTemporaries): Create the
18172         LocalTemporary with the pointer type, not its element type.
18173
18174 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
18175
18176         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18177         token was a keyword or not.
18178
18179         Add `error' options where an IDENTIFIER was expected;  Provide
18180         CheckToken and CheckIdentifierToken convenience error reporting
18181         functions. 
18182
18183         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18184
18185         * decl.cs: Rename `NamespaceEntry Namespace' public field into
18186         NameSpaceEntry NameSpaceEntry.
18187
18188         (LookupInterfaceOrClass): Avoid creating a full qualified name
18189         from namespace and name: avoid doing lookups when we know the
18190         namespace is non-existant.   Use new Tree.LookupByNamespace which
18191         looks up DeclSpaces based on their namespace, name pair.
18192
18193         * driver.cs: Provide a new `parser verbose' to display the
18194         exception thrown during parsing.  This is turned off by default
18195         now, so the output of a failure from mcs is more graceful.
18196
18197         * namespace.cs: Track all the namespaces defined in a hashtable
18198         for quick lookup.
18199
18200         (IsNamespace): New method
18201
18202 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
18203
18204         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
18205         we know that we need to concatenate (full typename can never be
18206         null). 
18207
18208         * class.cs: ditto.
18209
18210         * statement.cs: Use a bitfield;  Do not initialize to null things
18211         which are done by the constructor by default.
18212
18213         * cs-parser.jay: bug fix, parameter was 4, not 3.
18214
18215         * expression.cs: Just use the property;
18216
18217         * statement.cs: No need for GetVariableInfo method.
18218
18219 2003-08-08  Martin Baulig  <martin@ximian.com>
18220
18221         * flowanalysis.cs (FlowReturns): This is now nested in the
18222         `FlowBranching' class.
18223         (MyBitVector): Moved this here from statement.cs.
18224         (FlowBranching.SiblingType): New enum type.
18225         (FlowBranching.CreateSibling): Added `SiblingType' argument.
18226
18227 2003-08-07  Martin Baulig  <martin@ximian.com>
18228
18229         * flowanalysis.cs (FlowBranchingType): This is now nested in the
18230         `FlowBranching' class and called `BranchingType'.
18231
18232 2003-08-07  Martin Baulig  <martin@ximian.com>
18233
18234         * flowanalysis.cs: Moved all the control flow analysis code into
18235         its own file.
18236
18237 2003-08-07  Martin Baulig  <martin@ximian.com>
18238
18239         * assign.cs (Assign.DoResolve): `target' must either be an
18240         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
18241         #37319.
18242
18243 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
18244
18245         * expression.cs (BinaryMethod): This kind of expression is created by the
18246         Binary class if it determines that the operator has to be handled
18247         by a method.
18248
18249         (BinaryDelegate): This kind of expression is created if we are
18250         dealing with a + or - operator on delegates.
18251
18252         (Binary): remove method, argumetns, and DelegateOperator: when
18253         dealing with methods, 
18254
18255         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18256
18257         * statement.cs (Block): use bitfields for the three extra booleans
18258         we had in use.   Remove unused topblock parameter.
18259
18260         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18261
18262         * assign.cs: Drop extra unneeded tests.
18263
18264 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18267
18268         * statement.cs (Foreach): Use VariableStorage instead of
18269         LocalBuilders.   
18270
18271         * codegen.cs (VariableStorage): New class used by clients that
18272         require a variable stored: locals or fields for variables that
18273         need to live across yield.
18274
18275         Maybe provide a convenience api for EmitThis+EmitLoad?
18276
18277         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18278         these bad boys.
18279
18280 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
18281
18282         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18283         RemapParameterLValue): New methods that are used to turn a
18284         precomputed FieldInfo into an expression like this:
18285
18286                 instance.FieldInfo
18287
18288         The idea is to use this instead of making LocalVariableReference
18289         have more than one meaning.
18290
18291         * cs-parser.jay: Add error production to BASE.
18292
18293         * ecore.cs: Deal with TypeManager.GetField returning null, which
18294         is now a valid return value.
18295
18296         (FieldExprNoAddress): New expression for Fields whose address can
18297         not be taken.
18298
18299         * expression.cs (LocalVariableReference): During the resolve
18300         phases, create new expressions if we are in a remapping context.
18301         Remove code that dealt with remapping here.
18302
18303         (ParameterReference): same.
18304
18305         (ProxyInstance): New expression, like the `This' expression, but
18306         it is born fully resolved.  We know what we are doing, so remove
18307         the errors that are targeted to user-provided uses of `this'.
18308
18309         * statement.cs (Foreach): our variable is now stored as an
18310         Expression;  During resolution, follow the protocol, dont just
18311         assume it will return this.
18312
18313 2003-08-06  Martin Baulig  <martin@ximian.com>
18314
18315         * support.cs (SeekableStreamReader.cs): New public class.
18316
18317         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18318         SeekableStreamReader instead of the normal StreamReader.
18319
18320 2003-08-04  Martin Baulig  <martin@ximian.com>
18321
18322         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18323         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18324         deambiguate casts and delegate invocations.
18325         (parenthesized_expression): Use the new tokens to ensure this is
18326         not a cast of method invocation.
18327
18328         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18329         when reading a `)' and Deambiguate_CloseParens () was previously
18330         called.
18331
18332         * expression.cs (ParenthesizedExpression): New class.  This is
18333         just used for the CS0075 test.
18334         (Binary.DoResolve): Check for CS0075.   
18335
18336 2003-07-29  Ravi Pratap  <ravi@ximian.com>
18337
18338         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18339         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18340         reference comparison.
18341
18342         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18343         examine the ReturnType for equality - this is necessary in the
18344         cases of implicit and explicit operators whose signature also
18345         includes the return type.
18346
18347 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
18348
18349         * namespace.cs: Cache the result of the namespace computation,
18350         instead of computing it every time.
18351
18352 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
18353
18354         * decl.cs: Use a global arraylist that we reuse over invocations
18355         to avoid excesive memory consumption.  Reduces memory usage on an
18356         mcs compile by one meg (45 average).
18357
18358         * typemanager.cs (LookupTypeReflection): In .NET pointers are
18359         private, work around that.
18360
18361 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
18362
18363         * literal.cs (IntLiteral): Define Zero and One static literals. 
18364
18365         * cs-parser.jay (integer_literal): use static literals to reduce
18366         memory usage for the most used literals (0, 1 and -1).  211kb
18367         reduced in memory usage.
18368
18369         Replace all calls to `new ArrayList' with `new
18370         ArrayList(4)' which is a good average number for most allocations,
18371         and also requires only 16 bytes of memory for its buffer by
18372         default. 
18373
18374         This reduced MCS memory usage in seven megabytes for the RSS after
18375         bootstrapping.
18376
18377 2003-07-28  Ravi Pratap  <ravi@ximian.com>
18378
18379         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18380         handle params methods the correct way by forming only one
18381         applicable set with params and normal methods in them. Earlier we
18382         were looking at params methods only if we found no normal methods
18383         which was not the correct thing to do.
18384
18385         (Invocation.BetterFunction): Take separate arguments indicating
18386         when candidate and the best method are params methods in their
18387         expanded form.
18388
18389         This fixes bugs #43367 and #46199.
18390
18391         * attribute.cs: Documentation updates.
18392
18393         (CheckAttribute): Rename to CheckAttributeTarget.
18394         (GetValidPlaces): Rename to GetValidTargets.
18395
18396         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18397         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18398
18399         Fixes bug #44468.
18400
18401 2003-07-28  Martin Baulig  <martin@ximian.com>
18402
18403         * class.cs (TypeContainer.DefineMembers): Use the base type's full
18404         name when looking up the base class of a nested class.  Fixes #46977.
18405
18406 2003-07-26  Martin Baulig  <martin@ximian.com>
18407
18408         * expression.cs (Indexers.Indexer): New nested struct; contains
18409         getter, setter and the indexer's type.
18410         (Indexers.Properties): This is now an ArrayList of
18411         Indexers.Indexer's.
18412         (IndexerAccess.DoResolveLValue): Correctly set the type if the
18413         indexer doesn't have any getters.
18414
18415         * assign.cs (Assign.DoResolve): Also do the implicit conversions
18416         for embedded property and indexer assignments.
18417
18418 2003-07-26  Martin Baulig  <martin@ximian.com>
18419
18420         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18421         preprocessor directive is not the first non-whitespace character
18422         on a line.
18423
18424 2003-07-26  Martin Baulig  <martin@ximian.com>
18425
18426         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18427         namespace parsing, follow the spec more closely.
18428
18429         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18430         NamespaceEntry.Lookup().
18431
18432 2003-07-25  Martin Baulig  <martin@ximian.com>
18433
18434         * MethodCore.cs (OverridesSomething): New public field; it's set
18435         from TypeContainer.DefineMembers if this method overrides
18436         something (which doesn't need to be a method).  Fix #39462.
18437
18438 2003-07-25  Ravi Pratap  <ravi@ximian.com>
18439
18440         * typemanager.cs (GetMembers): Ensure that the list of members is
18441         reversed. This keeps things in sync.
18442
18443         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18444         find an AttributeUsage attribute.
18445
18446         * expression.cs (Invocation.OverloadResolve): Perform the check
18447         which disallows Invoke to be directly called on a Delegate.
18448
18449         (Error_InvokeOnDelegate): Report error cs1533.
18450
18451 2003-07-25  Martin Baulig  <martin@ximian.com>
18452
18453         * expression.cs (Indexers.GetIndexersForType): Only look in the
18454         interface hierarchy if the requested type is already an
18455         interface.  Fixes #46788 while keeping #46502 fixed.
18456
18457 2003-07-25  Martin Baulig  <martin@ximian.com>
18458
18459         * class.cs (TypeContainer.DefineMembers): Check whether all
18460         readonly fields have been assigned and report warning CS0649 if
18461         not.
18462
18463         * statement.cs (LocalInfo.IsFixed): Always return true if this is
18464         a valuetype.
18465
18466 2003-07-24  Ravi Pratap  <ravi@ximian.com>
18467
18468         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18469         returned from GetMethods to make things consistent with the
18470         assumptions MCS makes about ordering of methods.
18471
18472         This should comprehensively fix bug #45127 and it does :-)
18473
18474         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18475         ordering is actually reverse.
18476
18477         * Clean up some debug messages I left lying around.
18478
18479         * interface.cs (Populate*): Get rid of code which emits attributes
18480         since the stage in which we emit attributes is the 'Emit' stage,
18481         not the define stage.
18482
18483         (Emit): Move attribute emission for interface members here.
18484
18485 2003-07-22  Ravi Pratap  <ravi@ximian.com>
18486
18487         * expression.cs (Invocation.OverloadResolve): Follow the spec more
18488         closely: we eliminate methods in base types when we have an
18489         applicable method in a top-level type.
18490
18491         Please see section 14.5.5.1 for an exact description of what goes
18492         on. 
18493
18494         This fixes bug #45127 and a host of other related to corlib compilation.
18495
18496         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
18497         array is the method corresponding to the top-level type (this is
18498         because of the changes made to icall.c) so we change this
18499         accordingly.
18500
18501         (MethodGroupExpr.Name): This too.
18502
18503         * typemanager.cs (GetElementType): New method which does the right
18504         thing when compiling corlib. 
18505
18506         * everywhere: Make use of the above in the relevant places.
18507
18508 2003-07-22  Martin Baulig  <martin@ximian.com>
18509
18510         * cs-parser.jay (invocation_expression): Moved
18511         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
18512         `cast_expression', but create a InvocationOrCast which later
18513         resolves to either an Invocation or a Cast.
18514
18515         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
18516         method; call this before EmitStatement() to make sure that this
18517         expression can be used as a statement.
18518
18519         * expression.cs (InvocationOrCast): New class; resolves to either
18520         an Invocation or a Cast.
18521
18522         * statement.cs (StatementExpression): Call ResolveStatement() on
18523         the ExpressionStatement before emitting it.
18524
18525 2003-07-21  Martin Baulig  <martin@ximian.com>
18526
18527         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
18528         `ref' and `out' attributes match; fixes #46220.
18529         (MemberAccess.ResolveMemberAccess): You can't reference a type
18530         through an expression; fixes #33180.
18531         (Indexers.GetIndexersForType): Don't return the indexers from
18532         interfaces the class implements; fixes #46502.
18533
18534 2003-07-21  Martin Baulig  <martin@ximian.com>
18535
18536         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
18537         CS0661 checks; fixes bug #30442.
18538
18539 2003-07-21  Martin Baulig  <martin@ximian.com>
18540
18541         * decl.cs (AdditionResult): Added `Error'.
18542
18543         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
18544
18545         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
18546         makes cs0031.cs actually work.
18547
18548 2003-07-20  Martin Baulig  <martin@ximian.com>
18549
18550         * namespace.cs: Fixed that bug which caused a crash when compiling
18551         the debugger's GUI.
18552
18553 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
18554
18555         * typemanager.cs (LookupTypeReflection): Never expose types which
18556         are NotPublic, NestedPrivate, NestedAssembly, or
18557         NestedFamANDAssem.  We used to return these, and later do a check
18558         that would report a meaningful error, but the problem is that we
18559         would not get the real match, if there was a name override.
18560
18561 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
18562
18563         * namespace.cs (Namespace, Name): Do not compute the namespace
18564         name dynamically, compute it in the constructor.  This reduced
18565         memory usage by 1697 KB.
18566
18567         * driver.cs: Use --pause to pause at the end.
18568
18569 2003-07-17  Peter Williams  <peter@newton.cx>
18570
18571         * Makefile: Change the name of the test target so that it doesn't
18572         conflict with the recursive test target.
18573
18574 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
18575
18576         * expression.cs (LocalVariableReference.Emit, EmitAssign,
18577         AddressOf): Do not use EmitThis, that was wrong, use the actual
18578         this pointer.
18579
18580 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
18581
18582         * class.cs (MethodData.Define): While checking if a method is an
18583         interface implementation, improve the test: If we are not public
18584         (use new test here: use the computed MethodAttributes directly,
18585         instead of the parsed modifier flags) check if the `implementing'
18586         method comes from an interface or not.
18587
18588         * pending.cs (VerifyPendingMethods): Slightly better error
18589         message.
18590
18591         * makefile: add test target that does the mcs bootstrap.
18592
18593 2003-07-16  Ravi Pratap  <ravi@ximian.com>
18594
18595         * interface.cs (Define): Do nothing here since there are no
18596         members to populate etc. Move the attribute emission out of here
18597         since this was just totally the wrong place to put it. Attribute
18598         application happens during the 'Emit' phase, not in the 'Define'
18599         phase.
18600
18601         (Emit): Add this method and move the attribute emission here
18602
18603         * rootcontext.cs (EmitCode): Call the Emit method on interface
18604         types too.
18605
18606 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
18607
18608         * expression.cs (OverloadResolve): Report error only if Location
18609         is not 'Null' which means that there was a probe going on.
18610
18611 2003-07-14  Martin Baulig  <martin@ximian.com>
18612
18613         * expression.cs (ConditionalLogicalOperator): New public class to
18614         implement user defined conditional logical operators.
18615         This is section 14.11.2 in the spec and bug #40505.
18616
18617 2003-07-14  Martin Baulig  <martin@ximian.com>
18618
18619         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
18620
18621 2003-07-14  Martin Baulig  <martin@ximian.com>
18622
18623         * codegen.cs (EmitContext.InFixedInitializer): New public field.
18624
18625         * ecore.cs (IVariable.VerifyFixed): New interface method.
18626
18627         * expression.cs (Unary.ResolveOperator): When resolving the `&'
18628         operator, check whether the variable is actually fixed.  Fixes bug
18629         #36055.  Set a variable definitely assigned when taking its
18630         address as required by the spec.
18631
18632         * statement.cs (LocalInfo.IsFixed): New field.
18633         (LocalInfo.MakePinned): Set `IsFixed' to true.
18634
18635 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
18636
18637         * attribute.cs (Attribute.Resolve): While doing a Member lookup
18638         for .ctors, ensure that we only ask for members declared in the
18639         attribute type (BindingFlags.DeclaredOnly).
18640
18641         Fixes bug #43632.
18642
18643         * expression.cs (Error_WrongNumArguments): Report error 1501
18644         correctly the way CSC does.
18645
18646 2003-07-13  Martin Baulig  <martin@ximian.com>
18647
18648         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
18649         lookup on the fully qualified name, to make things like "X.X" work
18650         where "X.X" is a fully qualified type name, but we also have a
18651         namespace "X" in the using list.  Fixes #41975.
18652
18653 2003-07-13  Martin Baulig  <martin@ximian.com>
18654
18655         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
18656         function. If we're a CompoundAssign, we need to create an embedded
18657         CompoundAssign, not an embedded Assign.
18658         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
18659         Fixes #45854.
18660
18661 2003-07-13  Martin Baulig  <martin@ximian.com>
18662
18663         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
18664         work to fix bug #46088.
18665
18666 2003-07-13  Ravi Pratap <ravi@ximian.com>
18667
18668         * class.cs (Operator.Emit): Do not emit attributes here - it is
18669         taken care of by the Method class that we delegate too. This takes
18670         care of bug #45876.
18671
18672 2003-07-10  Martin Baulig  <martin@ximian.com>
18673
18674         * expression.cs (TypeOfVoid): New class.
18675         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
18676
18677 2003-07-10  Martin Baulig  <martin@ximian.com>
18678
18679         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
18680         bug #35957.
18681
18682 2003-07-10  Martin Baulig  <martin@ximian.com>
18683
18684         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
18685         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
18686
18687         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
18688
18689         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
18690
18691 2003-07-10  Martin Baulig  <martin@ximian.com>
18692
18693         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
18694         of decimal.  Fixes #42850.
18695
18696         NOTE: I also fixed the created byte blob, but this doesn't work on
18697         the MS runtime and csc never produces any byte blobs for decimal
18698         arrays.
18699
18700 2003-07-10  Martin Baulig  <martin@ximian.com>
18701
18702         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
18703         structs; fixes #32068.
18704         (Block.AddChildVariableNames): Fixed #44302.
18705
18706 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18707
18708         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
18709
18710 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18711
18712         * attribute.cs: And this test is onger needed.
18713
18714 2003-07-08  Martin Baulig  <martin@ximian.com>
18715
18716         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
18717         inaccessible types.  Fixes #36313.
18718
18719         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
18720
18721         * namespace.cs (NamespaceEntry): Create implicit entries for all
18722         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
18723         implicit entries for N1.N2 and N1.
18724
18725 2003-07-08  Martin Baulig  <martin@ximian.com>
18726
18727         Rewrote the handling of namespaces to fix a lot of the issues
18728         wrt. `using' aliases etc.
18729
18730         * namespace.cs (Namespace): Splitted this class into a
18731         per-assembly `Namespace' and a per-file `NamespaceEntry'.
18732
18733         * typemanager.cs (TypeManager.IsNamespace): Removed.
18734         (TypeManager.ComputeNamespaces): Only compute namespaces from
18735         loaded assemblies here, not the namespaces from the assembly we're
18736         currently compiling.
18737
18738 2003-07-08  Martin Baulig  <martin@ximian.com>
18739
18740         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
18741
18742 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
18745         already fixed it.  
18746
18747         I thought about the memory savings here, but LookupTypeReflection
18748         is used under already very constrained scenarios.  Compiling
18749         corlib or mcs only exposes one hit, so it would not really reduce
18750         any memory consumption.
18751
18752 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18753
18754         * typemanager.cs: fixes bug #45889 by only adding public types from
18755         other assemblies to the list of known types.
18756
18757 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18758
18759         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
18760         on the type we resolved.
18761
18762 2003-07-05  Martin Baulig  <martin@ximian.com>
18763
18764         * pending.cs (PendingImplementation.ParentImplements): Don't
18765         create the proxy if the parent is abstract.
18766
18767         * class.cs (TypeContainer.DefineIndexers): Process explicit
18768         interface implementations first.  Fixes #37714.
18769
18770 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
18771
18772         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
18773         defined recursively;  but since we modify the input parameters
18774         (left is set to `this' temporarily), we reset this value if the
18775         left_is_explicit is false, which gives the original semantics to
18776         the code.  
18777
18778         * literal.cs (NullPointer): new class used to represent a null
18779         literal in a pointer context.
18780
18781         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
18782         type is a pointer, use a NullPointer object instead of a
18783         NullLiteral.   Closes 43687
18784
18785         (ExplicitConversion): Convert pointer values using
18786         the conv opcode to the proper type.
18787
18788         * ecore.cs (New): change ValueTypeVariable property into a method,
18789         that returns whether the valuetype is suitable for being used.
18790
18791         * expression.cs (Binary.DoNumericPromotions): Only return if we
18792         the int constant was a valid uint, and we can return both left and
18793         right as uints.  If not, we continue processing, to trigger the
18794         type conversion.  This fixes 39018.
18795
18796         * statement.cs (Block.EmitMeta): During constant resolution, set
18797         the CurrentBlock property on the emitcontext, so that we resolve
18798         constants propertly.
18799
18800 2003-07-02  Martin Baulig  <martin@ximian.com>
18801
18802         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
18803         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
18804
18805         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
18806         than emitting it here.
18807
18808         * statement.cs: Fixed some more flow analysis bugs.
18809
18810 2003-07-02  Martin Baulig  <martin@ximian.com>
18811
18812         * class.cs (MethodData.Define): When implementing interface
18813         methods, set Final unless we're Virtual.
18814
18815         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
18816         check work for interface methods.
18817
18818 2003-07-01  Martin Baulig  <martin@ximian.com>
18819
18820         * ecore.cs (EmitContext.This): Replaced this property with a
18821         GetThis() method which takes a Location argument.  This ensures
18822         that we get the correct error location for a CS0188.
18823
18824 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
18827         ImplicitStandardConversion.
18828
18829         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
18830
18831 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
18832
18833         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
18834         optimization.
18835
18836 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
18837
18838         * class.cs (Constructor.Define): Turn off initlocals for unsafe
18839         constructors.
18840
18841         (MethodData.Define): Turn off initlocals for unsafe methods.
18842
18843 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
18844
18845         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
18846         complete;  Fixes #37521.
18847
18848         * delegate.cs: Use Modifiers.TypeAttr to compute the
18849         TypeAttributes, instead of rolling our own.  This makes the flags
18850         correct for the delegates.
18851
18852 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
18853
18854         * class.cs (Constructor.Define): Set the private flag for static
18855         constructors as well.
18856
18857         * cs-parser.jay (statement_expression): Set the return value to
18858         null, to avoid a crash when we catch an error.
18859
18860 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * cs-parser.jay: Applied patch from Jackson that adds support for
18863         extern and unsafe modifiers to destructor declarations.
18864
18865         * expression.cs: Report error 21 if the user is trying to index a
18866         System.Array.
18867
18868         * driver.cs: Add an error message, suggested by the bug report.
18869
18870         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
18871         if we do not have a ": this ()" constructor initializer.  Fixes 45149
18872
18873 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * namespace.cs: Add some information to reduce FAQs.
18876
18877 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
18878
18879         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
18880         underlying enumeration types.  Fixes #43915.
18881
18882         * expression.cs: Treat ushort/short as legal values to be used in
18883         bitwise operations.
18884
18885 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
18886
18887         * delegate.cs: transfer custom attributes for paramenters from
18888         the delegate declaration to Invoke and BeginInvoke.
18889
18890 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
18891
18892         * attribute.cs: handle custom marshalers and emit marshal info
18893         for fields, too.
18894
18895 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
18896
18897         * makefile.gnu: Added anonymous.cs to the compiler sources.
18898
18899 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
18900
18901         * iterators.cs: Change the name of the proxy class to include two
18902         underscores.
18903
18904         * cs-parser.jay: Update grammar to include anonymous methods.
18905
18906         * anonymous.cs: new file.
18907
18908 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
18909
18910         * class.cs (Field.Define): Add missing test for pointers and
18911         safety. 
18912
18913 2003-05-27  Ravi Pratap  <ravi@ximian.com>
18914
18915         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
18916         we use the stobj opcode.
18917
18918         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
18919         since it wasn't the correct fix. 
18920
18921         It still is puzzling that we are required to use stobj for IntPtr
18922         which seems to be a ValueType.
18923
18924 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
18925
18926         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
18927         during regular simple name resolution.   Now, the trick is that
18928         instead of returning for processing the simplename, we do a
18929         TypeManager.LookupType (ie, a rooted lookup as opposed to a
18930         contextual lookup type).   If a match is found, return that, if
18931         not, return for further composition.
18932
18933         This fixes long-standing 30485.
18934
18935         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18936         using the address to initialize an object, do an Stobj instead of
18937         using the regular Stelem.
18938
18939         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18940         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18941         Because if we are a BaseIndexerAccess that value will be true.
18942         Fixes 43643.
18943
18944         * statement.cs (GotoCase.Resolve): Return after reporting an
18945         error, do not attempt to continue. 
18946
18947         * expression.cs (PointerArithmetic.Emit): If our operand is a
18948         long, convert our constants to match the operand before
18949         multiplying.  Convert to I type before adding.   Fixes 43670.
18950
18951 2003-05-14  Ravi Pratap  <ravi@ximian.com>
18952
18953         * enum.cs (ImplicitConversionExists) : Rename to
18954         ImplicitEnumConversionExists to remove ambiguity. 
18955
18956         * ecore.cs (NullCast): New type of cast expression class which
18957         basically is very similar to EmptyCast with the difference being
18958         it still is a constant since it is used only to cast a null to
18959         something else
18960         (eg. (string) null)
18961
18962         * convert.cs (ImplicitReferenceConversion): When casting a null
18963         literal, we return a NullCast.
18964
18965         * literal.cs (NullLiteralTyped): Remove - I don't see why this
18966         should be around anymore.
18967
18968         The renaming (reported was slightly wrong). Corrections:
18969
18970         ConvertImplicitStandard -> ImplicitConversionStandard
18971         ConvertExplicitStandard -> ExplicitConversionStandard
18972
18973         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18974         before passing them in !
18975
18976         * convert.cs (ImplicitConversionStandard): When comparing for
18977         equal expr and target types, ensure that expr is not a
18978         NullLiteral.
18979
18980         In general, we must not be checking (expr_type ==
18981         target_type) in the top level conversion methods
18982         (ImplicitConversion, ExplicitConversion etc). This checking is
18983         done in the methods that they delegate to.
18984
18985 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
18986
18987         * convert.cs: Move Error_CannotConvertType,
18988         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18989         ImplicitNumericConversion, ImplicitConversionExists,
18990         ImplicitUserConversionExists, StandardConversionExists,
18991         FindMostEncompassedType, FindMostSpecificSource,
18992         FindMostSpecificTarget, ImplicitUserConversion,
18993         ExplicitUserConversion, GetConversionOperators,
18994         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18995         TryImplicitIntConversion, Error_CannotConvertImplicit,
18996         ConvertImplicitRequired, ConvertNumericExplicit,
18997         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18998         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18999         its own file.
19000
19001         Perform the following renames:
19002
19003         StandardConversionExists -> ImplicitStandardConversionExists
19004         ConvertImplicit -> ImplicitConversion
19005         ConvertImplicitStandard -> ImplicitStandardConversion
19006         TryImplicitIntConversion -> ImplicitIntConversion
19007         ConvertImplicitRequired -> ImplicitConversionRequired
19008         ConvertNumericExplicit -> ExplicitNumericConversion
19009         ConvertReferenceExplicit -> ExplicitReferenceConversion
19010         ConvertExplicit -> ExplicitConversion
19011         ConvertExplicitStandard -> ExplicitStandardConversion
19012
19013 2003-05-19  Martin Baulig  <martin@ximian.com>
19014
19015         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19016         (TypeInfo): Added support for structs having structs as fields.
19017
19018         * ecore.cs (FieldExpr): Implement IVariable.
19019         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19020         VariableInfo for the field.
19021
19022 2003-05-18  Martin Baulig  <martin@ximian.com>
19023
19024         * expression.cs (This.DoResolve): Report a CS0027 if we're
19025         emitting a field initializer.
19026
19027 2003-05-18  Martin Baulig  <martin@ximian.com>
19028
19029         * expression.cs (This.ResolveBase): New public function.
19030         (This.DoResolve): Check for CS0188.
19031
19032         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19033         This.Resolve().
19034
19035         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19036         `instance_expression' to null if we don't have any non-static
19037         methods.
19038
19039 2003-05-18  Martin Baulig  <martin@ximian.com>
19040
19041         Reworked the way how local variables and parameters are handled by
19042         the flow analysis code.
19043
19044         * statement.cs (TypeInfo, VariableMap): New public classes.
19045         (VariableInfo): New public class.  This is now responsible for
19046         checking whether a variable has been assigned.  It is used for
19047         parameters and local variables.
19048         (Block.EmitMeta): Take the InternalParameters as argument; compute
19049         the layout of the flow vectors here.
19050         (Block.LocalMap, Block.ParameterMap): New public properties.
19051         (FlowBranching): The .ctor doesn't get the InternalParameters
19052         anymore since Block.EmitMeta() now computes the layout of the flow
19053         vector.
19054         (MyStructInfo): This class is now known as `StructInfo' and nested
19055         in `TypeInfo'; we don't access this directly anymore.
19056
19057         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19058         property and removed IsAssigned(), IsFieldAssigned(),
19059         SetAssigned() and SetFieldAssigned(); we now call them on the
19060         VariableInfo so we don't need to duplicate this code everywhere.
19061
19062         * expression.cs (ParameterReference): Added `Block block' argument
19063         to the .ctor.
19064         (LocalVariableReference, ParameterReference, This): The new
19065         VariableInfo class is now responsible for all the definite
19066         assignment stuff.
19067
19068         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19069         IsParameterAssigned, SetParameterAssigned): Removed.
19070
19071 2003-05-18  Martin Baulig  <martin@ximian.com>
19072
19073         * typemanager.cs (InitCoreTypes): Try calling
19074         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19075         the 3-args-version.  Corlib now also needs our `void_type'.
19076         (GetMethod): Added overloaded version which takes an optional
19077         `bool report_errors' to allow lookups of optional methods.
19078
19079 2003-05-12  Martin Baulig  <martin@ximian.com>
19080
19081         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19082         only used for locals and not for parameters.
19083
19084 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19085
19086         * support.cs (InternalParameters.ParameterType): Return the
19087         ExternalType of the parameter.
19088
19089         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19090         they were unused.
19091
19092 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19093
19094         * class.cs (MethodData.Define): Do not set the `newslot' on
19095         interface members, if they are also flagged as "override".
19096
19097         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19098         better code for ++i and i++.  This only works for static fields
19099         and local variables.
19100
19101         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19102         want to pull the DeclSpace out of the builder_to_declspace instead
19103         of the TypeBuilder (like in TypeContainer.FindMembers).
19104
19105         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19106         instead of LookupTypeContainer.  Fixes the crash on .NET for
19107         looking up interface members.
19108
19109         * const.cs: Create our own emit context during the Definition
19110         stage, so that constants are evaluated in the proper context, when
19111         a recursive definition happens.
19112
19113 2003-05-11  Martin Baulig  <martin@ximian.com>
19114
19115         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19116         new block for a switch section.
19117         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19118         the adding/lookup in the switch block.  Fixes #39828.
19119
19120 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19123         functionality: I needed to convert the data after I had performed
19124         the add/sub operation into the operands type size.
19125
19126         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19127         pass the type for the box operation, otherwise the resulting
19128         object would have been of type object.
19129
19130         (BoxedCast): Add constructor to specify the type to box as.
19131
19132 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
19133
19134         * iterators.cs: I was reusing the `count' variable inadvertently,
19135         take steps to not allow this to happen.
19136
19137 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
19138
19139         * attribute.cs (Attribute.Resolve): Params attributes are encoded
19140         by creating an array at the point where the params starts and
19141         putting all those arguments there, then adjusting the size of the
19142         array.
19143
19144 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * expression.cs (New.AddressOf): Implement interface
19147         IMemoryLocation.  This is used when the `new' operator is used in
19148         the context of an invocation to a method on a value type.
19149
19150         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19151         example. 
19152
19153         * namespace.cs: Also check the using aliases here.
19154
19155         * driver.cs: Move the test for using validity after the types have
19156         been entered, so we do a single pass that also includes the using
19157         aliases. 
19158
19159         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19160         in the regular case.   CreateSiblingForFinally is doing extra
19161         error checking.
19162
19163         * attribute.cs (GetAttributeArgumentExpression): Store the result
19164         on an out value, and use the return value to indicate failure
19165         instead of using null (which is a valid return for Constant.GetValue).
19166
19167         * statement.cs: Perform the analysis flow for the increment
19168         portion after the statement, because this will be the real flow of
19169         execution.  Fixes #42385
19170
19171         * codegen.cs (EmitContext.EmitArgument,
19172         EmitContext.EmitStoreArgument): New helper functions when the
19173         RemapToProxy flag is set.
19174
19175         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19176         function.
19177
19178         Add support for remapping parameters. 
19179
19180         * iterators.cs: Propagate parameter values;  Store parameter
19181         values in the proxy classes.
19182
19183 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
19184
19185         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
19186         need a proxy reference;  I do not know what I was thinking
19187
19188         * cs-parser.jay (constructor_initializer): catch another error,
19189         and display nice message.
19190
19191         (field_declaration): catch void field declaration
19192         to flag a better error. 
19193
19194         * class.cs (MemberBase.CheckBase): Report an error instead of a
19195         warning if a new protected member is declared in a struct. 
19196         (Field.Define): catch the error of readonly/volatile.
19197
19198         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19199
19200         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
19201         volatile variable is taken
19202
19203 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
19204
19205         * statement.cs (Fixed.Resolve): Report an error if we are not in
19206         an unsafe context.
19207
19208 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
19209
19210         * typemanager.cs: reuse the code that handles type clashes for
19211         delegates and enumerations.
19212
19213         * class.cs (Report28): Always report.
19214
19215         * expression.cs (EncodeAsAttribute): Allow nulls here.
19216
19217 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
19218
19219         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19220         the functionality for testing whether an expression is valid for
19221         an attribute here.  Also handle the case of arrays of elements
19222         being stored. 
19223
19224         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19225         encoding a linear array into an array of objects that are suitable
19226         to be passed to an CustomAttributeBuilder.
19227
19228         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19229
19230         * ecore.cs: (FieldExpr): Handle field remapping here.
19231
19232         * iteratators.cs: Pass the instance variable (if the method is an
19233         instance method) to the constructors, so we can access the field
19234         variables on the class.
19235
19236         TODO: Test this with structs.  I think the THIS variable on
19237         structs might have to be a pointer, and not a refenrece
19238
19239 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
19240
19241         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19242         local variables to fields in a proxy class.
19243
19244         * iterators.cs (PopulateProxy): Rename our internal fields to
19245         <XXX>.  
19246         Create a <THIS> field if we are an instance method, so we can
19247         reference our parent container variables.
19248         (MapVariable): Called back from the EmitContext code to enter a
19249         new variable to field mapping into the proxy class (we just create
19250         a FieldBuilder).
19251
19252         * expression.cs
19253         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19254         for using the remapped locals to fields.
19255
19256         I placed the code here, because that gives the same semantics to
19257         local variables, and only changes the Emit code.
19258
19259         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19260         statements inside iterators.
19261         (VariableInfo): Add a FieldBuilder for the cases when we are
19262         remapping local variables to fields in a proxy class
19263
19264         * ecore.cs (SimpleNameResolve): Avoid testing two times for
19265         current_block != null.
19266
19267         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19268         not cope with strings, as it has been moved to the
19269         TableSwitchEmit.  Fixed bug in switch generation.
19270
19271         * expression.cs (New.DoResolve): Provide more context for the user
19272         when reporting an error.
19273
19274         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19275         pointers. 
19276
19277         * expression.cs (MemberAccess.DoResolve): When we get a type back,
19278         check the permissions for it.  Note than in a type-resolution
19279         context the check was already present in DeclSpace.ResolveType,
19280         but was missing from the MemberAccess.
19281
19282         (ArrayCreation.CheckIndices): warn if the user has
19283         more nested levels of expressions, but there are no more
19284         dimensions specified.  Avoids crash on bug 41906.
19285
19286 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * statement.cs (Block): replace Implicit bool, for a generic
19289         flags.   
19290         New flag: `Unchecked'.  This is used during the EmitMeta phase
19291         (which is out-of-line with the regular Resolve/Emit process for a
19292         statement, as this is done ahead of time, but still gets a chance
19293         to call constant resolve).
19294
19295         (Block.Flags): new enum for adding a new flag.
19296
19297         (Block.EmitMeta): track the state of unchecked.
19298
19299         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19300         to enable constant resolution to work there as well.
19301
19302 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
19303
19304         * typemanager.cs (ienumerable_type): Also look up
19305         System.Collections.IEnumerable. 
19306
19307 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
19308
19309         TODO: Test more than one conditional per method.
19310
19311         * class.cs (Indexer.Define): Report the location where the user is
19312         referencing the unsupported feature.
19313
19314         (MethodData): Overload the use of `conditionals' to
19315         minimize the creation of needless ArrayLists.   This saves roughly
19316         212kb on my machine.
19317
19318         (Method): Implement the new IIteratorContainer interface.
19319         (Method.SetYields): Implement the method by setting the ModFlags
19320         to contain METHOD_YIELDS.
19321
19322         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19323         which just got set to null.
19324
19325         * iterators.cs: New file.
19326
19327         (Yield, YieldBreak): New statements.
19328
19329         * statement.cs (Return.Resolve): Flag an error if we are used in
19330         an iterator method.
19331
19332         * codegen.cs (InIterator): New flag set if the code is being
19333         compiled in an iterator method.
19334
19335         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
19336         internal modifier, and we just use it to avoid adding extra
19337         fields, as this is seldom used.  
19338
19339         * cs-parser.jay: Add yield_statement (yield and yield break).
19340
19341         * driver.cs: New flag -v2 to turn on version 2 features. 
19342
19343         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19344         hashtable when v2 is enabled.
19345
19346 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19349         there is already a namespace defined with this name.
19350
19351         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19352         people upgraded their corlibs.
19353
19354         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19355         always use fully qualified types, no need to use the compiler
19356         front end.
19357
19358         (TypeManager.IsNamespace): Use binarysearch.
19359
19360         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19361         AddDelegate): I did not quite use the new IsValid API properly: I
19362         have to pass the short-name and the fullname.  I was passing only
19363         the basename instead of the fullname sometimes. 
19364
19365         (TypeContainer.DefineType): call NamespaceClash.
19366
19367         * interface.cs (Interface.DefineType): use NamespaceClash before
19368         defining the type.
19369
19370         * delegate.cs (Delegate.DefineType): use NamespaceClash before
19371         defining the type.
19372
19373         * enum.cs: (Enum.DefineType): use NamespaceClash before
19374         defining the type.
19375
19376         * typemanager.cs (: 3-line patch that gives us some tasty 11%
19377         speed increase.  First, use the negative_hits cache when we get a
19378         negative.  Second, add the type with its full original name
19379         instead of the new . and + encoded name (reflection uses + to
19380         separate type from a nested type).  Use LookupTypeReflection
19381         directly which bypasses the type->name hashtable (that we already
19382         know does not contain the type.
19383
19384         * decl.cs (DeclSpace.ResolveTypeExpr): track the
19385         location/container type. 
19386
19387         * driver.cs: When passing utf8, use directly the UTF8Encoding.
19388
19389 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
19390
19391         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19392
19393         * delegate.cs (NewDelegate.Resolve): Test whether an instance
19394         method is being referenced in the method group from a static
19395         context, and report error 120 if so.
19396
19397         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19398         Error118. 
19399
19400         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19401         is created, we create the A namespace).
19402
19403         * cs-parser.jay: A namespace also introduces a DeclarationFound.
19404         Fixes #41591
19405
19406 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
19407
19408         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19409         invocation to ModuleBuilder.GetType with the same values will
19410         return a new type instance, so we need to cache its return
19411         values. 
19412
19413         * expression.cs (Binary.ResolveOperator): Only allow the compare
19414         operators on enums if they are of the same type.
19415
19416         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19417         types of ValueType on their own case.  Before we were giving them
19418         the same treatment as objects.
19419
19420         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19421         fullname.  Short name is used to compare against container name.
19422         Fullname is used to check against defined namespace names.
19423
19424         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19425         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19426
19427         (Method.CheckBase): Call parent.
19428         (MemberBase.CheckBase): Check for protected members on sealed
19429         classes.
19430         (PropertyBase.CheckBase): Call parent.
19431         (Field.Define): Call parent.
19432
19433         * report.cs: Negative error codes are now mapped to 8000 - code,
19434         so that the display is render more nicely.
19435
19436         * typemanager.cs: Do not use try/catch, instead report a regular
19437         error. 
19438
19439         (GetPointerType, GetReferenceType): These methods provide
19440         mechanisms to obtain the T* and T& from a T.  We had the code
19441         previously scattered around the code base, and it also used
19442         TypeManager.LookupType that would go through plenty of caches.
19443         This one goes directly to the type source.
19444
19445         In some places we did the Type.GetType followed by
19446         ModuleBuilder.GetType, but not in others, so this unifies the
19447         processing as well.
19448
19449         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19450         statements now that we have namespace information.
19451
19452         * typemanager.cs (IsNamespace): New method, returns whether the
19453         string presented is a namespace or not.
19454
19455         (ComputeNamespaces): New public entry point, computes the list of
19456         available namespaces, using the GetNamespaces API call in Mono, or
19457         the slower version in MS.NET.   
19458
19459         Now before we start the semantic analysis phase, we have a
19460         complete list of namespaces including everything that the user has
19461         provided.
19462
19463         Deleted old code to cache namespaces in .nsc files.
19464
19465 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
19466
19467         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19468         class/struct location definition Location for the implicit
19469         constructor location.
19470
19471         (Operator.Define): Use the location of the operator for the
19472         implicit Method definition.
19473
19474         (Constructor.Emit): use the constructor location for the implicit
19475         base initializer constructor.
19476
19477         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
19478         and the Expression class now contains two new methods:
19479
19480         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
19481         isolate type lookup from the rest of the resolution process.
19482
19483         Since we use Expressions to hold type definitions due to the way
19484         we parse the input we have historically overloaded Resolve to
19485         perform the Type lookups if a special flag is passed.  Now this is
19486         eliminated and two methods take their place. 
19487
19488         The differences in the two methods between xStep and xTerminal is
19489         that xStep is involved in our current lookup system that uses
19490         SimpleNames to compose a name, while xTerminal is used just to
19491         catch the case where the simplename lookup failed.
19492
19493 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
19494
19495         * expression.cs (ResolveMemberAccess): Remove redundant code.
19496         TypeExpr expressions are always born fully resolved.
19497
19498         * interface.cs (PopulateMethod): Do not lookup the types twice.
19499         We were doing it once during SemanticAnalysis and once during
19500         PopulateMethod.
19501
19502         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
19503         in local variable type definitions, were being returned as a
19504         SimpleName (we decomposed everything into a string), that is
19505         because primary_expression was being used instead of a type in the
19506         grammar (reduce/reduce conflicts).
19507
19508         The part that was wrong is that we converted the expression into a
19509         string (an oversimplification in one hand, compounded with primary
19510         expressions doing string concatenation).
19511
19512         So things like:
19513
19514         A.B.C [] x;
19515
19516         Would return "A.B.C[]" as a SimpleName.  This stopped things like
19517         using clauses from working on this particular context.  And a type
19518         was being matched directly against "A.B.C[]".
19519
19520         We now use the correct approach, and allow for ComposedCast to be
19521         part of the unary expression.  So the "A.B.C []" become a composed
19522         cast of "A.B.C" (as a nested group of MemberAccess with a
19523         SimpleName at the end) plus the rank composition "[]". 
19524
19525         Also fixes 35567
19526
19527 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
19528
19529         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
19530         for the access level checking.
19531
19532         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
19533         `TypeContainer container', because I kept getting confused when I
19534         was debugging this code.
19535
19536         * expression.cs (Indexers): Instead of tracking getters/setters,
19537         we now track them in parallel.  We create one arraylist less, but
19538         most importantly it is possible now for the LValue code to find a
19539         matching get for a set.
19540
19541         (IndexerAccess.DoResolveLValue): Update the code.
19542         GetIndexersForType has been modified already to extract all the
19543         indexers from a type.  The code assumed it did not.
19544
19545         Also make the code set the correct return type for the indexer.
19546         This was fixed a long time ago for properties, but was missing for
19547         indexers.  It used to be void_type.
19548
19549         (Binary.Emit): Test first for doubles instead of
19550         floats, as they are more common.
19551
19552         (Binary.EmitBranchable): Use the .un version of the branch opcodes
19553         when dealing with floats and the <=, >= operators.  This fixes bug
19554         #39314 
19555
19556         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
19557         to load the array value by emitting a load on the foreach variable
19558         type.  This was incorrect.  
19559
19560         We now emit the code to load an element using the the array
19561         variable type, and then we emit the conversion operator.
19562
19563         Fixed #40176
19564
19565 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
19566
19567         * attribute.cs: Avoid allocation of ArrayLists in the common case.
19568
19569 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
19570
19571         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
19572         test for protection before we test for signatures. 
19573
19574         (MethodSignature.ToString): implement.
19575
19576         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
19577         to the case where we reduced into a LongConstant.
19578
19579         * decl.cs (CheckAccessLevel): If the type is an array, we can not
19580         depend on whether the information is acurrate, because the
19581         Microsoft runtime will always claim that the array type is public,
19582         regardless of the real state.
19583
19584         If the type is a pointer, another problem happens: the type is
19585         reported as non-public in Microsoft.  
19586
19587         In both cases we have to call CheckAccessLevel recursively with
19588         the underlying type as the argument to be tested.
19589
19590 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
19591
19592         * assign.cs (Assign.Emit): If we are dealing with a compound
19593         assignment expression, we should use the code path that stores the
19594         intermediate result in a temporary value.  This fixes #40903.
19595
19596         *expression.cs (Indirection.ToString): Provide ToString method for
19597         debugging. 
19598
19599 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
19600
19601         * class.cs: Null out fields holding references to Block objects so
19602         they can be garbage collected.
19603
19604         * expression.cs (OverloadResolve): Remove unused local.
19605
19606 2003-04-07  Martin Baulig  <martin@ximian.com>
19607
19608         * codegen.cs (EmitContext.CurrentFile): New public field.
19609         (EmitContext.Mark): Use the CurrentFile to check whether the
19610         location is in the correct file.
19611         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
19612
19613 2003-04-07  Martin Baulig  <martin@ximian.com>
19614
19615         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
19616
19617         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
19618         location.  [FIXME: The location argument which gets passed to this
19619         method is sometimes wrong!]
19620
19621 2003-04-07  Nick Drochak <ndrochak@gol.com>
19622
19623         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
19624
19625 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
19626
19627         * expression.cs (Indirection.EmitAssign): We were using the
19628         temporary, but returning immediately instead of continuing the
19629         EmitAssing flow.
19630
19631 2003-04-06  Martin Baulig  <martin@ximian.com>
19632
19633         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
19634         if it's a nested child, but also deriving from the outer class.
19635         See test 190.cs.
19636
19637         * typemanager.cs (IsNestedChildOf): Make this work if it's a
19638         nested child, but also deriving from the outer class.  See
19639         test-190.cs.
19640         (FilterWithClosure): We may access private members of the outer
19641         class if we're a nested child and deriving from the outer class.
19642         (RealMemberLookup): Only set `closure_private_ok' if the
19643         `original_bf' contained BindingFlags.NonPublic.
19644
19645 2003-04-05  Martin Baulig  <martin@ximian.com>
19646
19647         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
19648
19649 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
19650
19651         * class.cs (Event.Define): Do not allow abstract events to have
19652         initializers. 
19653
19654 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
19655
19656         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
19657         block in event declarations.
19658
19659         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
19660         value type, get its address.
19661
19662         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
19663         leaving a class on the stack instead of a boolean value (int
19664         0/1).  Change the code so we compare against null, and then the
19665         result against zero.
19666
19667         * class.cs (TypeContainer.GetClassBases): We were checking for the
19668         parent class being sealed too late.
19669
19670         * expression.cs (Binary.Emit): For <= and >= when dealing with
19671         floating point values, use cgt.un and clt.un instead of cgt and
19672         clt alone.
19673
19674 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
19675
19676         * statement.cs: Apply the same optimization as MS: skip the 
19677         GetEnumerator returning an IEnumerator, and use the one returning a 
19678         CharEnumerator instead. This allows us to avoid the try-finally block 
19679         and the boxing.
19680
19681 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
19682
19683         * cs-parser.jay: Attributes cannot be applied to
19684                          namespaces. Fixes #40473
19685
19686 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19687
19688         * class.cs:
19689         (Add*): check if the name is valid using the full name for constants,
19690         fields, properties and events.
19691
19692 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
19693
19694         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
19695         char constants to be part of the enumeration.
19696
19697         * expression.cs (Conditional.DoResolve): Add support for operator
19698         true. Implements the missing functionality from 14.12
19699
19700         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
19701         operator true/false as required by the spec.
19702
19703         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
19704         implicit conversion to boolean.
19705
19706         * statement.cs (Statement.ResolveBoolean): A boolean expression is
19707         also one where the type implements `operator true'. 
19708
19709         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
19710         get an expression that will invoke operator true based on an
19711         expression.  
19712
19713         (GetConversionOperators): Removed the hack that called op_True
19714         here.  
19715
19716         (Expression.ResolveBoolean): Move this from Statement.
19717
19718 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
19719
19720         * ecore.cs (FieldExpr): do not allow initialization of initonly
19721         fields on derived classes
19722
19723 2003-03-13  Martin Baulig  <martin@ximian.com>
19724
19725         * statement.cs (Block.Emit): Call ig.BeginScope() and
19726         ig.EndScope() when compiling with debugging info; call
19727         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
19728
19729 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
19730
19731         * expression.cs (Indexers): Do not construct immediately, allow
19732         for new members to be appended as we go.  Fixes 38143
19733
19734 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19735
19736         * expression.cs: save/restore context when resolving an unchecked
19737         expression.
19738
19739 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
19740
19741         * cfold.cs: Catch division by zero in modulus operator during
19742         constant folding.
19743
19744 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
19745
19746         * interface.cs (Interface.DefineMembers): Avoid defining members
19747         twice. 
19748
19749 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * driver.cs: handle the +/- options for -noconfig
19752
19753         * statement.cs (Unckeched.Resolve): Also track the state of
19754         unchecked in the Resolve phase.
19755
19756 2003-02-27  Martin Baulig  <martin@ximian.com>
19757
19758         * ecore.cs (Expression.MemberLookup): Don't create a
19759         MethodGroupExpr for something which is not a method.  Fixes #38291.
19760
19761 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
19762
19763         * class.cs (MemberBase.CheckParameters): Also check that the type
19764         is unmanaged if it is a pointer.
19765
19766         * expression.cs (SizeOf.Resolve): Add location information.
19767
19768         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
19769         a managed type is declared.
19770
19771         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
19772         parameter modifiers as well.  Fixes bug 38606
19773
19774         * class.cs: Very sad.  Am backing out the speed up changes
19775         introduced by the ArrayList -> Array in the TypeContainer, as they
19776         were not actually that much faster, and introduced a bug (no error
19777         reports on duplicated methods).
19778
19779         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
19780         source first, this will guarantee that we have a valid expression
19781         before calling in lower levels functions that will require a
19782         resolved object.  Then use this original_source in the
19783         target.ResolveLValue instead of the original source that was
19784         passed to us.
19785
19786         Another change.  Use target.Resolve instead of LValueResolve.
19787         Although we are resolving for LValues, we will let the Assign code
19788         take care of that (it will be called again from Resolve).  This
19789         basically allows code like this:
19790
19791         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
19792         class Y { void A (X x) { x [0] += o; }
19793
19794         The problem was that the indexer was trying to resolve for
19795         set_Item (idx, object o) and never finding one.  The real set_Item
19796         was set_Item (idx, X).  By delaying the process we get the right
19797         semantics. 
19798
19799         Fixes bug 36505
19800
19801 2003-02-23  Martin Baulig  <martin@ximian.com>
19802
19803         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
19804         while calling DoEmit ().
19805
19806         * codegen.cs (EmitContext.Mark): Don't mark locations in other
19807         source files; if you use the #line directive inside a method, the
19808         compiler stops emitting line numbers for the debugger until it
19809         reaches the end of the method or another #line directive which
19810         restores the original file.
19811
19812 2003-02-23  Martin Baulig  <martin@ximian.com>
19813
19814         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
19815
19816 2003-02-23  Martin Baulig  <martin@ximian.com>
19817
19818         * statement.cs (Block.AddChildVariableNames): We need to call this
19819         recursively, not just for our immediate children.
19820
19821 2003-02-23  Martin Baulig  <martin@ximian.com>
19822
19823         * class.cs (Event.Define): Always make the field private, like csc does.
19824
19825         * typemanager.cs (TypeManager.RealMemberLookup): Make events
19826         actually work, fixes bug #37521.
19827
19828 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
19829
19830         * delegate.cs: When creating the various temporary "Parameters"
19831         classes, make sure that we call the ComputeAndDefineParameterTypes
19832         on those new parameters (just like we do with the formal ones), to
19833         allow them to be resolved in the context of the DeclSpace.
19834
19835         This fixes the bug that Dick observed in Bugzilla #38530.
19836
19837 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
19838
19839         * expression.cs (ResolveMemberAccess): When resolving a constant,
19840         do not attempt to pull a constant if the value was not able to
19841         generate a valid constant.
19842
19843         * const.cs (LookupConstantValue): Do not report more errors than required.
19844
19845 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19846
19847         * expression.cs: fixes bug #38328.
19848
19849 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
19850
19851         * class.cs: Changed all the various members that can be part of a
19852         class from being an ArrayList to be an Array of the right type.
19853         During the DefineType type_list, interface_list, delegate_list and
19854         enum_list are turned into types, interfaces, delegates and enums
19855         arrays.  
19856
19857         And during the member population, indexer_list, event_list,
19858         constant_list, field_list, instance_constructor_list, method_list,
19859         operator_list and property_list are turned into their real arrays.
19860
19861         Although we could probably perform this operation earlier, for
19862         good error reporting we need to keep the lists and remove the
19863         lists for longer than required.
19864
19865         This optimization was triggered by Paolo profiling the compiler
19866         speed on the output of `gen-sample-program.pl' perl script. 
19867
19868         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
19869         not crash in methods like MemberLookupFailed that use this field.  
19870
19871         This problem arises when the compiler fails to resolve a type
19872         during interface type definition for example.
19873
19874 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
19877         inherit from System.Object, so we have to stop at null, not only
19878         when reaching System.Object.
19879
19880 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
19883         DeclaredOnly because the parent indexer might have had a different
19884         name, but did not loop until the top of the hierarchy was reached.
19885
19886         The problem this one fixes is 35492: when a class implemented an
19887         indexer from an interface, we were getting the interface method
19888         (which was abstract) and we were flagging an error (can not invoke
19889         abstract method).
19890
19891         This also keeps bug 33089 functioning, and test-148 functioning.
19892
19893         * typemanager.cs (IsSpecialMethod): The correct way of figuring
19894         out if a method is special is to see if it is declared in a
19895         property or event, or whether it is one of the predefined operator
19896         names.   This should fix correctly #36804.
19897
19898 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
19899
19900         The goal here is to remove the dependency on EmptyCast.Peel ().
19901         Killing it completely.
19902
19903         The problem is that currently in a number of places where
19904         constants are expected, we have to "probe" for an EmptyCast, and
19905         Peel, which is not the correct thing to do, as this will be
19906         repetitive and will likely lead to errors. 
19907
19908         The idea is to remove any EmptyCasts that are used in casts that
19909         can be reduced to constants, so we only have to cope with
19910         constants. 
19911
19912         This bug hunt was triggered by Bug 37363 and the desire to remove
19913         the duplicate pattern where we were "peeling" emptycasts to check
19914         whether they were constants.  Now constants will always be
19915         constants.
19916
19917         * ecore.cs: Use an enumconstant here instead of wrapping with
19918         EmptyCast.  
19919
19920         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
19921         throwing me off.  By handling this we can get rid of a few hacks.
19922
19923         * statement.cs (Switch): Removed Peel() code.
19924
19925 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * class.cs: Location information for error 508
19928
19929         * expression.cs (New.DoResolve): Add a guard against double
19930         resolution of an expression.  
19931
19932         The New DoResolve might be called twice when initializing field
19933         expressions (see EmitFieldInitializers, the call to
19934         GetInitializerExpression will perform a resolve on the expression,
19935         and later the assign will trigger another resolution
19936
19937         This leads to bugs (#37014)
19938
19939         * delegate.cs: The signature for EndInvoke should contain any ref
19940         or out parameters as well.  We were not doing this in the past. 
19941
19942         * class.cs (Field.Define): Do not overwrite the type definition
19943         inside the `volatile' group.  Turns out that volatile enumerations
19944         were changing the type here to perform a validity test, which
19945         broke conversions. 
19946
19947 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
19948
19949         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19950         and structs, we do not want to load the instance variable
19951
19952         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19953         enum_type has to be handled like an object reference (implicit
19954         conversions exists from this to object), but the regular IsClass
19955         and IsValueType tests will never return true for this one.
19956
19957         Also we use TypeManager.IsValueType instead of type.IsValueType,
19958         just for consistency with the rest of the code (this is only
19959         needed if we ever use the construct exposed by test-180.cs inside
19960         corlib, which we dont today).
19961
19962 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
19963
19964         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19965         just InternalCall.
19966
19967 2003-02-09  Martin Baulig  <martin@ximian.com>
19968
19969         * namespace.cs (Namespace..ctor): Added SourceFile argument.
19970         (Namespace.DefineNamespaces): New static public method; this is
19971         called when we're compiling with debugging to add all namespaces
19972         to the symbol file.
19973
19974         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19975         pass it to the Namespace's .ctor.
19976
19977         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19978         and MethodBase arguments; pass the namespace ID to the symwriter;
19979         pass the MethodBase instead of the token to the symwriter.
19980         (SymbolWriter.DefineNamespace): New method to add a namespace to
19981         the symbol file.
19982
19983 2003-02-09  Martin Baulig  <martin@ximian.com>
19984
19985         * symbolwriter.cs: New file.  This is a wrapper around
19986         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
19987         methods here in near future.
19988
19989 2003-02-09  Martin Baulig  <martin@ximian.com>
19990
19991         * codegen.cs (EmitContext.Mark): Just pass the arguments to
19992         ILGenerator.MarkSequencePoint() which are actually used by the
19993         symbol writer.
19994
19995 2003-02-09  Martin Baulig  <martin@ximian.com>
19996
19997         * location.cs (SourceFile): New public sealed class.  This
19998         contains the name and an index which is used in the location's token.
19999         (Location): Reserve an appropriate number of bits in the token for
20000         the source file instead of walking over that list, this gives us a
20001         really huge performance improvement when compiling with debugging.
20002
20003         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20004         `SourceFile' argument instead of a string.
20005         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20006         but don't parse/tokenize here, we need to generate the list of all
20007         source files before we do that.
20008         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20009         the files.
20010
20011         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20012         instead of a string.
20013
20014         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20015         of a string.
20016
20017 2003-02-09  Martin Baulig  <martin@ximian.com>
20018
20019         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20020         filename on `#line default'.
20021
20022 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20023
20024         * statement.cs: don't clear the pinned var when the fixed statement
20025         returns from the method (fixes bug#37752).
20026
20027 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20028
20029         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20030         to IsValueType.
20031
20032 2003-02-07  Martin Baulig  <martin@ximian.com>
20033
20034         * driver.cs: Removed the `--debug-args' command line argument.
20035
20036         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20037         automatically by the AsssemblyBuilder.
20038         (CodeGen.InitializeSymbolWriter): We don't need to call any
20039         initialization function on the symbol writer anymore.  This method
20040         doesn't take any arguments.
20041
20042 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20043
20044         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20045         from referenced assemblies as well.
20046
20047 2003-02-02  Martin Baulig  <martin@ximian.com>
20048
20049         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20050
20051 2003-02-02  Martin Baulig  <martin@ximian.com>
20052
20053         * class.cs (Constructor.Emit): Open the symbol writer before
20054         emitting the constructor initializer.
20055         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20056         single-stepping through constructor initializers.
20057
20058 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20059
20060         * class.cs: Handle error 549: do not allow virtual methods in
20061         sealed classes. 
20062
20063 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20064
20065         * decl.cs: Check access levels when resolving types
20066
20067 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20068
20069         * statement.cs: Add parameters and locals set in catch blocks that might 
20070         return to set vector
20071
20072 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20073
20074         * class.cs (Operator): Set the SpecialName flags for operators.
20075
20076         * expression.cs (Invocation.DoResolve): Only block calls to
20077         accessors and operators on SpecialName methods.
20078
20079         (Cast.TryReduce): Handle conversions from char constants.
20080
20081
20082 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20083
20084         * statement.cs: small memory and time optimization in FlowBranching.
20085
20086 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20087
20088         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20089         problem that the last fix but in the other sid (Set).
20090
20091         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20092         access when there is no indexer in the hierarchy.
20093
20094 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20095
20096         * class.cs: Combine some if statements.
20097
20098 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20099
20100         * driver.cs: fixed bug #37187.
20101
20102 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20103
20104         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20105         any indexer, it's needed to build a list with all the indexers in the
20106         hierarchy (AllGetters), else we have problems. Fixes #35653.
20107
20108 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20109
20110         * class.cs (MethodData.Define): It is wrong for an interface
20111         implementation to be static in both cases: explicit and implicit.
20112         We were only handling this in one case.
20113
20114         Improve the if situation there to not have negations.
20115
20116         * class.cs (Field.Define): Turns out that we do not need to check
20117         the unsafe bit on field definition, only on usage.  Remove the test.
20118
20119 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20120
20121         * driver.cs: use assembly.Location instead of Codebase (the latest
20122         patch made mcs fail when using MS assemblies).
20123
20124 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20125
20126         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20127         get the path to *corlib.dll.
20128
20129 2003-01-21  Nick Drochak <ndrochak@gol.com>
20130
20131         * cs-tokenizer.cs:
20132         * pending.cs:
20133         * typemanager.cs: Remove compiler warnings
20134
20135 2003-01-20  Duncan Mak  <duncan@ximian.com>
20136
20137         * AssemblyInfo.cs: Bump the version number to 0.19.
20138
20139 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20140
20141         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20142
20143 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
20144
20145         * class.cs (Constructor::Emit): Emit debugging info for constructors.
20146
20147 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
20148
20149         * cs-parser.jay: Small fix: we were not comparing the constructor
20150         name correctly.   Thanks to Zoltan for the initial pointer.
20151
20152 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20153
20154         * cs-tokenizer.cs: Set file name when specified with #line
20155
20156 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
20157
20158         * cs-parser.jay: Only perform the constructor checks here if we
20159         are named like the class;  This will help provider a better
20160         error.  The constructor path is taken when a type definition is
20161         not found, but most likely the user forgot to add the type, so
20162         report that rather than the constructor error.
20163
20164 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20165
20166         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20167         allocations.
20168
20169 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20170
20171         * cs-parser.jay: Add cleanup call.
20172
20173 2003-01-13  Duncan Mak  <duncan@ximian.com>
20174
20175         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20176         consistent with other methods.
20177
20178 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20179
20180         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20181
20182 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20183
20184         * attribute.cs: only set GuidAttr to true when we have a
20185         GuidAttribute.
20186
20187 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20188
20189         * ecore.cs:
20190         * expression.cs:
20191         * typemanager.cs: fixes to allow mcs compile corlib with the new
20192         Type.IsSubclassOf fix.
20193
20194 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
20195
20196         * expression.cs (LocalVariableReference.DoResolve): Classify a
20197         constant as a value, not as a variable.   Also, set the type for
20198         the variable.
20199
20200         * cs-parser.jay (fixed_statement): take a type instead of a
20201         pointer_type, so we can produce a better error message later.
20202
20203         * statement.cs (Fixed.Resolve): Flag types that are not pointers
20204         as an error.  
20205
20206         (For.DoEmit): Make inifinite loops have a
20207         non-conditional branch back.
20208
20209         (Fixed.DoEmit): First populate the pinned variables, then emit the
20210         statement, then clear the variables.  Before I was emitting the
20211         code once for each fixed piece.
20212
20213
20214 2003-01-08  Martin Baulig  <martin@ximian.com>
20215
20216         * statement.cs (FlowBranching.MergeChild): A break in a
20217         SWITCH_SECTION does not leave a loop.  Fixes #36155.
20218
20219 2003-01-08  Martin Baulig  <martin@ximian.com>
20220
20221         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20222         lives in the same number space than `param_map'.  Fixes #36154.
20223
20224 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * cs-parser.jay (constructor_declaration): Set the
20227         Constructor.ModFlags before probing for it.  This makes the
20228         compiler report 514, 515 and 132 (the code was there, but got
20229         broken). 
20230
20231         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20232         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20233         (GotoCase.Resolve): Set `Returns' to ALWAYS.
20234
20235 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20236
20237         * enum.cs: create the enum static fields using the enum type.
20238
20239 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20240
20241         * class.cs: don't try to create the ParamBuilder for the return
20242         type if it's not needed (and handle it breaking for the ms runtime
20243         anyway).
20244
20245 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20246
20247         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20248
20249 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
20250
20251         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20252         the command.   This showed up while compiling the JANET source
20253         code, which used \r as its only newline separator.
20254
20255 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
20256
20257         * class.cs (Method.Define): If we are an operator (because it
20258         reuses our code), then set the SpecialName and HideBySig.  #36128
20259
20260 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
20261
20262         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20263         exception, report error 120 `object reference required'.
20264
20265         * driver.cs: Add --pause option, used during to measure the size
20266         of the process as it goes with --timestamp.
20267
20268         * expression.cs (Invocation.DoResolve): Do not allow methods with
20269         SpecialName to be invoked.
20270
20271 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
20272
20273         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20274         number before adding it.
20275
20276 2002-12-21  Ravi Pratap  <ravi@ximian.com>
20277
20278         * ecore.cs (StandardImplicitConversion): When in an unsafe
20279         context, we allow conversion between void * to any other pointer
20280         type. This fixes bug #35973.
20281
20282 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20283
20284         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20285         is not thrown when extensionless outputs are used 
20286
20287 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20288
20289         * rootcontext.cs: fixed compilation of corlib.
20290
20291 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * attribute.cs (Attributes.Contains): Add new method.
20294
20295         * class.cs (MethodCore.LabelParameters): if the parameter is an
20296         `out' parameter, check that no attribute `[In]' has been passed.
20297
20298         * enum.cs: Handle the `value__' name in an enumeration.
20299
20300 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
20301
20302         * decl.cs: Added special case to allow overrides on "protected
20303         internal" methods
20304
20305 2002-12-18  Ravi Pratap  <ravi@ximian.com>
20306
20307         * attribute.cs (Attributes.AddAttributeSection): Rename to this
20308         since it makes much more sense.
20309
20310         (Attributes.ctor): Don't require a Location parameter.
20311
20312         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20313
20314         * attribute.cs (ApplyAttributes): Remove extra Location parameters
20315         since we already have that information per attribute.
20316
20317         * everywhere : make appropriate changes.
20318
20319         * class.cs (LabelParameters): Write the code which actually
20320         applies attributes to the return type. We can't do this on the MS
20321         .NET runtime so we flag a warning in the case an exception is
20322         thrown.
20323
20324 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * const.cs: Handle implicit null conversions here too.
20327
20328 2002-12-17  Ravi Pratap  <ravi@ximian.com>
20329
20330         * class.cs (MethodCore.LabelParameters): Remove the extra
20331         Type [] parameter since it is completely unnecessary. Instead
20332         pass in the method's attributes so that we can extract
20333         the "return" attribute.
20334
20335 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
20336
20337         * cs-parser.jay (parse): Use Report.Error to flag errors instead
20338         of ignoring it and letting the compile continue.
20339
20340         * typemanager.cs (ChangeType): use an extra argument to return an
20341         error condition instead of throwing an exception.
20342
20343 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
20344
20345         * expression.cs (Unary.TryReduce): mimic the code for the regular
20346         code path.  Perform an implicit cast in the cases where we can
20347         implicitly convert to one of the integral types, and then reduce
20348         based on that constant.   This fixes bug #35483.
20349
20350 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20351
20352         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20353
20354 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20355
20356         * namespace.cs: fixed bug #35489.
20357
20358 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
20359
20360         * class.cs: Remove some dead code.
20361
20362         * cs-parser.jay: Estimate the number of methods needed
20363         (RootContext.MethodCount);
20364
20365         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20366         numbers instead of StringBuilders.
20367
20368         * support.cs (PtrHashtable): Add constructor with initial size;
20369         We can now reduce reallocations of the method table.
20370
20371 2002-12-10  Ravi Pratap  <ravi@ximian.com>
20372
20373         * attribute.cs (ApplyAttributes): Keep track of the emitted
20374         attributes on a per-target basis. This fixes bug #35413.
20375
20376 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
20377
20378         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20379         default to the Windows 1252 encoding.
20380
20381         (UnixParseOption): Support version, thanks to Alp for the missing
20382         pointer. 
20383
20384         * AssemblyInfo.cs: Add nice assembly information.
20385
20386         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20387         (bug 35169).
20388
20389         * cs-parser.jay: Allow a trailing comma before the close bracked
20390         in the attribute_section production.
20391
20392         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20393         address of the instance was being taken, I will take this out,
20394         because we take the address of the object immediately here.
20395
20396 2002-12-09  Ravi Pratap  <ravi@ximian.com>
20397
20398         * typemanager.cs (AreMultipleAllowed): Take care of the most
20399         obvious case where attribute type is not in the current assembly -
20400         stupid me ;-)
20401
20402 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
20403
20404         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20405         definitions, instead of doing that afterwards.  
20406
20407         Also we use a nice little hack, depending on the constructor, we
20408         know if we are a "composed" name or a simple name.  Hence, we
20409         avoid the IndexOf test, and we avoid 
20410
20411         * codegen.cs: Add code to assist in a bug reporter to track down
20412         the source of a compiler crash. 
20413
20414 2002-12-07  Ravi Pratap  <ravi@ximian.com>
20415
20416         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20417         types have been emitted for a given element and flag an error
20418         if something which does not have AllowMultiple set is used more
20419         than once.
20420
20421         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20422         attribute types and their corresponding AllowMultiple properties
20423
20424         (AreMultipleAllowed): Check the property for a given type.
20425
20426         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20427         property in the case we have a TypeContainer.
20428
20429         (Attributes.AddAttribute): Detect duplicates and just skip on
20430         adding them. This trivial fix catches a pretty gross error in our
20431         attribute emission - global attributes were being emitted twice!
20432
20433         Bugzilla bug #33187 is now fixed.
20434
20435 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
20436
20437         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20438         instead of pp_and).
20439
20440         * expression.cs (Binary.ResolveOperator): I can only use the
20441         Concat (string, string, string) and Concat (string, string,
20442         string, string) if the child is actually a concatenation of
20443         strings. 
20444
20445 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
20446
20447         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20448         context where we need a 2-character lookahead.
20449
20450         * pending.cs (PendingImplementation): Rework so we can keep track
20451         of interface types all the time, and flag those which were
20452         implemented by parents as optional.
20453
20454 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
20455
20456         * expression.cs (Binary.ResolveOperator): Use
20457         String.Concat(string,string,string) or
20458         String.Concat(string,string,string,string) when possible. 
20459
20460         * typemanager: More helper methods.
20461
20462
20463 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20464
20465         * pending.cs: remove the bogus return from GetMissingInterfaces()
20466         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20467
20468 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20469
20470         * namespace.cs: avoid duplicated 'using xxx' being added to
20471         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20472         when we get more than one 'using' statement for the same namespace.
20473         Report a CS0105 warning for it.
20474
20475 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * cs-tokenizer.cs (consume_identifier): use read directly, instead
20478         of calling getChar/putback, uses internal knowledge of it.    
20479
20480         (xtoken): Reorder tokenizer so most common patterns are checked
20481         first.  This reduces the compilation time in another 5% (from 8.11s
20482         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20483
20484         The parsing time is 22% of the compilation in mcs, and from that
20485         64% is spent on the tokenization process.  
20486
20487         I tried using a binary search for keywords, but this is slower
20488         than the hashtable.  Another option would be to do a couple of
20489         things:
20490
20491                 * Not use a StringBuilder, instead use an array of chars,
20492                   with a set value.  Notice that this way we could catch
20493                   the 645 error without having to do it *afterwards*.
20494
20495                 * We could write a hand-parser to avoid the hashtable
20496                   compares altogether.
20497
20498         The identifier consumption process takes 37% of the tokenization
20499         time.  Another 15% is spent on is_number.  56% of the time spent
20500         on is_number is spent on Int64.Parse:
20501
20502                 * We could probably choose based on the string length to
20503                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
20504                   computations. 
20505
20506         Another 3% is spend on wrapping `xtoken' in the `token' function.
20507
20508         Handle 0xa0 as whitespace (#34752)
20509
20510 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * typemanager.cs (IsCLRType): New routine to tell whether a type
20513         is one of the builtin types.  
20514
20515         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
20516         typecode in more places instead of doing pointer comparissions.
20517         We could leverage some knowledge about the way the typecodes are
20518         laid out.
20519
20520         New code to cache namespaces in assemblies, it is currently not
20521         invoked, to be used soon.
20522
20523         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
20524
20525         * expression.cs (Binary.ResolveOperator): specially handle
20526         strings, and do not perform user-defined operator overloading for
20527         built-in types.
20528
20529 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
20530
20531         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
20532         internalcall as it is a pretty simple operation;  Avoid whenever
20533         possible to call Char.IsLetter.
20534
20535         (consume_identifier): Cut by half the number of
20536         hashtable calls by merging the is_keyword and GetKeyword behavior.
20537
20538         Do not short-circuit, because if we do, we
20539         report errors (ie, #if false && true would produce an invalid
20540         directive error);
20541
20542
20543 2002-11-24  Martin Baulig  <martin@ximian.com>
20544
20545         * expression.cs (Cast.TryReduce): If we're in checked syntax,
20546         check constant ranges and report a CS0221.  Fixes #33186.
20547
20548 2002-11-24  Martin Baulig  <martin@ximian.com>
20549
20550         * cs-parser.jay: Make this work for uninitialized variable
20551         declarations in the `for' initializer.  Fixes #32416.
20552
20553 2002-11-24  Martin Baulig  <martin@ximian.com>
20554
20555         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
20556         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
20557
20558 2002-11-24  Martin Baulig  <martin@ximian.com>
20559
20560         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
20561         argument; if true, we also check for user-defined conversions.
20562         This is only needed if both arguments are of a user-defined type.
20563         Fixes #30443, added test-175.cs.
20564         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
20565
20566         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
20567
20568 2002-11-24  Martin Baulig  <martin@ximian.com>
20569
20570         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
20571         function to get the store opcode.
20572         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
20573         only emit the Ldelema if the store opcode is Stobj.  You must run
20574         both test-34 and test-167 to test this.  Fixes #34529.
20575
20576 2002-11-23  Martin Baulig  <martin@ximian.com>
20577
20578         * ecore.cs (Expression.MemberLookup): Added additional
20579         `qualifier_type' argument which is used when we're being called
20580         from MemberAccess.DoResolve() and null if we're called from a
20581         SimpleName lookup.
20582         (Expression.MemberLookupFailed): New method to report errors; this
20583         does the CS1540 check and reports the correct error message.
20584
20585         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
20586         argument for the CS1540 check and redone the way how we're dealing
20587         with private members.  See the comment in the source code for details.
20588         (FilterWithClosure): Reverted this back to revision 1.197; renamed
20589         `closure_start_type' to `closure_qualifier_type' and check whether
20590         it's not null.  It was not this filter being broken, it was just
20591         being called with the wrong arguments.
20592
20593         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
20594         and pass it the correct `qualifier_type'; this also does the error
20595         handling for us.
20596
20597 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
20598
20599         * expression.cs (Invocation.EmitParams): If the we are dealing
20600         with a non-built-in value type, load its address as well.
20601
20602         (ArrayCreation): Use a a pretty constant instead
20603         of the hardcoded value 2.   Use 6 instead of 2 for the number of
20604         static initializers.  
20605
20606         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
20607         because they are not really value types, just glorified integers. 
20608
20609         * driver.cs: Do not append .exe, the CSC compiler does not do it.
20610
20611         * ecore.cs: Remove redundant code for enumerations, make them use
20612         the same code path as everything else, fixes the casting issue
20613         with enumerations in Windows.Forms.
20614
20615         * attribute.cs: Do only cast to string if it is a string, the
20616         validation happens later.
20617
20618         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
20619         people upgrade their corlibs.
20620
20621         * ecore.cs: Oops, enumerations were not following the entire code path
20622
20623 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
20624
20625         * typemanager.cs (FilterWithClosure): Commented out the test for
20626         1540 in typemanager.cs, as it has problems when accessing
20627         protected methods from a parent class (see test-174.cs). 
20628
20629         * attribute.cs (Attribute.ValidateGuid): new method.
20630         (Attribute.Resolve): Use above.
20631
20632 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
20633
20634         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
20635
20636         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
20637         handling for enumerations, as we only needed the TypeContainer
20638         functionality to begin with (this is required for the fix below to
20639         work for enums that reference constants in a container class for
20640         example). 
20641
20642         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
20643
20644         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
20645         a valid TypeBuilder to perform lookups on.o
20646
20647         * class.cs (InheritableMemberSignatureCompare): Use true in the
20648         call to GetGetMethod and GetSetMethod, because we are comparing
20649         the signature, and we need to get the methods *even* if they are
20650         private. 
20651
20652         (PropertyBase.CheckBase): ditto.
20653
20654         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
20655         GotoCase.Resolve): Use Peel on EmpytCasts.
20656
20657         * ecore.cs (EmptyCast): drop child, add Peel method.
20658
20659 2002-11-17  Martin Baulig  <martin@ximian.com>
20660
20661         * ecore.cs (EmptyCast.Child): New public property.
20662
20663         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
20664         label resolved to an EmptyCast.  Fixes #34162.
20665         (GotoCase.Resolve): Likewise.
20666         (Block.EmitMeta): Likewise.
20667
20668 2002-11-17  Martin Baulig  <martin@ximian.com>
20669
20670         * expression.cs (Invocation.BetterConversion): Prefer int over
20671         uint; short over ushort; long over ulong for integer literals.
20672         Use ImplicitConversionExists instead of StandardConversionExists
20673         since we also need to check for user-defined implicit conversions.
20674         Fixes #34165.  Added test-173.cs.
20675
20676 2002-11-16  Martin Baulig  <martin@ximian.com>
20677
20678         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
20679         with the `true' and `false' literals.  Fixes #33151.
20680
20681 2002-11-16  Martin Baulig  <martin@ximian.com>
20682
20683         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
20684         October 22nd; don't do the cs1540 check for static members.
20685
20686         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
20687         now using our own filter here and doing the cs1540 check again.
20688
20689 2002-11-16  Martin Baulig  <martin@ximian.com>
20690
20691         * support.cs (InternalParameters): Don't crash if we don't have
20692         any fixed parameters.  Fixes #33532.
20693
20694 2002-11-16  Martin Baulig  <martin@ximian.com>
20695
20696         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
20697         when looking up static methods to make this work on Windows.
20698         Fixes #33773.
20699
20700 2002-11-16  Martin Baulig  <martin@ximian.com>
20701
20702         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
20703         a setter rather than using PropertyInfo.CanWrite.
20704
20705 2002-11-15  Nick Drochak  <ndrochak@gol.com>
20706
20707         * class.cs: Allow acces to block member by subclasses. Fixes build
20708         breaker.
20709
20710 2002-11-14  Martin Baulig  <martin@ximian.com>
20711
20712         * class.cs (Constructor.Emit): Added the extern/block check.
20713         Fixes bug #33678.
20714
20715 2002-11-14  Martin Baulig  <martin@ximian.com>
20716
20717         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
20718         iteration while looking for indexers, this is needed because the
20719         indexer may have a different name in our base classes.  Fixed the
20720         error reporting (no indexers at all, not get accessor, no
20721         overloaded match).  Fixes bug #33089.
20722         (IndexerAccess.DoResolveLValue): Likewise.
20723
20724 2002-11-14  Martin Baulig  <martin@ximian.com>
20725
20726         * class.cs (PropertyBase.CheckBase): Make this work for multiple
20727         indexers.  Fixes the first part of bug #33089.
20728         (MethodSignature.InheritableMemberSignatureCompare): Added support
20729         for properties.
20730
20731 2002-11-13  Ravi Pratap  <ravi@ximian.com>
20732
20733         * attribute.cs (Attribute.Resolve): Catch the
20734         NullReferenceException and report it since it isn't supposed to
20735         happen. 
20736
20737 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
20738
20739         * expression.cs (Binary.EmitBranchable): Also handle the cases for
20740         LogicalOr and LogicalAnd that can benefit from recursively
20741         handling EmitBranchable.  The code now should be nice for Paolo.
20742
20743 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
20744
20745         * typemanager.cs (LookupType): Added a negative-hit hashtable for
20746         the Type lookups, as we perform quite a number of lookups on
20747         non-Types.  This can be removed once we can deterministically tell
20748         whether we have a type or a namespace in advance.
20749
20750         But this might require special hacks from our corlib.
20751
20752         * TODO: updated.
20753
20754         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
20755         and double which avoids a conversion from an integer to a double.
20756
20757         * expression.cs: tiny optimization, avoid calling IsConstant,
20758         because it effectively performs the lookup twice.
20759
20760 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
20761
20762         But a bogus return here to keep the semantics of the old code
20763         until the Mono runtime is fixed.
20764
20765         * pending.cs (GetMissingInterfaces): New method used to remove all
20766         the interfaces that are already implemented by our parent
20767         classes from the list of pending methods. 
20768
20769         * interface.cs: Add checks for calls after ResolveTypeExpr.
20770
20771 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
20772
20773         * class.cs (Class.Emit): Report warning 67: event not used if the
20774         warning level is beyond 3.
20775
20776         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
20777         being a NullLiteral.
20778
20779         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
20780         specifiers. 
20781
20782         * class.cs (TypeContainer.GetClassBases): Cover a missing code
20783         path that might fail if a type can not be resolved.
20784
20785         * expression.cs (Binary.Emit): Emit unsigned versions of the
20786         operators. 
20787
20788         * driver.cs: use error 5.
20789
20790 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
20791
20792         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
20793
20794 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
20795
20796         * cs-parser.jay (switch_section): A beautiful patch from Martin
20797         Baulig that fixed 33094.
20798
20799 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
20800
20801         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
20802         Check whether the base is abstract and report an error if so.
20803
20804         * expression.cs (IndexerAccess.DoResolveLValue,
20805         IndexerAccess.DoResolve): ditto. 
20806
20807         (Invocation.DoResolve): ditto.
20808
20809         (Invocation.FullMethodDesc): Improve the report string.
20810
20811         * statement.cs (Block): Eliminate IsVariableDefined as it is
20812         basically just a wrapper for GetVariableInfo.
20813
20814         * ecore.cs (SimpleName): Use new 
20815
20816         * support.cs (ReflectionParamter.ParameterType): We unwrap the
20817         type, as we return the actual parameter ref/unref state on a
20818         different call.
20819
20820 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
20821
20822         * support.cs: Return proper flags REF/OUT fixing the previous
20823         commit.  
20824
20825         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
20826         not used to mean `ref' but `ref or out' in ParameterReference
20827
20828         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
20829         full type signature instead of calling TypeManger.CSharpName
20830         ourselves. 
20831
20832         * support.cs (InternalParameters.ParameterDesc): Do not compare
20833         directly to the modflags, because REF/OUT will actually be bitsets
20834         if set. 
20835
20836         * delegate.cs (VerifyMethod): Check also the modifiers.
20837
20838         * cs-tokenizer.cs: Fix bug where floating point values with an
20839         exponent where a sign was missing was ignored.
20840
20841         * driver.cs: Allow multiple assemblies to be specified in a single
20842         /r: argument
20843
20844 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
20847         because identifiers after a parenthesis would end up in this kind
20848         of production, and we needed to desamiguate it for having casts
20849         like:
20850
20851                 (UserDefinedType *) xxx
20852
20853 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
20854
20855         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
20856         we should set on the Bindingflags.NonPublic, but not turn on
20857         private_ok.  private_ok controls whether a Private member is
20858         returned (this is chekced on the filter routine), while the
20859         BindingFlags.NonPublic just controls whether private/protected
20860         will be allowed.   This fixes the problem part of the problem of
20861         private properties being allowed to be used in derived classes.
20862
20863         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
20864         so we can call the children DoResolveLValue method (this will
20865         properly signal errors on lvalue assignments to base properties)
20866
20867         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
20868         getter are null, and we have a property info, we know that this
20869         happened because the lookup failed, so we report an error 122 for
20870         protection level violation.
20871
20872         We also silently return if setter and getter are null in the
20873         resolve functions, this condition only happens if we have flagged
20874         the error before.  This is the other half of the problem. 
20875
20876         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
20877         not have accessibility information, that is why we were returning
20878         true in the filter function in typemanager.cs.
20879
20880         To properly report 122 (property is inaccessible because of its
20881         protection level) correctly, we report this error in ResolveAccess
20882         by failing if both the setter and the getter are lacking (ie, the
20883         lookup failed). 
20884
20885         DoResolve and DoLResolve have been modified to check for both
20886         setter/getter being null and returning silently, the reason being
20887         that I did not want to put the knowledge about this error in upper
20888         layers, like:
20889
20890         int old = Report.Errors;
20891         x = new PropertyExpr (...);
20892         if (old != Report.Errors)
20893                 return null;
20894         else
20895                 return x;
20896
20897         So the property expr is returned, but it is invalid, so the error
20898         will be flagged during the resolve process. 
20899
20900         * class.cs: Remove InheritablePropertySignatureCompare from the
20901         class, as we no longer depend on the property signature to compute
20902         whether it is possible to implement a method or not.
20903
20904         The reason is that calling PropertyInfo.GetGetMethod will return
20905         null (in .NET, in Mono it works, and we should change this), in
20906         cases where the Get Method does not exist in that particular
20907         class.
20908
20909         So this code:
20910
20911         class X { public virtual int A { get { return 1; } } }
20912         class Y : X { }
20913         class Z : Y { public override int A { get { return 2; } } }
20914
20915         Would fail in Z because the parent (Y) would not have the property
20916         defined.  So we avoid this completely now (because the alternative
20917         fix was ugly and slow), and we now depend exclusively on the
20918         method names.
20919
20920         (PropertyBase.CheckBase): Use a method-base mechanism to find our
20921         reference method, instead of using the property.
20922
20923         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
20924         routines are gone now.
20925
20926         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
20927         names, they were incorrectly named.
20928
20929         * cs-tokenizer.cs: Return are more gentle token on failure. 
20930
20931         * pending.cs (PendingImplementation.InterfaceMethod): This routine
20932         had an out-of-sync index variable, which caused it to remove from
20933         the list of pending methods the wrong method sometimes.
20934
20935 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
20936
20937         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20938         CanWrite, because those refer to this particular instance of the
20939         property, and do not take into account the fact that we can
20940         override single members of a property.
20941
20942         Constructor requires an EmitContext.  The resolution process does
20943         not happen here, but we need to compute the accessors before,
20944         because the resolution does not always happen for properties.
20945
20946         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20947         subclass, before we did not update this flag, but we did update
20948         bindingflags. 
20949
20950         (GetAccessors): Drop this routine, as it did not work in the
20951         presence of partially overwritten set/get methods. 
20952
20953         Notice that this broke the cs1540 detection, but that will require
20954         more thinking. 
20955
20956 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20957
20958         * class.cs:
20959         * codegen.cs:
20960         * driver.cs: issue a warning instead of an error if we don't support
20961         debugging for the platform. Also ignore a couple of errors that may
20962         arise when trying to write the symbols. Undo my previous patch.
20963
20964 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20965
20966         * driver.cs: ignore /debug switch except for Unix platforms.
20967
20968 2002-10-23  Nick Drochak  <ndrochak@gol.com>
20969
20970         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20971
20972 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
20973
20974         * driver.cs: Do not make mcs-debug conditional, so we do not break
20975         builds that use it.
20976
20977         * statement.cs (UsageVector.MergeChildren): I would like Martin to
20978         review this patch.  But basically after all the children variables
20979         have been merged, the value of "Breaks" was not being set to
20980         new_breaks for Switch blocks.  I think that it should be set after
20981         it has executed.  Currently I set this to the value of new_breaks,
20982         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20983         conservative, but I do not understand this code very well.
20984
20985         I did not break anything in the build, so that is good ;-)
20986
20987         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20988
20989 2002-10-20  Mark Crichton  <crichton@gimp.org>
20990
20991         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
20992
20993 2002-10-20  Nick Drochak  <ndrochak@gol.com>
20994
20995         * cfold.cs: Fixed compile blocker.
20996
20997 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
20998
20999         * driver.cs: I was chekcing the key, not the file.
21000
21001 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21002
21003         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21004         message that we were generating - we just need to silently return
21005         a null.
21006
21007 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21008
21009         * class.cs (Event.Define): Change my previous commit, as this
21010         breaks the debugger.  This is a temporary hack, as it seems like
21011         the compiler is generating events incorrectly to begin with.
21012
21013         * expression.cs (Binary.ResolveOperator): Added support for 
21014         "U operator - (E x, E y)"
21015
21016         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21017         y)".
21018
21019         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21020         init-only variables, but this path did not take into account that
21021         there might be also instance readonly variables.  Correct this
21022         problem. 
21023
21024         This fixes bug 32253
21025
21026         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21027         delegates as well.
21028
21029         * driver.cs: Change the extension for modules to `netmodule'
21030
21031         * cs-parser.jay: Improved slightly the location tracking for
21032         the debugger symbols.
21033
21034         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21035         modifiers that were specified instead of the hardcoded value
21036         (FamAndAssem).  This was basically ignoring the static modifier,
21037         and others.  Fixes 32429.
21038
21039         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21040         fixed a bug in the process (32476)
21041
21042         * expression.cs (ArrayAccess.EmitAssign): Patch from
21043         hwang_rob@yahoo.ca that fixes bug 31834.3
21044
21045 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21046
21047         * driver.cs: Make the module extension .netmodule.
21048
21049 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * driver.cs: Report an error if the resource file is not found
21052         instead of crashing.
21053
21054         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21055         false, like Emit does.
21056
21057 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21058
21059         * typemanager.cs: Remove unused private member.  Also reported mcs
21060         bug to report this as a warning like csc.
21061
21062 2002-10-15  Martin Baulig  <martin@gnome.org>
21063
21064         * statement.cs (Statement.Emit): Made this a virtual method; emits
21065         the line number info and calls DoEmit().
21066         (Statement.DoEmit): New protected abstract method, formerly knows
21067         as Statement.Emit().
21068
21069         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21070
21071 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21072
21073         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21074         have fixed a remaining problem: not every AddXXXX was adding a
21075         fully qualified name.  
21076
21077         Now everyone registers a fully qualified name in the DeclSpace as
21078         being defined instead of the partial name.  
21079
21080         Downsides: we are slower than we need to be due to the excess
21081         copies and the names being registered this way.  
21082
21083         The reason for this is that we currently depend (on the corlib
21084         bootstrap for instance) that types are fully qualified, because
21085         we dump all the types in the namespace, and we should really have
21086         types inserted into the proper namespace, so we can only store the
21087         basenames in the defined_names array.
21088
21089 2002-10-10  Martin Baulig  <martin@gnome.org>
21090
21091         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21092         from bug #31834, see the bug report for a testcase which is
21093         miscompiled.
21094
21095 2002-10-10  Martin Baulig  <martin@gnome.org>
21096
21097         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21098         flow analysis code for this.
21099
21100         * statement.cs (Do, While, For): Tell the flow analysis code about
21101         infinite loops.
21102         (FlowBranching.UsageVector): Added support for infinite loops.
21103         (Block.Resolve): Moved the dead code elimination here and use flow
21104         analysis to do it.
21105
21106 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21107
21108         * class.cs (Field.Define): Catch cycles on struct type
21109         definitions. 
21110
21111         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21112         fields if the fields are static.  We only need to check instance
21113         fields. 
21114
21115         * expression.cs (As.DoResolve): Test for reference type.
21116
21117         * statement.cs (Using.ResolveExpression): Use
21118         ConvertImplicitRequired, not ConvertImplicit which reports an
21119         error on failture
21120         (Using.ResolveLocalVariableDecls): ditto.
21121
21122         * expression.cs (Binary.ResolveOperator): Report errors in a few
21123         places where we had to.
21124
21125         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21126
21127 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
21128
21129         * expression.cs: Use StoreFromPtr instead of extracting the type
21130         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
21131
21132         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21133         an enumeration value to a System.Enum, but System.Enum is not a
21134         value type, but an class type, so we need to box.
21135
21136         (Expression.ConvertExplicit): One codepath could return
21137         errors but not flag them.  Fix this.  Fixes #31853
21138
21139         * parameter.cs (Resolve): Do not allow void as a parameter type.
21140
21141 2002-10-06  Martin Baulig  <martin@gnome.org>
21142
21143         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21144         if it's a class type and not a struct.  Fixes #31815.
21145
21146 2002-10-06  Martin Baulig  <martin@gnome.org>
21147
21148         * statement.cs: Reworked the flow analysis code a bit to make it
21149         usable for dead code elimination.
21150
21151 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21152
21153         * cs-parser.jay: allow empty source files. Fixes bug #31781.
21154
21155 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21156
21157         * expression.cs (ComposedCast.DoResolveType): A quick workaround
21158         to fix the test 165, will investigate deeper.
21159
21160 2002-10-04  Martin Baulig  <martin@gnome.org>
21161
21162         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21163         finally blocks actually work.
21164         (Try.Resolve): We don't need to create a sibling for `finally' if
21165         there is no finally block.
21166
21167 2002-10-04  Martin Baulig  <martin@gnome.org>
21168
21169         * class.cs (Constructor.Define): The default accessibility for a
21170         non-default constructor is private, not public.
21171
21172 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21173
21174         * class.cs (Constructor): Make AllowedModifiers public, add
21175         EXTERN.
21176
21177         * cs-parser.jay: Perform the modifiers test here, as the
21178         constructor for the Constructor class usually receives a zero
21179         because of the way we create it (first we create, later we
21180         customize, and we were never checking the modifiers).
21181
21182         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21183         is a version of LookupTypeReflection that includes the type-name
21184         cache.  This can be used as a fast path for functions that know
21185         the fully qualified name and are only calling into *.GetType() to
21186         obtain a composed type.
21187
21188         This is also used by TypeManager.LookupType during its type
21189         composition.
21190
21191         (LookupType): We now also track the real type name, as sometimes
21192         we can get a quey for the real type name from things like
21193         ComposedCast.  This fixes bug 31422.
21194
21195         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21196         complete type fullname, it does not have to go through the type
21197         resolution system to obtain the composed version of the type (for
21198         obtaining arrays or pointers).
21199
21200         (Conditional.Emit): Use the EmitBoolExpression to
21201         generate nicer code, as requested by Paolo.
21202
21203         (ArrayCreation.CheckIndices): Use the patch from
21204         hwang_rob@yahoo.ca to validate the array initializers. 
21205
21206 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
21207
21208         * class.cs (ConstructorInitializer.Emit): simplify code by using
21209         Invocation.EmitCall, and at the same time, fix the bugs in calling
21210         parent constructors that took variable arguments. 
21211
21212         * ecore.cs (Expression.ConvertNumericExplicit,
21213         Expression.ImplicitNumericConversion): Remove the code that
21214         manually wrapped decimal (InternalTypeConstructor call is now gone
21215         as well).
21216
21217         * expression.cs (Cast.TryReduce): Also handle decimal types when
21218         trying to perform a constant fold on the type.
21219
21220         * typemanager.cs (IsUnmanagedtype): Partially implemented.
21221
21222         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21223         that only turned off an error report, and did nothing else. 
21224
21225 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
21226
21227         * driver.cs: Handle and ignore /fullpaths
21228
21229 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * expression.cs (Binary.ResolveOperator): Catch the case where
21232         DoNumericPromotions returns true, 
21233
21234         (Binary.DoNumericPromotions): Simplify the code, and the tests.
21235
21236 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
21237
21238         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21239         report error 70.
21240
21241 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * ecore.cs (ConvertNumericExplicit): It is not enough that the
21244         conversion exists, but it is also required that the conversion be
21245         performed.  This manifested in "(Type64Enum) 2".  
21246
21247         * class.cs (TypeManager.AddMethod): The fix is not to change
21248         AddEnum, because that one was using a fully qualified name (every
21249         DeclSpace derivative does), but to change the AddMethod routine
21250         that was using an un-namespaced name.  This now correctly reports
21251         the duplicated name.
21252
21253         Revert patch until I can properly fix it.  The issue
21254         is that we have a shared Type space across all namespaces
21255         currently, which is wrong.
21256
21257         Options include making the Namespace a DeclSpace, and merge
21258         current_namespace/current_container in the parser.
21259
21260 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
21261
21262         * cs-parser.jay: Improve error reporting when we get a different
21263         kind of expression in local_variable_type and
21264         local_variable_pointer_type. 
21265
21266         Propagate this to avoid missleading errors being reported.
21267
21268         * ecore.cs (ImplicitReferenceConversion): treat
21269         TypeManager.value_type as a target just like object_type.   As
21270         code like this:
21271
21272         ValueType v = 1;
21273
21274         Is valid, and needs to result in the int 1 being boxed before it
21275         is assigned to the value type v.
21276
21277         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21278         to validate the enumeration name.
21279
21280         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21281         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
21282         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21283
21284         * ecore.cs (TryImplicitIntConversion): When doing an
21285         implicit-enumeration-conversion, check if the type is 64-bits and
21286         perform a conversion before passing to EnumConstant.
21287
21288 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * decl.cs (Error_AmbiguousTypeReference); New routine used to
21291         report ambiguous type references.  Unlike the MS version, we
21292         report what the ambiguity is.   Innovation at work ;-)
21293
21294         (DeclSpace.FindType): Require a location argument to
21295         display when we display an ambiguous error.
21296
21297         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21298
21299         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21300
21301         * expression.cs (EmitDynamicInitializers): Apply patch from
21302         hwang_rob@yahoo.ca that fixes the order in which we emit our
21303         initializers. 
21304
21305 2002-09-21  Martin Baulig  <martin@gnome.org>
21306
21307         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21308         delegate takes no arguments.
21309
21310 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
21311
21312         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21313         from integers.
21314
21315         * expression.cs: Extract the underlying type.
21316
21317         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21318
21319         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21320
21321 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
21322
21323         * class.cs (TypeContainer.DefineType): We can not use the nice
21324         PackingSize with the size set to 1 DefineType method, because it
21325         will not allow us to define the interfaces that the struct
21326         implements.
21327
21328         This completes the fixing of bug 27287
21329
21330         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21331         means also structs.  This fixes part of the problem. 
21332         (Expresion.ImplicitReferenceConversionExists): ditto.
21333
21334         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21335         error if there were no errors reported during the type lookup
21336         process, to avoid duplicates or redundant errors.  Without this
21337         you would get an ambiguous errors plus a type not found.  We have
21338         beaten the user enough with the first error.  
21339
21340         (DeclSparce.FindType): Emit a warning if we have an ambiguous
21341         reference. 
21342
21343         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21344         during the resolution process, stop the lookup, this avoids
21345         repeated error reports (same error twice).
21346
21347         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21348
21349         * typemanager.cs (LookupType): Redo the type lookup code to match
21350         the needs of System.Reflection.  
21351
21352         The issue is that System.Reflection requires references to nested
21353         types to begin with a "+" sign instead of a dot.  So toplevel
21354         types look like: "NameSpace.TopLevelClass", and nested ones look
21355         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21356         levels. 
21357
21358 2002-09-19  Martin Baulig  <martin@gnome.org>
21359
21360         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21361         says that a method always returns or always throws an exception,
21362         don't report the CS0161.
21363
21364         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21365         set `Returns = new_returns'.
21366
21367 2002-09-19  Martin Baulig  <martin@gnome.org>
21368
21369         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21370         to an enum constant, check for a CS0176.
21371
21372 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
21373
21374         * class.cs (TypeContainer.CheckPairedOperators): Now we check
21375         for operators that must be in pairs and report errors.
21376
21377         * ecore.cs (SimpleName.DoResolveType): During the initial type
21378         resolution process, when we define types recursively, we must
21379         check first for types in our current scope before we perform
21380         lookups in the enclosing scopes.
21381
21382         * expression.cs (MakeByteBlob): Handle Decimal blobs.
21383
21384         (Invocation.VerifyArgumentsCompat): Call
21385         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21386         I thought we were supposed to always call this, but there are a
21387         few places in the code where we dont do it.
21388
21389 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
21390
21391         * driver.cs: Add support in -linkres and -resource to specify the
21392         name of the identifier.
21393
21394 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21395
21396         * ecore.cs (StandardConversionExists): Sync with the conversion
21397         code: allow anything-* to void* conversions.
21398
21399         (FindMostSpecificSource): Use an Expression argument
21400         instead of a Type, because we might be handed over a Literal which
21401         gets a few more implicit conversions that plain types do not.  So
21402         this information was being lost.
21403
21404         Also, we drop the temporary type-holder expression when not
21405         required.
21406
21407 2002-09-17  Martin Baulig  <martin@gnome.org>
21408
21409         * class.cs (PropertyBase.CheckBase): Don't check the base class if
21410         this is an explicit interface implementation.
21411
21412 2002-09-17  Martin Baulig  <martin@gnome.org>
21413
21414         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21415         different `IndexerName' attributes.
21416
21417         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21418         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21419         virtual CommonResolve().
21420
21421 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21422
21423         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21424         and convert that to the UnderlyingType.
21425
21426         * statement.cs (Foreach.Resolve): Indexers are just like variables
21427         or PropertyAccesses.
21428
21429         * cs-tokenizer.cs (consume_string): Track line numbers and columns
21430         inside quoted strings, we were not doing this before.
21431
21432 2002-09-16  Martin Baulig  <martin@gnome.org>
21433
21434         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21435         resolve it.  This is needed for the definite assignment check of the
21436         instance expression, fixes bug #29846.
21437         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21438
21439 2002-09-16  Nick Drochak  <ndrochak@gol.com>
21440
21441         * parameter.cs: Fix compile error.  Cannot reference static member
21442         from an instance object.  Is this an mcs bug?
21443
21444 2002-09-14  Martin Baulig  <martin@gnome.org>
21445
21446         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21447         multiple times.  Fixes bug #30295, added test-166.cs.
21448
21449 2002-09-14  Martin Baulig  <martin@gnome.org>
21450
21451         * statement.cs (Block.Emit): Don't emit unreachable code.
21452         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21453         `break' statements.
21454         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21455
21456 2002-09-14  Martin Baulig  <martin@gnome.org>
21457
21458         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21459         is set.
21460
21461 2002-09-14  Martin Baulig  <martin@gnome.org>
21462
21463         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21464         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21465         be false on the ms runtime.
21466
21467 2002-09-13  Martin Baulig  <martin@gnome.org>
21468
21469         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21470         the CS0038 error message.
21471
21472 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21475         constant inside, return it.
21476
21477 2002-09-12  Martin Baulig  <martin@gnome.org>
21478
21479         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21480         implicit conversion can be done between enum types.
21481
21482         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21483         check whether an implicit conversion to the current enum's UnderlyingType
21484         exists and report an error if not.
21485
21486         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
21487         without debugging support.
21488
21489         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
21490         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
21491
21492 2002-09-12  Martin Baulig  <martin@gnome.org>
21493
21494         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
21495
21496         * ecore.cs (IMemberExpr.DeclaringType): New property.
21497         (SimpleName.SimpleNameResolve): Check whether we're accessing a
21498         nonstatic member of an outer type (CS0038).
21499
21500 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
21501
21502         * driver.cs: Activate the using-error detector at warning level
21503         4 (at least for MS-compatible APIs).
21504
21505         * namespace.cs (VerifyUsing): Small buglett fix.
21506
21507         * pending.cs (PendingImplementation): pass the container pointer. 
21508
21509         * interface.cs (GetMethods): Allow for recursive definition.  Long
21510         term, I would like to move every type to support recursive
21511         definitions, not the current ordering mechanism that we have right
21512         now.
21513
21514         The situation is this: Attributes are handled before interfaces,
21515         so we can apply attributes to interfaces.  But some attributes
21516         implement interfaces, we will now handle the simple cases
21517         (recursive definitions will just get an error).  
21518
21519         * parameter.cs: Only invalidate types at the end if we fail to
21520         lookup all types.  
21521
21522 2002-09-09  Martin Baulig  <martin@gnome.org>
21523
21524         * ecore.cs (PropertyExpr.Emit): Also check for
21525         TypeManager.system_int_array_get_length so this'll also work when
21526         compiling corlib.  Fixes #30003.
21527
21528 2002-09-09  Martin Baulig  <martin@gnome.org>
21529
21530         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
21531         and throw an exception if we can't get the type's size.  Fixed #30040,
21532         added test-165.cs.
21533
21534 2002-09-09  Martin Baulig  <martin@gnome.org>
21535
21536         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
21537
21538         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
21539         context.  Fixes bug #30027.
21540
21541         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
21542         virtual functions.  Fixes bug #30043, added test-164.cs.
21543
21544 2002-09-08  Ravi Pratap  <ravi@ximian.com>
21545
21546         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
21547
21548 2002-09-08  Nick Drochak  <ndrochak@gol.com>
21549
21550         * driver.cs: Use an object to get the windows codepage since it's not a
21551         static property.
21552
21553 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
21554
21555         * statement.cs (For.Emit): for infinite loops (test == null)
21556         return whether there is a break inside, not always "true".
21557
21558         * namespace.cs (UsingEntry): New struct to hold the name of the
21559         using definition, the location where it is defined, and whether it
21560         has been used in a successful type lookup.
21561
21562         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
21563         strings.
21564
21565         * decl.cs: ditto.
21566
21567 2002-09-06  Ravi Pratap  <ravi@ximian.com>
21568
21569         * attribute.cs : Fix incorrect code which relied on catching
21570         a NullReferenceException to detect a null being passed in
21571         where an object was expected.
21572
21573 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
21574
21575         * statement.cs (Try): flag the catch variable as assigned
21576
21577         * expression.cs (Cast): Simplified by using ResolveType instead of
21578         manually resolving.
21579
21580         * statement.cs (Catch): Fix bug by using ResolveType.
21581
21582 2002-09-06  Ravi Pratap  <ravi@ximian.com>
21583
21584         * expression.cs (BetterConversion): Special case for when we have
21585         a NullLiteral as the argument and we have to choose between string
21586         and object types - we choose string the way csc does.
21587
21588         * attribute.cs (Attribute.Resolve): Catch the
21589         NullReferenceException and report error #182 since the Mono
21590         runtime no more has the bug and having this exception raised means
21591         we tried to select a constructor which takes an object and is
21592         passed a null.
21593
21594 2002-09-05  Ravi Pratap  <ravi@ximian.com>
21595
21596         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
21597         message (1502, 1503) when we can't locate a method after overload
21598         resolution. This is much more informative and closes the bug
21599         Miguel reported.
21600
21601         * interface.cs (PopulateMethod): Return if there are no argument
21602         types. Fixes a NullReferenceException bug.
21603
21604         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
21605         expressions too. Previously we were checking only in one place for
21606         positional arguments leaving out named arguments.
21607
21608         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
21609         type to the enum type is not allowed. Remove code corresponding to
21610         that.
21611
21612         (ConvertNumericExplicit): Allow explicit conversions from
21613         the underlying type to enum type. This precisely follows the spec
21614         and closes a bug filed by Gonzalo.
21615
21616 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21617
21618         * compiler.csproj:
21619         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
21620
21621 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
21624         it was important that we stored the right value after the
21625         reduction in `converted'.
21626
21627 2002-09-04  Martin Baulig  <martin@gnome.org>
21628
21629         * location.cs (Location.SymbolDocument): Use full pathnames for the
21630         source files.
21631
21632 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
21633
21634         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
21635         of the expression resolve mechanism, because that will catch the
21636         SimpleName error failures.
21637
21638         (Conditional): If we can not resolve the
21639         expression, return, do not crash.
21640
21641 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21642
21643         * cs-tokenizer.cs:
21644         (location): display token name instead of its number.
21645
21646 2002-08-28  Martin Baulig  <martin@gnome.org>
21647
21648         * expression.cs (Binary.ResolveOperator): Don't silently return
21649         but return an error if an operator cannot be applied between two
21650         enum types.
21651
21652 2002-08-28  Martin Baulig  <martin@gnome.org>
21653
21654         * class.cs (Constructor.Define): Set the permission attributes
21655         correctly instead of making all constructors public.
21656
21657 2002-08-28  Martin Baulig  <martin@gnome.org>
21658
21659         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
21660         for private members before reporting a CS0103; if we find anything,
21661         it's a CS0122.
21662
21663 2002-08-28  Martin Baulig  <martin@gnome.org>
21664
21665         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
21666         to check whether `closure_start_type == closure_invocation_type',
21667         we also need to check whether `m.DeclaringType == closure_invocation_type'
21668         before bypassing the permission checks.  We might be accessing
21669         protected/private members from the base class.
21670         (TypeManager.RealMemberLookup): Only set private_ok if private
21671         members were requested via BindingFlags.NonPublic.
21672
21673         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
21674
21675         * expression.cs (MemberAccess.ResolveMemberAccess): Set
21676         MethodGroupExpr.IsExplicitImpl if appropriate.
21677         (Invocation.DoResolve): Don't report the CS0120 for explicit
21678         interface implementations.
21679
21680 2002-08-27  Martin Baulig  <martin@gnome.org>
21681
21682         * expression.cs (Invocation.DoResolve): If this is a static
21683         method and we don't have an InstanceExpression, we must report
21684         a CS0120.
21685
21686 2002-08-25  Martin Baulig  <martin@gnome.org>
21687
21688         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
21689         `==' between a valuetype and an object.
21690
21691 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
21692
21693         * ecore.cs (TypeExpr): Provide a ToString method.
21694
21695 2002-08-24  Martin Baulig  <martin@gnome.org>
21696
21697         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
21698         now called proggie.dbg and it's a binary file.
21699
21700 2002-08-23  Martin Baulig  <martin@gnome.org>
21701
21702         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
21703
21704 2002-08-23  Martin Baulig  <martin@gnome.org>
21705
21706         * struct.cs (MyStructInfo.ctor): Make this work with empty
21707         structs; it's not allowed to use foreach() on null.
21708
21709 2002-08-23  Martin Baulig  <martin@gnome.org>
21710
21711         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
21712         writer the full pathname of the generated assembly.
21713
21714 2002-08-23  Martin Baulig  <martin@gnome.org>
21715
21716         * statements.cs (FlowBranching.UsageVector.MergeChildren):
21717         A `finally' block never returns or breaks; improved handling of
21718         unreachable code.
21719
21720 2002-08-23  Martin Baulig  <martin@gnome.org>
21721
21722         * statement.cs (Throw.Resolve): Allow `throw null'.
21723
21724 2002-08-23  Martin Baulig  <martin@gnome.org>
21725
21726         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
21727         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
21728         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
21729         MemberLookup would return a wrong event if this is an explicit
21730         interface implementation and the class has an event with the same
21731         name.
21732
21733 2002-08-23  Martin Baulig  <martin@gnome.org>
21734
21735         * statement.cs (Block.AddChildVariableNames): New public method.
21736         (Block.AddChildVariableName): Likewise.
21737         (Block.IsVariableNameUsedInChildBlock): Likewise.
21738         (Block.AddVariable): Check whether a variable name has already
21739         been used in a child block.
21740
21741         * cs-parser.jay (declare_local_variables): Mark all variable names
21742         from the current block as being used in a child block in the
21743         implicit block.
21744
21745 2002-08-23  Martin Baulig  <martin@gnome.org>
21746
21747         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
21748         find the symbol writer.
21749
21750         * driver.cs: csc also allows the arguments to /define being
21751         separated by commas, not only by semicolons.
21752
21753 2002-08-23  Martin Baulig  <martin@gnome.org>
21754
21755         * interface.cs (Interface.GetMembers): Added static check for events.
21756
21757 2002-08-15  Martin Baulig  <martin@gnome.org>
21758
21759         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
21760         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
21761
21762         * ecore.cs (Expression.MemberLookup): Added documentation and explained
21763         why the MethodData.EmitDestructor() change was necessary.
21764
21765 2002-08-20  Martin Baulig  <martin@gnome.org>
21766
21767         * class.cs (TypeContainer.FindMembers): Added static check for events.
21768
21769         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
21770
21771         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
21772         use Type.GetEvents(), not Type.FindMembers().
21773
21774 2002-08-20  Martin Baulig  <martin@gnome.org>
21775
21776         * decl.cs (MemberCache): Added a special method cache which will
21777         be used for method-only searched.  This ensures that a method
21778         search will return a MethodInfo with the correct ReflectedType for
21779         inherited methods.      
21780
21781 2002-08-20  Martin Baulig  <martin@gnome.org>
21782
21783         * decl.cs (DeclSpace.FindMembers): Made this public.
21784
21785 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21786
21787         * delegate.cs: fixed build on windows.
21788         [FIXME:  Filed as bug #29150: MCS must report these errors.]
21789
21790 2002-08-19  Ravi Pratap  <ravi@ximian.com>
21791
21792         * ecore.cs (StandardConversionExists): Return a false
21793         if we are trying to convert the void type to anything else
21794         since that is not allowed.
21795
21796         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
21797         we flag error 70 in the event an event is trying to be accessed
21798         directly from outside the declaring type.
21799
21800 2002-08-20  Martin Baulig  <martin@gnome.org>
21801
21802         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
21803         MemberCache from typemanager.cs to decl.cs.
21804
21805 2002-08-19  Martin Baulig  <martin@gnome.org>
21806
21807         * class.cs (TypeContainer): Implement IMemberContainer.
21808         (TypeContainer.DefineMembers): Create the MemberCache.
21809         (TypeContainer.FindMembers): Do better BindingFlags checking; only
21810         return public members if BindingFlags.Public was given, check
21811         whether members are static.
21812
21813 2002-08-16  Martin Baulig  <martin@gnome.org>
21814
21815         * decl.cs (DeclSpace.Define): Splitted this in Define and
21816         DefineMembers.  DefineMembers is called first and initializes the
21817         MemberCache.
21818
21819         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
21820         DefineMembers() on all our DeclSpaces.
21821
21822         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
21823         but call DefineMembers() on all nested interfaces.  We call their
21824         Define() in our new Define() function.
21825
21826         * interface.cs (Interface): Implement IMemberContainer.
21827         (Interface.Define): Moved all code except the attribute stuf to
21828         DefineMembers().
21829         (Interface.DefineMembers): Initialize the member cache.
21830
21831         * typemanager.cs (IMemberFinder): Removed this interface, we don't
21832         need this anymore since we can use MemberCache.FindMembers directly.
21833
21834 2002-08-19  Martin Baulig  <martin@gnome.org>
21835
21836         * typemanager.cs (MemberCache): When creating the cache for an
21837         interface type, add all inherited members.
21838         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
21839         to `out bool used_cache' and documented it.
21840         (TypeManager.MemberLookup): If we already used the cache in the first
21841         iteration, we don't need to do the interfaces check.
21842
21843 2002-08-19  Martin Baulig  <martin@gnome.org>
21844
21845         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
21846         here from IMemberFinder and don't implement this interface anymore.
21847         (DeclSpace.MemberCache): Moved here from IMemberFinder.
21848
21849         * typemanager.cs (IMemberFinder): This interface is now only used by
21850         classes which actually support the member cache.
21851         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
21852         since we only put DeclSpaces into this Hashtable.
21853         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
21854         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
21855
21856 2002-08-16  Martin Baulig  <martin@gnome.org>
21857
21858         * typemanager.cs (ICachingMemberFinder): Removed.
21859         (IMemberFinder.MemberCache): New property.
21860         (TypeManager.FindMembers): Merged this with RealFindMembers().
21861         This function will never be called from TypeManager.MemberLookup()
21862         so we can't use the cache here, just the IMemberFinder.
21863         (TypeManager.MemberLookup_FindMembers): Check whether the
21864         IMemberFinder has a MemberCache and call the cache's FindMembers
21865         function.
21866         (MemberCache): Rewrote larger parts of this yet another time and
21867         cleaned it up a bit.
21868
21869 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
21870
21871         * driver.cs (LoadArgs): Support quoting.
21872
21873         (Usage): Show the CSC-like command line arguments.
21874
21875         Improved a few error messages.
21876
21877 2002-08-15  Martin Baulig  <martin@gnome.org>
21878
21879         * typemanager.cs (IMemberContainer.Type): New property.
21880         (IMemberContainer.IsInterface): New property.
21881
21882         The following changes are conditional to BROKEN_RUNTIME, which is
21883         defined at the top of the file.
21884
21885         * typemanager.cs (MemberCache.MemberCache): Don't add the base
21886         class'es members, but add all members from TypeHandle.ObjectType
21887         if we're an interface.
21888         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
21889         is the current type.
21890         (MemberCache.CacheEntry.Container): Removed this field.
21891         (TypeHandle.GetMembers): Include inherited members.
21892
21893 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21894
21895         * typemanager.cs: fixed compilation and added a comment on a field that
21896         is never used.
21897
21898 2002-08-15  Martin Baulig  <martin@gnome.org>
21899
21900         * class.cs (ConstructorInitializer.Resolve): In the
21901         Expression.MemberLookup call, use the queried_type as
21902         invocation_type.
21903
21904         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
21905         declared' attribute, it's always true.
21906         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
21907         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
21908         temporary wrapper for FindMembers which tells MemberLookup whether
21909         members from the base classes are included in the return value.
21910         This will go away soon.
21911         (TypeManager.MemberLookup): Use this temporary hack here; once the
21912         new MemberCache is completed, we don't need to do the DeclaredOnly
21913         looping here anymore since the MemberCache will take care of this.
21914         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
21915         (MemberCache): When creating the MemberCache for a class, get
21916         members from the current class and all its base classes.
21917         (MemberCache.CacheEntry.Container): New field.  This is a
21918         temporary hack until the Mono runtime is fixed to distinguish
21919         between ReflectedType and DeclaringType.  It allows us to use MCS
21920         with both the MS runtime and the unfixed Mono runtime without
21921         problems and without accecting performance.
21922         (MemberCache.SearchMembers): The DeclaredOnly looping from
21923         TypeManager.MemberLookup is now done here.      
21924
21925 2002-08-14  Martin Baulig  <martin@gnome.org>
21926
21927         * statement.cs (MyStructInfo.MyStructInfo): Don't call
21928         Type.GetFields on dynamic types but get the fields from the
21929         corresponding TypeContainer.
21930         (MyStructInfo.GetStructInfo): Added check for enum types.
21931
21932         * typemanager.cs (MemberList.IsSynchronized): Implemented.
21933         (MemberList.SyncRoot): Implemented.
21934         (TypeManager.FilterWithClosure): No need to check permissions if
21935         closure_start_type == closure_invocation_type, don't crash if
21936         closure_invocation_type is null.
21937
21938 2002-08-13  Martin Baulig  <martin@gnome.org>
21939
21940         Rewrote TypeContainer.FindMembers to use a member cache.  This
21941         gives us a speed increase of about 35% for the self-hosting MCS
21942         build and of about 15-20% for the class libs (both on GNU/Linux).
21943
21944         * report.cs (Timer): New class to get enhanced profiling.  This
21945         whole class is "TIMER" conditional since it remarkably slows down
21946         compilation speed.
21947
21948         * class.cs (MemberList): New class.  This is an IList wrapper
21949         which we're now using instead of passing MemberInfo[]'s around to
21950         avoid copying this array unnecessarily.
21951         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21952         (ICachingMemberFinder, IMemberContainer): New interface.
21953         (TypeManager.FilterWithClosure): If `criteria' is null, the name
21954         has already been checked, otherwise use it for the name comparision.
21955         (TypeManager.FindMembers): Renamed to RealMemberFinder and
21956         provided wrapper which tries to use ICachingMemberFinder.FindMembers
21957         if possible.  Returns a MemberList, not a MemberInfo [].
21958         (TypeHandle): New class, implements IMemberContainer.  We create
21959         one instance of this class per type, it contains a MemberCache
21960         which is used to do the member lookups.
21961         (MemberCache): New class.  Each instance of this class contains
21962         all members of a type and a name-based hash table.
21963         (MemberCache.FindMembers): This is our new member lookup
21964         function.  First, it looks up all members of the requested name in
21965         the hash table.  Then, it walks this list and sorts out all
21966         applicable members and returns them.
21967
21968 2002-08-13  Martin Baulig  <martin@gnome.org>
21969
21970         In addition to a nice code cleanup, this gives us a performance
21971         increase of about 1.4% on GNU/Linux - not much, but it's already
21972         half a second for the self-hosting MCS compilation.
21973
21974         * typemanager.cs (IMemberFinder): New interface.  It is used by
21975         TypeManager.FindMembers to call FindMembers on a TypeContainer,
21976         Enum, Delegate or Interface.
21977         (TypeManager.finder_to_member_finder): New PtrHashtable.
21978         (TypeManager.finder_to_container): Removed.
21979         (TypeManager.finder_to_delegate): Removed.
21980         (TypeManager.finder_to_interface): Removed.
21981         (TypeManager.finder_to_enum): Removed.
21982
21983         * interface.cs (Interface): Implement IMemberFinder.
21984
21985         * delegate.cs (Delegate): Implement IMemberFinder.
21986
21987         * enum.cs (Enum): Implement IMemberFinder.
21988
21989         * class.cs (TypeContainer): Implement IMemberFinder.
21990
21991 2002-08-12  Martin Baulig  <martin@gnome.org>
21992
21993         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21994
21995 2002-08-12  Martin Baulig  <martin@gnome.org>
21996
21997         * ecore.cs (ITypeExpression): New interface for expressions which
21998         resolve to a type.
21999         (TypeExpression): Renamed to TypeLookupExpression.
22000         (Expression.DoResolve): If we're doing a types-only lookup, the
22001         expression must implement the ITypeExpression interface and we
22002         call DoResolveType() on it.
22003         (SimpleName): Implement the new ITypeExpression interface.
22004         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22005         hack, the situation that we're only looking up types can't happen
22006         anymore when this method is called.  Moved the type lookup code to
22007         DoResolveType() and call it.
22008         (SimpleName.DoResolveType): This ITypeExpression interface method
22009         is now doing the types-only lookup.
22010         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22011         (ResolveFlags): Added MaskExprClass.
22012
22013         * expression.cs (MemberAccess): Implement the ITypeExpression
22014         interface.
22015         (MemberAccess.DoResolve): Added support for a types-only lookup
22016         when we're called via ITypeExpression.DoResolveType().
22017         (ComposedCast): Implement the ITypeExpression interface.
22018
22019         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22020         Expression.Resolve() with ResolveFlags.Type instead.
22021
22022 2002-08-12  Martin Baulig  <martin@gnome.org>
22023
22024         * interface.cs (Interface.Define): Apply attributes.
22025
22026         * attribute.cs (Attribute.ApplyAttributes): Added support for
22027         interface attributes.
22028
22029 2002-08-11  Martin Baulig  <martin@gnome.org>
22030
22031         * statement.cs (Block.Emit): Only check the "this" variable if we
22032         do not always throw an exception.
22033
22034         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22035         whether the property has a set accessor.
22036
22037 2002-08-11  Martin Baulig  <martin@gnome.org>
22038
22039         Added control flow analysis support for structs.
22040
22041         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22042         with control flow analysis turned off.
22043         (IVariable): New interface.
22044         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22045         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22046         (FieldExpr.DoResolve): Resolve the instance expression with flow
22047         analysis turned off and do the definite assignment check after the
22048         resolving when we know what the expression will resolve to.
22049
22050         * expression.cs (LocalVariableReference, ParameterReference):
22051         Implement the new IVariable interface, only call the flow analysis
22052         code if ec.DoFlowAnalysis is true.
22053         (This): Added constructor which takes a Block argument.  Implement
22054         the new IVariable interface.
22055         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22056         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22057         This does the definite assignment checks for struct members.
22058
22059         * class.cs (Constructor.Emit): If this is a non-static `struct'
22060         constructor which doesn't have any initializer, call
22061         Block.AddThisVariable() to tell the flow analysis code that all
22062         struct elements must be initialized before control returns from
22063         the constructor.
22064
22065         * statement.cs (MyStructInfo): New public class.
22066         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22067         argument to this indexer.  If non-zero, check an individual struct
22068         member, not the whole struct.
22069         (FlowBranching.CheckOutParameters): Check struct members.
22070         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22071         overloaded versions of these methods which take an additional
22072         `int field_idx' argument to check struct members.
22073         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22074         overloaded versions of these methods which take an additional
22075         `string field_name' argument to check struct member.s
22076         (VariableInfo): Implement the IVariable interface.
22077         (VariableInfo.StructInfo): New public property.  Returns the
22078         MyStructInfo instance of the variable if it's a struct or null.
22079         (Block.AddThisVariable): New public method.  This is called from
22080         Constructor.Emit() for non-static `struct' constructor which do
22081         not have any initializer.  It creates a special variable for the
22082         "this" instance variable which will be checked by the flow
22083         analysis code to ensure that all of the struct's fields are
22084         initialized before control returns from the constructor.
22085         (UsageVector): Added support for struct members.  If a
22086         variable/parameter is a struct with N members, we reserve a slot
22087         in the usage vector for each member.  A struct is considered fully
22088         initialized if either the struct itself (slot 0) or all its
22089         members are initialized.
22090
22091 2002-08-08  Martin Baulig  <martin@gnome.org>
22092
22093         * driver.cs (Driver.MainDriver): Only report an error CS5001
22094         if there were no compilation errors.
22095
22096         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22097         `UnsafeContext' property to determine whether the parent is in
22098         unsafe context rather than checking the parent's ModFlags:
22099         classes nested in an unsafe class are unsafe as well.
22100
22101 2002-08-08  Martin Baulig  <martin@gnome.org>
22102
22103         * statement.cs (UsageVector.MergeChildren): Distinguish between
22104         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22105         we return.  Added test17() and test18() to test-154.cs.
22106
22107 2002-08-08  Martin Baulig  <martin@gnome.org>
22108
22109         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22110         Family access, make sure the invoking type isn't a subclass of the
22111         queried type (that'd be a CS1540).
22112
22113         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22114         this method which takes an additional `Type invocation_type'.
22115
22116         * expression.cs (BaseAccess.DoResolve): Use the base type as
22117         invocation and query type.
22118         (MemberAccess.DoResolve): If the lookup failed and we're about to
22119         report a CS0122, try a lookup with the ec.ContainerType - if this
22120         succeeds, we must report a CS1540.
22121
22122 2002-08-08  Martin Baulig  <martin@gnome.org>
22123
22124         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22125         (MethodGroupExpr): Implement the IMemberExpr interface.
22126
22127         * expression (MemberAccess.ResolveMemberAccess): No need to have
22128         any special code for MethodGroupExprs anymore, they're now
22129         IMemberExprs.   
22130
22131 2002-08-08  Martin Baulig  <martin@gnome.org>
22132
22133         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22134         Family, FamANDAssem and FamORAssem permissions.
22135         (TypeManager.IsSubclassOrNestedChildOf): New public method.
22136
22137 2002-08-08  Martin Baulig  <martin@gnome.org>
22138
22139         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22140         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22141         or loop block.
22142
22143 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22144
22145         * driver.cs: implemented /resource option to embed managed resources.
22146
22147 2002-08-07  Martin Baulig  <martin@gnome.org>
22148
22149         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22150         (FieldBase.HasFieldInitializer): New public property.
22151         (FieldBase.GetInitializerExpression): New public method.  Resolves and
22152         returns the field initializer and makes sure it is only resolved once.
22153         (TypeContainer.EmitFieldInitializers): Call
22154         FieldBase.GetInitializerExpression to get the initializer, this ensures
22155         that it isn't resolved multiple times.
22156
22157         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
22158         the resolving process (SimpleName/MemberLookup) that we're currently
22159         emitting a field initializer (which must not access any instance members,
22160         this is an error CS0236).
22161
22162         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22163         argument, if the `IsFieldInitializer' flag is set, we must report and
22164         error CS0236 and not an error CS0120.   
22165
22166 2002-08-07  Martin Baulig  <martin@gnome.org>
22167
22168         * ecore.cs (IMemberExpr): New public interface.
22169         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22170         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22171         if the expression is an IMemberExpr.
22172
22173         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22174         to be null, implicitly default to `this' if we're non-static in
22175         this case.  Simplified the code a lot by using the new IMemberExpr
22176         interface.  Also fixed bug #28176 here.
22177
22178 2002-08-06  Martin Baulig  <martin@gnome.org>
22179
22180         * cs-parser.jay (SimpleLookup): Removed.  We need to create
22181         ParameterReferences during semantic analysis so that we can do a
22182         type-only search when resolving Cast, TypeOf and SizeOf.
22183         (block): Pass the `current_local_parameters' to the Block's
22184         constructor.
22185
22186         * class.cs (ConstructorInitializer): Added `Parameters parameters'
22187         argument to the constructor.
22188         (ConstructorInitializer.Resolve): Create a temporary implicit
22189         block with the parameters.
22190
22191         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22192         references here if we aren't doing a type-only search.
22193
22194         * statement.cs (Block): Added constructor which takes a
22195         `Parameters parameters' argument.
22196         (Block.Parameters): New public property.
22197
22198         * support.cs (InternalParameters.Parameters): Renamed `parameters'
22199         to `Parameters' and made it public readonly.
22200
22201 2002-08-06  Martin Baulig  <martin@gnome.org>
22202
22203         * ecore.cs (Expression.Warning): Made this public as well.
22204
22205         * report.cs (Report.Debug): Print the contents of collections.
22206
22207 2002-08-06  Martin Baulig  <martin@gnome.org>
22208
22209         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
22210         used to tell Resolve() which kinds of expressions it may return.
22211         (Expression.Resolve): Added overloaded version of this method which
22212         takes a `ResolveFlags flags' argument.  This can be used to tell
22213         Resolve() which kinds of expressions it may return.  Reports a
22214         CS0118 on error.
22215         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22216         ResolveFlags.SimpleName.
22217         (Expression.Error118): Added overloaded version of this method which
22218         takes a `ResolveFlags flags' argument.  It uses the flags to determine
22219         which kinds of expressions are allowed.
22220
22221         * expression.cs (Argument.ResolveMethodGroup): New public method.
22222         Resolves an argument, but allows a MethodGroup to be returned.
22223         This is used when invoking a delegate.
22224
22225         * TODO: Updated a bit.
22226
22227 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22228
22229         Fixed compilation with csc.
22230
22231         * ecore.cs: Expression.Error made public. Is this correct? Should
22232         Warning be made public too?
22233
22234         * expression.cs: use ea.Location instead of ea.loc.
22235         [FIXME:  Filed as bug #28607: MCS must report these errors.]
22236
22237 2002-08-06  Martin Baulig  <martin@gnome.org>
22238
22239         * ecore.cs (Expression.loc): Moved the location here instead of
22240         duplicating it in all derived classes.
22241         (Expression.Location): New public property.
22242         (Expression.Error, Expression.Warning): Made them non-static and
22243         removed the location argument.
22244         (Expression.Warning): Added overloaded version which takes an
22245         `int level' argument.
22246         (Expression.Error118): Make this non-static and removed the
22247         expression and location arguments.
22248         (TypeExpr): Added location argument to the constructor.
22249
22250         * expression.cs (StaticCallExpr): Added location argument to
22251         the constructor.
22252         (Indirection, PointerArithmetic): Likewise.
22253         (CheckedExpr, UnCheckedExpr): Likewise.
22254         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22255         (StringPtr): Likewise.
22256
22257
22258 2002-08-05  Martin Baulig  <martin@gnome.org>
22259
22260         * expression.cs (BaseAccess.DoResolve): Actually report errors.
22261
22262         * assign.cs (Assign.DoResolve): Check whether the source
22263         expression is a value or variable.
22264
22265         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22266         while resolving the corresponding blocks.
22267
22268         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22269         an error, don't silently return null.
22270
22271         * statement.cs (Block.AddVariable): Do the error reporting here
22272         and distinguish between CS0128 and CS0136.
22273         (Block.DoResolve): Report all unused labels (warning CS0164).
22274         (LabeledStatement): Pass the location to the constructor.
22275         (LabeledStatement.HasBeenReferenced): New property.
22276         (LabeledStatement.Resolve): Set it to true here.
22277
22278         * statement.cs (Return.Emit): Return success even after reporting
22279         a type mismatch error (CS0126 or CS0127), this is what csc does and
22280         it avoids confusing the users with any consecutive errors.
22281
22282 2002-08-05  Martin Baulig  <martin@gnome.org>
22283
22284         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22285
22286         * const.cs (Const.LookupConstantValue): Catch circular definitions.
22287
22288         * expression.cs (MemberAccess.DoResolve): Silently return if an
22289         error has already been reported.
22290
22291         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22292         error has already been reported.
22293
22294 2002-08-05  Martin Baulig  <martin@gnome.org>
22295
22296         * statement.cs (UsageVector): Only initialize the `parameters'
22297         vector if we actually have any "out" parameters.
22298
22299 2002-08-05  Martin Baulig  <martin@gnome.org>
22300
22301         * expression.cs (Binary.ResolveOperator): When combining delegates,
22302         they must have the same type.
22303
22304 2002-08-05  Martin Baulig  <martin@gnome.org>
22305
22306         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22307         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22308         work with the ms runtime and we also don't need it: if we're a
22309         PropertyBuilder and not in the `indexer_arguments' hash, then we
22310         are a property and not an indexer.
22311
22312         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22313         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22314         since the latter one doesn't work with the ms runtime.
22315
22316 2002-08-03  Martin Baulig  <martin@gnome.org>
22317
22318         Fixed bugs #27998 and #22735.
22319
22320         * class.cs (Method.IsOperator): New public field.
22321         (Method.CheckBase): Report CS0111 if there's already a method
22322         with the same parameters in the current class.  Report CS0508 when
22323         attempting to change the return type of an inherited method.
22324         (MethodData.Emit): Report CS0179 if a method doesn't have a body
22325         and it's not marked abstract or extern.
22326         (PropertyBase): New abstract base class for Property and Indexer.
22327         (PropertyBase.CheckBase): Moved here from Property and made it work
22328         for indexers.
22329         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22330         the same so we can reuse it there.
22331         (Property, Indexer): Derive from PropertyBase.
22332         (MethodSignature.inheritable_property_signature_filter): New delegate
22333         to find properties and indexers.
22334
22335         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22336         argument and improved error reporting.
22337
22338         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22339         EmptyReadOnlyParameters and made it a property.
22340
22341         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22342         version of this method which takes a `PropertyInfo indexer'.
22343         (TypeManager.RegisterIndexer): New method.
22344
22345         * class.cs: Added myself as author of this file :-)
22346
22347 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22348
22349         * class.cs: fixed compilation on windoze.
22350
22351 2002-08-03  Martin Baulig  <martin@gnome.org>
22352
22353         * interface.cs (Interface.GetInterfaceBases): Check whether all
22354         base interfaces are at least as accessible than the current one.
22355
22356         * class.cs (TypeContainer.GetClassBases): Check whether base types
22357         are at least as accessible than the current type.
22358         (TypeContainer.AsAccessible): Implemented and made non-static.
22359         (MemberBase.CheckParameters): Report errors if the accessibility
22360         checks fail.
22361
22362         * delegate.cs (Delegate.Delegate): The default visibility is
22363         internal for top-level types and private for nested types.
22364         (Delegate.Define): Report errors if the accessibility checks fail.
22365
22366         * enum.cs (Enum.Enum): The default visibility is internal for
22367         top-level types and private for nested types.
22368         (Enum.DefineType): Compute the correct visibility.
22369
22370         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22371         function which takes a `bool is_toplevel' instead of a TypeContainer.
22372
22373         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22374         builtin type.
22375
22376 2002-08-02  Martin Baulig  <martin@gnome.org>
22377
22378         * expression.cs (LocalVariableReferenc): Added constructor which
22379         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22380         (LocalVariableReference.IsReadOnly): New property.
22381         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22382         variable is readonly, use our own readonly flag to do this; you can
22383         use the new constructor to get a writable reference to a read-only
22384         variable.
22385
22386         * cs-parser.jay (foreach_statement, using_statement): Get a writable
22387         reference to the local variable.
22388
22389 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
22390
22391         * rootcontext.cs (ResolveCore): Also include System.Exception
22392
22393         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22394         we reach an EmptyStatement.
22395
22396         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22397         is also fine.
22398
22399         * expression.cs (Binary.ResolveOperator): Check error result in
22400         two places.
22401
22402         use brtrue/brfalse directly and avoid compares to null.
22403
22404 2002-08-02  Martin Baulig  <martin@gnome.org>
22405
22406         * class.cs (TypeContainer.Define): Define all nested interfaces here.
22407         Fixes bug #28407, added test-155.cs.
22408
22409 2002-08-01  Martin Baulig  <martin@gnome.org>
22410
22411         * class.cs (Event.EmitDefaultMethod): Make this work with static
22412         events.  Fixes #28311, added verify-3.cs.
22413
22414 2002-08-01  Martin Baulig  <martin@gnome.org>
22415
22416         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22417         `is_disposable' fields.
22418         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22419         `hm.is_disposable' if we're using the collection pattern.
22420         (Foreach.EmitCollectionForeach): Use the correct type for the
22421         enumerator's local variable, only emit the try/finally block if
22422         necessary (fixes #27713).
22423
22424 2002-08-01  Martin Baulig  <martin@gnome.org>
22425
22426         * ecore.cs (Expression.report118): Renamed to Error118 and made
22427         it public static.
22428
22429         * statement.cs (Throw.Resolve): Check whether the expression is of
22430         the correct type (CS0118) and whether the type derives from
22431         System.Exception (CS0155).
22432         (Catch.Resolve): New method.  Do the type lookup here and check
22433         whether it derives from System.Exception (CS0155).
22434         (Catch.CatchType, Catch.IsGeneral): New public properties.
22435
22436         * typemanager.cs (TypeManager.exception_type): Added.
22437
22438 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
22439
22440         * driver.cs: Updated About function.
22441
22442 2002-07-31  Martin Baulig  <martin@gnome.org>
22443
22444         Implemented Control Flow Analysis.
22445
22446         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22447         (EmitContext.CurrentBranching): Added.
22448         (EmitContext.StartFlowBranching): Added.
22449         (EmitContext.EndFlowBranching): Added.
22450         (EmitContext.KillFlowBranching): Added.
22451         (EmitContext.IsVariableAssigned): Added.
22452         (EmitContext.SetVariableAssigned): Added.
22453         (EmitContext.IsParameterAssigned): Added.
22454         (EmitContext.SetParameterAssigned): Added.
22455         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22456         Added control flow analysis stuff here.
22457
22458         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22459         resolve the expression as lvalue.
22460         (LocalVariableReference.DoResolve): Check whether the variable has
22461         already been assigned.
22462         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22463         the parameter as assigned here.
22464         (ParameterReference.DoResolve): Check whether the parameter has already
22465         been assigned.
22466         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22467         expression as lvalue.
22468
22469         * statement.cs (FlowBranching): New class for the flow analysis code.
22470         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22471         (LabeledStatement.IsDefined): New public property.
22472         (LabeledStatement.AddUsageVector): New public method to tell flow
22473         analyis that the label may be reached via a forward jump.
22474         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22475         flow analysis.
22476         (VariableInfo.Number): New public field.  This is used by flow analysis
22477         to number all locals of a block.
22478         (Block.CountVariables): New public property.  This is the number of
22479         local variables in this block (including the locals from all parent
22480         blocks).
22481         (Block.EmitMeta): Number all the variables.
22482
22483         * statement.cs: Added flow analysis support to all classes.
22484
22485 2002-07-31  Martin Baulig  <martin@gnome.org>
22486
22487         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
22488         To get debugging messages, compile mcs with /define:MCS_DEBUG and
22489         then use this argument.
22490
22491         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
22492
22493         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
22494         use this to specify /define options.
22495
22496 2002-07-29  Martin Baulig  <martin@gnome.org>
22497
22498         * statement.cs (Fixed): Moved all code that does variable lookups
22499         and resolvings from Emit to Resolve.
22500
22501         * statement.cs (For): Moved all code that does variable lookups
22502         and resolvings from Emit to Resolve.
22503
22504         * statement.cs (Using): Moved all code that does variable lookups
22505         and resolvings from Emit to Resolve.
22506
22507 2002-07-29  Martin Baulig  <martin@gnome.org>
22508
22509         * attribute.cs (Attribute.Resolve): Explicitly catch a
22510         System.NullReferenceException when creating the
22511         CustromAttributeBuilder and report a different warning message.
22512
22513 2002-07-29  Martin Baulig  <martin@gnome.org>
22514
22515         * support.cs (ParameterData.ParameterName): Added method to
22516         get the name of a parameter.
22517
22518         * typemanager.cs (TypeManager.IsValueType): New public method.
22519
22520 2002-07-29  Martin Baulig  <martin@gnome.org>
22521
22522         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
22523         is a flag which specifies that it's either ref or out.
22524         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
22525         the out parameter to `out Parameter.Modifier mod', also set the
22526         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
22527
22528         * support.cs (InternalParameters.ParameterModifier): Distinguish
22529         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22530         Parameter.Modifier.ISBYREF flag if it's either ref or out.
22531
22532         * expression.cs (Argument.GetParameterModifier): Distinguish
22533         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22534         Parameter.Modifier.ISBYREF flag if it's either ref or out.
22535
22536 2002-07-29  Martin Baulig  <martin@gnome.org>
22537
22538         * expression.cs (ParameterReference.ParameterReference): Added
22539         `Location loc' argument to the constructor.
22540
22541         * cs-parser.jay: Pass location to ParameterReference.
22542
22543 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
22544
22545         * statement.cs (Try): Initialize the location.
22546
22547         * cs-parser.jay: pass location to Try.
22548
22549         * expression.cs (Unary.Reduce): Change the prototype to return
22550         whether a constant fold could be performed or not.  The result is
22551         returned in an out parameters.  In the case of Indirection and
22552         AddressOf, we want to perform the full tests.
22553
22554 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
22555
22556         * statement.cs (Statement.Emit): Flag dead code.
22557
22558 2002-07-27  Andrew Birkett  <andy@nobugs.org>
22559
22560         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
22561
22562 2002-07-27  Martin Baulig  <martin@gnome.org>
22563
22564         * class.cs (MethodData.Define): Put back call to
22565         TypeManager.AddMethod(), accidentally commented this out.
22566
22567         * report.cs (Debug): New public method to print debugging information,
22568         this is `[Conditional ("DEBUG")]'.
22569
22570 2002-07-26  Martin Baulig  <martin@gnome.org>
22571
22572         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
22573         (switch_statement): Push the current_block to the switch_stack and
22574         pop it again when we're done with the switch.
22575         (switch_section): The new block is a child of the current_block.
22576         Fixes bug #24007, added test-152.cs.
22577
22578 2002-07-27  Martin Baulig  <martin@gnome.org>
22579
22580         * expression.cs (Invocation.EmitArguments): When calling a varargs
22581         function with only its fixed arguments, we need to pass an empty
22582         array.
22583
22584 2002-07-27  Martin Baulig  <martin@gnome.org>
22585
22586         Mono 0.13 has been released.
22587
22588 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
22589
22590         * driver.cs: Rename --resource to --linkres, because that is what
22591         we do currently, we dont support --resource yet.
22592
22593         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
22594
22595 2002-07-25  Martin Baulig  <martin@gnome.org>
22596
22597         * class.cs (MethodData): New public class.  This is a `method builder'
22598         class for a method or one accessor of a Property/Indexer/Event.
22599         (MethodData.GetMethodFlags): Moved here from MemberBase.
22600         (MethodData.ApplyAttributes): Likewise.
22601         (MethodData.ApplyObsoleteAttribute): Likewise.
22602         (MethodData.ApplyConditionalAttribute): Likewise.
22603         (MethodData.ApplyDllImportAttribute): Likewise.
22604         (MethodData.CheckAbstractAndExternal): Likewise.
22605         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
22606         (MethodData.Emit): Formerly known as Method.Emit().
22607         (MemberBase): Moved everything which was specific to a single
22608         accessor/method to MethodData.
22609         (Method): Create a new MethodData and call Define() and Emit() on it.
22610         (Property, Indexer, Event): Create a new MethodData objects for each
22611         accessor and call Define() and Emit() on them.
22612
22613 2002-07-25  Martin Baulig  <martin@gnome.org>
22614
22615         Made MethodCore derive from MemberBase to reuse the code from there.
22616         MemberBase now also checks for attributes.
22617
22618         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
22619         (MemberBase.GetMethodFlags): Moved here from class Method and marked
22620         as virtual.
22621         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
22622         `CallingConventions cc' and `Attributes opt_attrs' arguments.
22623         (MemberBase.ApplyAttributes): New virtual method; applies the
22624         attributes to a method or accessor.
22625         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
22626         (MemberBase.ApplyConditionalAttribute): Likewise.
22627         (MemberBase.ApplyDllImportAttribute): Likewise.
22628         (MemberBase.CheckAbstractAndExternal): Likewise.
22629         (MethodCore.ParameterTypes): This is now a property instead of a
22630         method, it's initialized from DoDefineParameters().
22631         (MethodCore.ParameterInfo): Removed the set accessor.
22632         (MethodCore.DoDefineParameters): New protected virtual method to
22633         initialize ParameterTypes and ParameterInfo.
22634         (Method.GetReturnType): We can now simply return the MemberType.
22635         (Method.GetMethodFlags): Override the MemberBase version and add
22636         the conditional flags.
22637         (Method.CheckBase): Moved some code from Define() here, call
22638         DoDefineParameters() here.
22639         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
22640         here to avoid some larger code duplication.
22641         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
22642         ensure that abstract and external accessors don't declare a body.
22643
22644         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
22645         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
22646         lookup in the attribute's parent classes, so we need to abort as soon
22647         as we found the first match.
22648         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
22649         the attribute has no arguments.
22650
22651         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
22652         of a Method.
22653
22654 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22655
22656         * cs-parser.jay: reverted previous patch.
22657
22658 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22659
22660         * cs-parser.jay: fixed bug #22119.
22661
22662 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22663
22664         * attribute.cs: fixed compilation. The error was:
22665         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
22666         be assigned to before control leaves the current method."
22667         [FIXME:  Filed as bug #28186: MCS must report this error.]
22668
22669 2002-07-25  Martin Baulig  <martin@gnome.org>
22670
22671         * attribute.cs (Attribute.Conditional_GetConditionName): New static
22672         method to pull the condition name ouf of a Conditional attribute.
22673         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
22674         the obsolete message and error flag out of an Obsolete attribute.
22675
22676         * class.cs (Method.GetMethodFlags): New public method to get the
22677         TypeManager.MethodFlags for this method.
22678         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
22679         private methods.
22680         (Method.Define): Get and apply the Obsolete and Conditional attributes;
22681         if we're overriding a virtual function, set the new private variable
22682         `parent_method'; call the new TypeManager.AddMethod().
22683
22684         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
22685         the MethodBuilder and the Method in a PtrHashtable.
22686         (TypeManager.builder_to_method): Added for this purpose.
22687         (TypeManager.MethodFlags): Added IsObsoleteError.
22688         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
22689         Obsolete and Conditional arguments in MethodBuilders.  If we discover
22690         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
22691         the message from the attribute.
22692
22693 2002-07-24  Martin Baulig  <martin@gnome.org>
22694
22695         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
22696         preprocessor directives, ensure that the argument to #define/#undef is
22697         exactly one identifier and that it's actually an identifier.
22698
22699         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
22700         did not work ....
22701
22702 2002-07-24  Martin Baulig  <martin@gnome.org>
22703
22704         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
22705         initialize it to TypeManager.object_type in the constructor.
22706         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
22707         of the `hm.get_current' method if we're using the collection pattern.
22708         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
22709         for the explicit conversion to make it work when we're using the collection
22710         pattern and the `Current' property has a different return type than `object'.
22711         Fixes #27713.
22712
22713 2002-07-24  Martin Baulig  <martin@gnome.org>
22714
22715         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
22716         does not match, but don't report any errors.  This method is called in
22717         order for all methods in a MethodGroupExpr until a matching method is
22718         found, so we don't want to bail out if the first method doesn't match.
22719         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
22720         matches, report the 123.  Fixes #28070.
22721
22722 2002-07-24  Martin Baulig  <martin@gnome.org>
22723
22724         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
22725         TypeManager.TypeToCoreType() to the top of the method so the
22726         following equality checks will work.  Fixes #28107.
22727
22728 2002-07-24  Martin Baulig  <martin@gnome.org>
22729
22730         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
22731         operand is of type uint, and the other operand is of type sbyte,
22732         short or int, the operands are converted to type long." -
22733         Actually do what this comment already told us.  Fixes bug #28106,
22734         added test-150.cs.
22735
22736 2002-07-24  Martin Baulig  <martin@gnome.org>
22737
22738         * class.cs (MethodBase): New abstract class.  This is now a base
22739         class for Property, Indexer and Event to avoid some code duplication
22740         in their Define() and DefineMethods() methods.
22741         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
22742         generic methods for Define() and DefineMethods().
22743         (FieldBase): Derive from MemberBase, not MemberCore.
22744         (Property): Derive from MemberBase, not MemberCore.
22745         (Property.DefineMethod): Moved all the code from this method to the
22746         new MethodBase.DefineAccessor(), just call it with appropriate
22747         argumetnts.
22748         (Property.Define): Call the new Property.DoDefine(), this does some
22749         sanity checks and we don't need to duplicate the code everywhere.
22750         (Event): Derive from MemberBase, not MemberCore.
22751         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
22752         accessors, this will also make them work with interface events.
22753         (Indexer): Derive from MemberBase, not MemberCore.
22754         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
22755         (Indexer.Define): Use the new MethodBase functions.
22756
22757         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
22758         argument to the constructor.
22759         (Interface.FindMembers): Added support for interface events.
22760         (Interface.PopluateEvent): Implemented.
22761
22762         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
22763
22764 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
22765
22766         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
22767         but this is required to check for a method name being the same as
22768         the containing class.  
22769
22770         Handle this now.
22771
22772 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22773
22774         * interface.cs: initialize variable.
22775
22776 2002-07-23  Martin Baulig  <martin@gnome.org>
22777
22778         Implemented the IndexerName attribute in interfaces.
22779
22780         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
22781         name if this is an explicit interface implementation.
22782         (Indexer.InterfaceIndexerName): New public variable.  If we're
22783         implementing an interface indexer, this is the IndexerName in that
22784         interface.  Otherwise, it's the IndexerName.
22785         (Indexer.DefineMethod): If we're implementing interface indexer,
22786         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
22787         and Pending.ImplementIndexer methods.
22788         (Indexer.Define): Also define the PropertyBuilder if we're
22789         implementing an interface indexer and this is neither an explicit
22790         interface implementation nor do the IndexerName match the one in
22791         the interface.
22792
22793         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
22794         If a method is defined here, then we always need to create a proxy
22795         for it.  This is used when implementing interface indexers.
22796         (Pending.IsInterfaceIndexer): New public method.
22797         (Pending.ImplementIndexer): New public method.
22798         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
22799         This is used when implementing interface indexers to define a proxy
22800         if necessary.
22801         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
22802         define a proxy if necessary.
22803
22804         * interface.cs (Interface.IndexerName): New public variable.
22805         (Interface.PopulateIndexer): Set the IndexerName.
22806         (Interface.DefineIndexers): New private method.  Populate all the
22807         indexers and make sure their IndexerNames match.
22808
22809         * typemanager.cs (IndexerPropertyName): Added support for interface
22810         indexers.
22811
22812 2002-07-22  Martin Baulig  <martin@gnome.org>
22813
22814         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
22815         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
22816         ret if HasReturnLabel.
22817         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
22818         variables.
22819
22820         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
22821         and set the ec.LoopBeginTryCatchLevel.
22822         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
22823         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
22824         the current ec.TryCatchLevel, the branch goes out of an exception
22825         block.  In this case, we need to use Leave and not Br.
22826
22827 2002-07-22  Martin Baulig  <martin@gnome.org>
22828
22829         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
22830         block unless the block does not always return or it is contained in
22831         another try { ... } catch { ... } block.  Fixes bug #26506.
22832         Added verify-1.cs to the test suite.
22833
22834 2002-07-22  Martin Baulig  <martin@gnome.org>
22835
22836         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
22837         then we do not always return.  Fixes bug #24985.
22838
22839 2002-07-22  Martin Baulig  <martin@gnome.org>
22840
22841         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
22842         lookup on a per-class level; ie. walk up the class hierarchy until we
22843         found at least one applicable method, then choose the best among them.
22844         Fixes bug #24463 and test-29.cs.
22845
22846 2002-07-22  Martin Baulig  <martin@gnome.org>
22847
22848         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
22849         return types of the methods.  The return type is not part of the
22850         signature and we must not check it to make the `new' modifier work.
22851         Fixes bug #27999, also added test-147.cs.
22852         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
22853
22854         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
22855         on the method's return type.
22856
22857 2002-07-21  Martin Baulig  <martin@gnome.org>
22858
22859         * assign.cs: Make this work if the rightmost source is a constant and
22860         we need to do an implicit type conversion.  Also adding a few more tests
22861         to test-38.cs which should have caught this.
22862
22863         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
22864         target in the makefile for this.  The makefile.gnu is primarily intended
22865         for end-users who don't want to debug the compiler.
22866
22867 2002-07-21  Martin Baulig  <martin@gnome.org>
22868
22869         * assign.cs: Improved the Assign class so it can now handle embedded
22870         assignments (X = Y = Z = something).  As a side-effect this'll now also
22871         consume less local variables.  test-38.cs now passes with MCS, added
22872         a few new test cases to that test.
22873
22874 2002-07-20  Martin Baulig  <martin@gnome.org>
22875
22876         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
22877         instructions.  Fixes bug #27977, also added test-146.cs.
22878
22879 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22880
22881         * cs-tokenizer.cs: fixed getHex ().
22882
22883 2002-07-19  Martin Baulig  <martin@gnome.org>
22884
22885         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
22886         not Type.GetType() to lookup the array type.  This is needed when
22887         we're constructing an array of a user-defined type.
22888         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
22889         single-dimensional arrays, but also for single-dimensial arrays of
22890         type decimal.
22891
22892 2002-07-19  Martin Baulig  <martin@gnome.org>
22893
22894         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
22895         this function is called, it's not allowed to share LocalBuilders
22896         among ILGenerators.
22897
22898 2002-07-19  Martin Baulig  <martin@gnome.org>
22899
22900         * expression.cs (Argument.Resolve): Report an error 118 when trying
22901         to pass a type as argument.
22902
22903 2002-07-18  Martin Baulig  <martin@gnome.org>
22904
22905         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
22906         Conv_R_Un for the signed `long' type.
22907
22908 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
22909
22910         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
22911         `expr' for the temporary result, as that will fail if we do
22912         multiple resolves on the same expression.
22913
22914 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
22915
22916         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
22917         ec.TypeContainer for looking up aliases. 
22918
22919         * class.cs (TypeContainer): Remove LookupAlias from here.
22920
22921         * decl.cs (DeclSpace); Move here.
22922
22923 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
22924
22925         * class.cs (FindMembers): Only call filter if the constructor
22926         bulider is not null.
22927
22928         Also handle delegates in `NestedTypes' now.  Now we will perform
22929         type lookups using the standard resolution process.  This also
22930         fixes a bug.
22931
22932         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
22933         This uses Expressions (the limited kind that can be parsed by the
22934         tree) instead of strings.
22935
22936         * expression.cs (ComposedCast.ToString): Implement, used to flag
22937         errors since now we have to render expressions.
22938
22939         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
22940         FormArrayType. 
22941
22942         * ecore.cs (SimpleName.ToString): ditto.
22943
22944         * cs-parser.jay: Instead of using strings to assemble types, use
22945         Expressions to assemble the type (using SimpleName, ComposedCast,
22946         MemberAccess).  This should fix the type lookups in declarations,
22947         because we were using a different code path for this.
22948
22949         * statement.cs (Block.Resolve): Continue processing statements
22950         even when there is an error.
22951
22952 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
22953
22954         * class.cs (Event.Define): Also remove the `remove' method from
22955         the list of pending items.
22956
22957         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22958         generate more compact code. 
22959
22960 2002-07-17  Martin Baulig  <martin@gnome.org>
22961
22962         * const.cs (Const.LookupConstantValue): Add support for constant
22963         `unchecked' and `checked' expressions.
22964         Also adding test case test-140.cs for this.
22965
22966 2002-07-17  Martin Baulig  <martin@gnome.org>
22967
22968         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22969         check whether mi.ReturnType implements the IEnumerator interface; the
22970         `==' and the IsAssignableFrom() will fail in this situation.
22971
22972 2002-07-16  Ravi Pratap  <ravi@ximian.com>
22973
22974         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
22975         here too.
22976
22977 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22978
22979         * expression.cs: fixed bug #27811.
22980
22981 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
22982
22983         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22984         Molaro: when we are a ref, the value already contains a pointer
22985         value, do not take the address of it.
22986
22987 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22988         * removed mb-parser.jay and mb-tokenizer.cs
22989
22990 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22991
22992         * expression.cs: check against the building corlib void type.
22993
22994 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22995
22996         * ecore.cs: fix for valuetype static readonly fields: when 
22997         initializing them, we need their address, not the address of a copy.
22998
22999 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23000
23001         * typemanager.cs: register also enum_type in corlib.
23002
23003 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23004
23005         * class.cs: allow calling this (but not base) initializers in structs.
23006
23007 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23008
23009         * ecore.cs: make sure we compare against the building base types
23010         in GetTypeSize ().
23011
23012 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23013
23014         * typemanager.cs: fix TypeToCoreType() to handle void and object
23015         (corlib gets no more typerefs after this change).
23016
23017 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23018
23019         * expression.cs (ArrayCreation.EmitArrayArguments): use
23020         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23021
23022         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23023         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23024         array indexes, the runtime actually forbids them.
23025
23026         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23027         for array arguments here.
23028
23029         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23030         instead of the default for ValueTypes.
23031
23032         (New.DoEmit): Use IsValueType instead of
23033         IsSubclassOf (value_type)
23034         (New.DoResolve): ditto.
23035         (Invocation.EmitCall): ditto.
23036
23037         * assign.cs (Assign): ditto.
23038
23039         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23040         Statements *are* currently doing part of their resolution during
23041         Emit.  
23042
23043         Expressions do always resolve during resolve, but statements are
23044         only required to propagate resolution to their children.
23045
23046 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23047
23048         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23049
23050         (LoadAssembly): Do not add the dll if it is already specified
23051
23052         (MainDriver): Add the System directory to the link path at the end,
23053         after all the other -L arguments. 
23054
23055         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23056         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23057         ldelem.u1) and using the opposite for sbytes.
23058
23059         This fixes Digger, and we can finally run it.
23060
23061         * driver.cs (UnixParseOption): Move the option parsing here.  
23062         (CSCParseOption): Implement CSC-like parsing of options.
23063
23064         We now support both modes of operation, the old Unix way, and the
23065         new CSC-like way.  This should help those who wanted to make cross
23066         platform makefiles.
23067
23068         The only thing broken is that /r:, /reference: and /lib: are not
23069         implemented, because I want to make those have the same semantics
23070         as the CSC compiler has, and kill once and for all the confussion
23071         around this.   Will be doing this tomorrow.
23072
23073         * statement.cs (Unsafe.Resolve): The state is checked during
23074         resolve, not emit, so we have to set the flags for IsUnsfe here.
23075
23076 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23077
23078         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23079         not catch the Error_ObjectRefRequired in SimpleName (as it is
23080         possible to have a class/instance variable name that later gets
23081         deambiguated), we have to check this here.      
23082
23083 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23084
23085         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23086         make static and put into Expression.
23087
23088         (Event.Define): Register the private field of the event with the 
23089         TypeManager so that GetFieldFromEvent can get at it.
23090
23091         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23092         keep track of the private field associated with an event which
23093         has no accessors.
23094
23095         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23096         private field.
23097
23098         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23099
23100 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23101
23102         * expression.cs (Binary.EmitBranchable): this routine emits the
23103         Binary expression in a branchable context.  This basically means:
23104         we need to branch somewhere, not just get the value on the stack.
23105
23106         This works together with Statement.EmitBoolExpression.
23107
23108         * statement.cs (Statement.EmitBoolExpression): Use
23109         EmitBranchable. 
23110
23111 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * statement.cs (For): Reduce the number of jumps in loops.
23114
23115         (For): Implement loop inversion for the For statement.
23116
23117         (Break): We can be breaking out of a Try/Catch controlled section
23118         (foreach might have an implicit try/catch clause), so we need to
23119         use Leave instead of Br.
23120
23121         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23122         now).  If the instace expression supports IMemoryLocation, we use
23123         the AddressOf method from the IMemoryLocation to extract the
23124         address instead of emitting the instance.
23125
23126         This showed up with `This', as we were emitting the instance
23127         always (Emit) instead of the Address of This.  Particularly
23128         interesting when This is a value type, as we dont want the Emit
23129         effect (which was to load the object).
23130
23131 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
23132
23133         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23134
23135         * statement.cs (Checked): Set the CheckedState during the resolve
23136         process too, as the ConvCast operations track the checked state on
23137         the resolve process, and not emit.
23138
23139         * cs-parser.jay (namespace_member_declaration): Flag that we have
23140         found a declaration when we do.  This is used to flag error 1529
23141
23142         * driver.cs: Report ok when we display the help only.
23143
23144 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
23145
23146         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23147
23148 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * cs-tokenizer.cs (define): We also have to track locally the
23151         defines.  AllDefines is just used for the Conditional Attribute,
23152         but we also need the local defines for the current source code. 
23153
23154 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
23155
23156         * statement.cs (While, For, Do): These loops can exit through a
23157         Break statement, use this information to tell whether the
23158         statement is the last piece of code.
23159
23160         (Break): Flag that we break.
23161
23162         * codegen.cs (EmitContexts): New `Breaks' state variable.
23163
23164 2002-07-03  Martin Baulig  <martin@gnome.org>
23165
23166         * class.cs (TypeContainer.MethodModifiersValid): Allow override
23167         modifiers in method declarations in structs.  Otherwise, you won't
23168         be able to override things like Object.Equals().
23169
23170 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23171
23172         * class.cs (Method, Property, Indexer): Do not allow the public
23173         modifier to be used in explicit interface implementations.
23174
23175         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23176         override modifiers in method declarations in structs
23177
23178 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
23179
23180         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23181         integer or real overflow, report an error
23182
23183 2002-07-02  Martin Baulig  <martin@gnome.org>
23184
23185         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23186         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23187         to tell the runtime about our newly created System.Object and
23188         System.ValueType types.
23189
23190 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23191
23192         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23193         struct instead of Ldarg/Starg.
23194
23195 2002-07-02  Martin Baulig  <martin@gnome.org>
23196
23197         * expression.cs (Indirection.Indirection): Call
23198         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23199
23200 2002-07-02  Martin Baulig  <martin@gnome.org>
23201
23202         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23203         ValueType, call TypeManager.TypeToCoreType() on it.
23204         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23205         the OpCodes.Newarr argument.
23206
23207 2002-07-02  Martin Baulig  <martin@gnome.org>
23208
23209         * expression.cs (Invocation.EmitCall): When compiling corlib,
23210         replace all calls to the system's System.Array type to calls to
23211         the newly created one.
23212
23213         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23214         System.Array methods.
23215         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23216         from the system's System.Array type which must be replaced.
23217
23218 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23219
23220         * typemanager.cs: load unverifiable_code_ctor so we can build
23221         corlib using the correct type. Avoid using GetTypeCode() with
23222         TypeBuilders.
23223         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23224         TypeManager.object_type to allow building corlib.
23225
23226 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23227
23228         * ecore.cs: handle System.Enum separately in LoadFromPtr().
23229
23230 2002-07-01  Martin Baulig  <martin@gnome.org>
23231
23232         * class.cs: Make the last change actually work, we need to check
23233         whether `ifaces != null' to avoid a crash.
23234
23235 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23236
23237         * class.cs: when we build structs without fields that implement
23238         interfaces, we need to add the interfaces separately, since there is
23239         no API to both set the size and add the interfaces at type creation
23240         time.
23241
23242 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23243
23244         * expression.cs: the dimension arguments to the array constructors
23245         need to be converted if they are a long.
23246
23247 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23248
23249         * class.cs: don't emit ldarg.0 if there is no parent constructor
23250         (fixes showstopper for corlib).
23251
23252 2002-06-29  Martin Baulig  <martin@gnome.org>
23253
23254         MCS now compiles corlib on GNU/Linux :-)
23255
23256         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23257         ie. check for MethodImplOptions.InternalCall.
23258
23259         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23260         and TypeManager.attribute_type are null, so we must explicitly check
23261         whether parent is not null to find out whether it's an attribute type.
23262         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23263         and SetBuilder, not only if the property is neither abstract nor external.
23264         This is necessary to set the MethodImplOptions on the accessor methods.
23265         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23266         SetBuilder, see Property.Emit().
23267
23268         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23269         populate "System.Object", "System.ValueType" and "System.Attribute" since
23270         they've already been populated from BootCorlib_PopulateCoreTypes().
23271
23272 2002-06-29  Martin Baulig  <martin@gnome.org>
23273
23274         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23275         is the NullLiteral, we also need to make sure that target_type is not
23276         an enum type.   
23277
23278 2002-06-29  Martin Baulig  <martin@gnome.org>
23279
23280         * rootcontext.cs (RootContext.ResolveCore): We must initialize
23281         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23282         before calling BootstrapCorlib_ResolveDelegate ().
23283
23284 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23285
23286         * statement.cs: fixed build-breaker. All tests passed ok.
23287
23288 2002-06-27  Martin Baulig  <martin@gnome.org>
23289
23290         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23291         for System.Decimal when compiling corlib.
23292
23293 2002-06-27  Martin Baulig  <martin@gnome.org>
23294
23295         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23296         switch blocks which contain nothing but a default clause.
23297
23298 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
23299
23300        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23301
23302 2002-06-27  Martin Baulig  <martin@gnome.org>
23303
23304         * ecore.cs (PropertyExpr.PropertyExpr): Call
23305         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23306
23307         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23308         is already a TypeBuilder.
23309
23310 2002-06-27  Martin Baulig  <martin@gnome.org>
23311
23312         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23313         `target_type == TypeManager.array_type', not IsAssignableFrom() in
23314         the "from an array-type to System.Array" case.  This makes it work
23315         when compiling corlib.
23316
23317 2002-06-27  Martin Baulig  <martin@gnome.org>
23318
23319         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23320         non-static PropertyExpr, set its InstanceExpression.  This makes
23321         the `ICollection.Count' property work in System/Array.cs.
23322
23323 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
23324
23325         * driver.cs: Made error handling more consistent.  Errors now
23326         tracked by Report class, so many methods which used to return int
23327         now return void.  Main() now prints success/failure and 
23328         errors/warnings message.
23329
23330         Renamed '--probe' compiler argument to '--expect-error'.  Removed
23331         the magic number return values (123 and 124).  Now, if the
23332         expected error occurs, the compiler exits with success (exit value
23333         0).  If the compilation completes without seeing that particular
23334         error, the compiler exits with failure (exit value 1).  The
23335         makefile in mcs/errors has been changed to handle the new behaviour.
23336
23337         * report.cs: Made 'expected error' number a property and renamed
23338         it from 'Probe' to 'ExpectedError'.
23339
23340         * genericparser.cs: Removed error handling support, since it is
23341         now all done by Report class.
23342
23343         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23344         class, so parse() no longer returns an int.
23345
23346         * namespace.cs: Use Report.Error instead of GenericParser.error
23347
23348 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
23349
23350         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23351         TypeContainer.AddOperator): At the front of the list put the
23352         explicit implementations, so they get resolved/defined first. 
23353
23354 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23357         interface type is implemented by this TypeContainer.  Used during
23358         explicit interface implementation.
23359
23360         (Property.Define, Indexer.Define, Method.Define): Validate that
23361         the given interface in the explicit implementation is one of the
23362         base classes for the containing type.
23363
23364         Also if we are explicitly implementing an interface, but there is
23365         no match in the pending implementation table, report an error.
23366
23367         (Property.Define): Only define the property if we are
23368         not explicitly implementing a property from an interface.  Use the
23369         correct name also for those properties (the same CSC uses,
23370         although that is really not needed).
23371
23372         (Property.Emit): Do not emit attributes for explicitly implemented
23373         properties, as there is no TypeBuilder.
23374
23375         (Indexer.Emit): ditto.
23376
23377         Hiding then means that we do not really *implement* a pending
23378         implementation, which makes code fail.
23379
23380 2002-06-22  Martin Baulig  <martin@gnome.org>
23381
23382         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23383         the return value of Object.GetType().  [FIXME: we need to do this whenever
23384         we get a type back from the reflection library].
23385
23386 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23387
23388         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23389
23390 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
23391
23392         * attribute.cs: Return null if we can not look up the type.
23393
23394         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23395         the interface types found.
23396
23397         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23398         interface types found.
23399
23400         * typemanager.cs (GetInterfaces): Make this routine returns alll
23401         the interfaces and work around the lame differences between
23402         System.Type and System.Reflection.Emit.TypeBuilder in the results
23403         result for GetInterfaces.
23404
23405         (ExpandInterfaces): Given an array of interface types, expand and
23406         eliminate repeated ocurrences of an interface.  This expands in
23407         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23408         be IA, IB, IC.
23409
23410 2002-06-21  Martin Baulig  <martin@gnome.org>
23411
23412         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23413         on System.Enum.
23414
23415 2002-06-21  Martin Baulig  <martin@gnome.org>
23416
23417         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
23418         and called with one of the core types, return the corresponding typebuilder for
23419         that type.
23420
23421         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23422         element type.
23423
23424 2002-06-21  Martin Baulig  <martin@gnome.org>
23425
23426         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23427         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23428         (Expression.ConvertReferenceExplicit): Likewise.
23429
23430         * expression.cs (ElementAccess.DoResolve): Likewise.
23431         (ElementAccess.DoResolveLValue): Likewise.
23432
23433 2002-06-10  Martin Baulig  <martin@gnome.org>
23434
23435         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23436         add the "value" parameter to the parameter list.
23437
23438         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23439         to our caller.
23440
23441 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
23442
23443         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23444         the argument to an int, uint, long or ulong, per the spec.  Also
23445         catch negative constants in array creation.
23446
23447 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23448
23449         * class.cs: do not allow the same interface to appear twice in
23450         the definition list.
23451
23452 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23453
23454         * ecore.cs: don't use ldlen with System.Array.
23455
23456 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23457
23458         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23459
23460 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23461
23462         * modifiers.cs: produce correct field attributes for protected
23463         internal. Easy fix so miguel can work on ther harder stuff:-)
23464
23465 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
23466
23467         * pending.cs: New file.  Move the code from class.cs here.
23468         Support clearning the pending flag for all methods (when not doing
23469         explicit interface implementation).
23470
23471 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23472
23473         * rootcontext.cs: added a couple more types needed to bootstrap.
23474
23475 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
23476
23477         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23478         constructor in the type, instead of any constructor in the type
23479         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
23480         a bug in the Mono runtime when applying the params attribute). 
23481
23482 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
23483         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23484
23485 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
23486
23487         * expression.cs (Unary.ResolveOperator): Use TypeManager
23488         to resolve the type.
23489
23490 2002-06-13  Ravi Pratap  <ravi@ximian.com>
23491
23492         * cs-parser.jay (enum_member_declaration): Pass in the attributes
23493         attached.
23494
23495         * enum.cs (AddEnumMember): Add support to store the attributes associated 
23496         with each member too.
23497
23498         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
23499         field builders too - this takes care of the enum member case.
23500
23501 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
23502
23503         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
23504         address-of operator on both value types and pointers.
23505
23506 2002-06-10  Martin Baulig  <martin@gnome.org>
23507
23508         * interface.cs (Interface.PopulateIndexer): Add the indexer's
23509         PropertyBuilder to the `property_builders' list.
23510
23511         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
23512         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
23513         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
23514         find any indexers which are inherited from an interface.
23515
23516 2002-06-09  Martin Baulig  <martin@gnome.org>
23517
23518         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
23519         the same type as the constant if necessary.  There's also a test-130.cs
23520         for this.
23521
23522         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
23523
23524         * typemanager.cs (TypeManager.ChangeType): Previously known as
23525         Enum.ChangeEnumType().
23526
23527 2002-06-09  Martin Baulig  <martin@gnome.org>
23528
23529         * expression.cs (Cast.TryReduce): Added support for consts.
23530
23531 2002-06-08  Ravi Pratap  <ravi@ximian.com>
23532
23533         * class.cs (Accessor): Hold attributes information so we can pass
23534         it along.
23535
23536         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
23537         Modify to pass in attributes attached to the methods.
23538
23539         (add_accessor_declaration, remove_accessor_declaration): Ditto.
23540
23541         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
23542         to handle the Accessor kind :-)
23543
23544         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
23545
23546 2002-06-08  Martin Baulig  <martin@gnome.org>
23547
23548         * expression.cs (Unary.TryReduceNegative): Added support for
23549         ULongConstants.
23550
23551 2002-06-08  Martin Baulig  <martin@gnome.org>
23552
23553         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
23554         name can't be found in the `defined_names' - the caller will do a
23555         MemberLookup in this case and thus find methods in System.Enum
23556         such as Enum.IsDefined().
23557
23558 2002-06-08  Martin Baulig  <martin@gnome.org>
23559
23560         * enum.cs (Enum.ChangeEnumType): This is a custom version of
23561         Convert.ChangeType() which works with TypeBuilder created types.
23562         (Enum.LookupEnumValue, Enum.Define): Use it here.
23563
23564         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
23565         `TypeBuilder.BaseType != null' check.
23566         (TypeContainer.FindMembers): Only lookup parent members if we
23567         actually have a parent.
23568         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
23569         (ConstructorInitializer.Resolve): Likewise.
23570
23571         * interface.cs (Interface.FindMembers): Added
23572         `TypeBuilder.BaseType != null' check.
23573
23574         * rootcontext.cs (RootContext.ResolveCore): Added
23575         "System.Runtime.CompilerServices.IndexerNameAttribute" to
23576         classes_second_stage.
23577
23578         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
23579         debug_type and trace_type when compiling with --nostdlib.       
23580
23581 2002-06-07  Martin Baulig  <martin@gnome.org>
23582
23583         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
23584         (AddField): Set it to true when adding a non-static field.
23585         (DefineType): Use `have_nonstatic_fields' to find out whether we
23586         have non-static fields, not `Fields != null'.
23587
23588 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
23589
23590         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
23591         dereferencing a null on the static-field code path)
23592
23593 2002-05-30  Martin Baulig  <martin@gnome.org>
23594
23595         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
23596         to take command line arguments.  Use reflection to call the new
23597         custom `Initialize' function on the symbol writer and pass it the
23598         command line arguments.
23599
23600         * driver.cs (--debug-args): New command line argument to pass command
23601         line arguments to the symbol writer.
23602
23603 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
23604
23605         * assign.cs (DoResolve): Forgot to do the implicit conversion to
23606         the target type for indexers and properties.  Thanks to Joe for
23607         catching this.
23608
23609 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
23610
23611         * typemanager.cs (MethodFlags): returns the method flags
23612         (Obsolete/ShouldIgnore) that control warning emission and whether
23613         the invocation should be made, or ignored. 
23614
23615         * expression.cs (Invocation.Emit): Remove previous hack, we should
23616         not do this on matching a base type, we should do this based on an attribute
23617
23618         Only emit calls to System.Diagnostics.Debug and
23619         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
23620         on the command line.
23621
23622         * rootcontext.cs: Global settings for tracing and debugging.
23623
23624         * cs-tokenizer.cs (define): New utility function to track
23625         defines.   Set the global settings for TRACE and DEBUG if found.
23626
23627 2002-05-25  Ravi Pratap  <ravi@ximian.com>
23628
23629         * interface.cs (Populate*): Pass in the TypeContainer as well as
23630         the DeclSpace as parameters so that we can create EmitContexts and
23631         then use that to apply attributes etc.
23632
23633         (PopulateMethod, PopulateEvent, PopulateProperty)
23634         (PopulateIndexer): Apply attributes everywhere.
23635
23636         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
23637         etc.
23638
23639         (ApplyAttributes): Update accordingly.
23640
23641         We now apply interface attributes for all members too.
23642
23643 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
23644
23645         * class.cs (Indexer.Define); Correctly check if we are explicit
23646         implementation (instead of checking the Name for a ".", we
23647         directly look up if the InterfaceType was specified).
23648
23649         Delay the creation of the PropertyBuilder.
23650
23651         Only create the PropertyBuilder if we are not an explicit
23652         interface implementation.   This means that explicit interface
23653         implementation members do not participate in regular function
23654         lookups, and hence fixes another major ambiguity problem in
23655         overload resolution (that was the visible effect).
23656
23657         (DefineMethod): Return whether we are doing an interface
23658         implementation. 
23659
23660         * typemanager.cs: Temporary hack until we get attributes in
23661         interfaces (Ravi is working on that) and we get IndexerName
23662         support in interfaces.
23663
23664         * interface.cs: Register the indexers as properties.
23665
23666         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
23667         warning, I have verified that this is a bug in the .NET runtime
23668         (JavaScript suffers of the same problem).
23669
23670         * typemanager.cs (MemberLookup): When looking up members for
23671         interfaces, the parent of an interface is the implicit
23672         System.Object (so we succeed in searches of Object methods in an
23673         interface method invocation.  Example:  IEnumerable x;  x.ToString
23674         ()) 
23675
23676 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
23677
23678         * class.cs (Event): Events should also register if they do
23679         implement the methods that an interface requires.
23680
23681         * typemanager.cs (MemberLookup); use the new GetInterfaces
23682         method. 
23683
23684         (GetInterfaces): The code used to lookup interfaces for a type is
23685         used in more than one place, factor it here. 
23686
23687         * driver.cs: Track the errors at the bottom of the file, we kept
23688         on going.
23689
23690         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
23691         instance if the method we are calling is static!
23692
23693 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
23694
23695         * attribute.cs (ApplyAttributes): Make this function filter out
23696         the IndexerName attribute (as that attribute in reality is never
23697         applied) and return the string constant for the IndexerName
23698         attribute. 
23699
23700         * class.cs (TypeContainer.Emit): Validate that all the indexers
23701         have the same IndexerName attribute, and if so, set the
23702         DefaultName attribute on the class. 
23703
23704         * typemanager.cs: The return value might contain other stuff (not
23705         only methods).  For instance, consider a method with an "Item"
23706         property and an Item method.
23707
23708         * class.cs: If there is a problem with the parameter types,
23709         return. 
23710
23711 2002-05-24  Ravi Pratap  <ravi@ximian.com>
23712
23713         * ecore.cs (ImplicitConversionExists): Wrapper function which also
23714         looks at user defined conversion after making a call to 
23715         StandardConversionExists - we need this for overload resolution.
23716
23717         * expression.cs : Update accordingly the various method calls.
23718
23719         This fixes 2 bugs filed against implicit user defined conversions 
23720
23721 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
23722
23723         * statement.cs: Track the result of the assignment.
23724
23725 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
23726
23727         * expression.cs (MemberAccess): Improved error reporting for
23728         inaccessible members.
23729
23730 2002-05-22  Martin Baulig  <martin@gnome.org>
23731
23732         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
23733         itself with debugging support.
23734
23735 2002-05-22  Martin Baulig  <martin@gnome.org>
23736
23737         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
23738         Removed, this isn't needed anymore.
23739
23740 2002-05-20  Martin Baulig  <martin@gnome.org>
23741
23742         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
23743         be underlying type for an enum.
23744
23745 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
23746
23747         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
23748         that splits out the loading of just the core types.
23749
23750         * rootcontext.cs (ResolveCore): Split the struct resolution in
23751         two, so we can load the enumeration underlying types before any
23752         enums are used.
23753
23754         * expression.cs (Is): Bandaid until we fix properly Switch (see
23755         bug #24985 for details).
23756
23757         * typemanager.cs (ImplementsInterface): The hashtable will contain
23758         a null if there are no interfaces implemented.
23759
23760 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
23761
23762         * cs-parser.jay (indexer_declarator): It is fine to have array
23763         parameters
23764
23765 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
23766
23767         * typemanager.cs: (RegisterBuilder): New function used to register
23768         TypeBuilders that implement interfaces.  Since
23769         TypeBuilder.GetInterfaces (as usual) does not work with lame
23770         Reflection.Emit. 
23771         (AddUserType): register interfaces.
23772
23773         (ImplementsInterface): Use the builder_to_ifaces hash if we are
23774         dealing with TypeBuilder.  Also, arrays are showing up as
23775         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
23776         methods can not be invoked on them!
23777
23778         * ecore.cs (ExplicitReferenceConversionExists): Made public.
23779         (ImplicitReferenceConversionExists): Split out from
23780         StandardConversionExists. 
23781
23782         * expression.cs (As): We were only implementing one of the three
23783         cases for the as operator.  We now implement them all.
23784         (Is): Implement the various other cases for Is as well.
23785
23786         * typemanager.cs (CACHE): New define used to control if we want or
23787         not the FindMembers cache.  Seems to have a negative impact on
23788         performance currently
23789
23790         (MemberLookup): Nested types have full acess to
23791         enclosing type members
23792
23793         Remove code that coped with instance/static returns for events, we
23794         now catch this in RealFindMembers.
23795
23796         (RealFindMembers): only perform static lookup if the instance
23797         lookup did not return a type or an event.  
23798
23799 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
23800
23801         * assign.cs (CompoundAssign): We pass more semantic information
23802         now to Compound Assignments than we did before: now we have all
23803         the information at hand, and now we resolve the target *before* we
23804         do the expression expansion, which allows the "CacheValue" method
23805         to have the effect we intended (before, a [x] += 1 would generate
23806         two differen ArrayAccess expressions from the ElementAccess,
23807         during the resolution process).
23808
23809         (CompoundAssign.DoResolve): Resolve target and original_source here.
23810
23811 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
23812
23813         * expression.cs (ArrayAccess): dropped debugging information. 
23814
23815         * typemanager.cs: Small bug fix: I was always returning i_members,
23816         instead of one of i_members or s_members (depending on which had
23817         the content).
23818
23819         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
23820         method is invoked before any code generation takes place, and it
23821         is a mechanism to inform that the expression will be invoked more
23822         than once, and that the method should use temporary values to
23823         avoid having side effects
23824
23825         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
23826
23827         * ecore.cs (Expression.CacheTemporaries): Provide empty default
23828         implementation.
23829
23830         * expression.cs (Indirection, ArrayAccess): Add support for
23831         CacheTemporaries in these two bad boys. 
23832
23833         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
23834         ldobj or ldind_ref.  
23835         (StoreFromPtr): Handle stobj as well.
23836
23837         * expression.cs (UnaryMutator): Share more code.
23838
23839         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
23840         down: I was not tracking the Filter function as well, which
23841         was affecting the results of the cache.
23842
23843 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
23844
23845         * attribute.cs: Remove the hack to handle the CharSet property on
23846         StructLayouts. 
23847
23848 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
23849
23850         * attribute.cs (DoResolve): More uglyness, we now only try to
23851         resolve the attribute partially, to extract the CharSet
23852         information (only if we are a StructLayout attribute).  Otherwise 
23853
23854         (GetExtraTypeInfo): Add some code to conditionally kill in the
23855         future this.   I am more and more convinced that the .NET
23856         framework has special code to handle the attribute setting on
23857         certain elements.
23858
23859         * expression.cs (IsParamsMethodApplicable): Revert my previous
23860         foreach change here, it was wrong.
23861
23862 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
23863
23864         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
23865         (pp_expr): do not abort on unknown input, just return.
23866         (eval): abort if there are pending chars.
23867
23868         * attribute.cs (Attribute.Resolve): Positional parameters are
23869         optional.  Deal with that case.
23870
23871         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
23872         the Ansi/Unicode/Auto information for the type.
23873
23874         (TypeContainer.DefineType): instantiate the EmitContext here, as
23875         we will be using it during the type definition (to resolve
23876         attributes) and during the emit phase.
23877
23878         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
23879         to pull type information out of the attributes
23880
23881         (Attribute.Resolve): track the constructor builder, and allow for
23882         multiple invocations (structs and classes will use this).
23883
23884         * ecore.cs (MemberLookupFinal): new version with all the
23885         parameters customizable.
23886
23887         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
23888         constructors.  Return if the result value is null (as the error
23889         would have been flagged already by MemberLookupFinal)
23890
23891         Do not allow instances of abstract classes or interfaces to be
23892         created.
23893
23894         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
23895         We have to compare the assembly property here when dealing with
23896         FamANDAssem and Assembly access modifiers, because we might be
23897         creating an assembly from *modules* (that means that we are not
23898         getting TypeBuilders for types defined in other modules that are
23899         part of this assembly).
23900
23901         (Method.Emit): If the method is marked abstract and has a body,
23902         emit an error. 
23903
23904         (TypeContainer.DefineMembers): If both the defined member and the
23905         parent name match are methods, then do not emit any warnings: let
23906         the Method.Define routine take care of flagging warnings.  But if
23907         there is a mismatch (method overrides something else, or method is
23908         overriwritten by something, then emit warning).
23909
23910         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
23911         set to null, this means `do not check for the return type on the
23912         signature'. 
23913
23914         (Method.Define): set the return type for the method signature to
23915         null, so that we get methods with the same name and parameters and
23916         different return types.  This is used to flag warning 114 (you are
23917         hiding a method, and you probably want to use the new/override
23918         keywords instead).
23919
23920         * typemanager.cs (MemberLookup): Implemented proper access
23921         control, closing a long standing set of bug reports.  The problem
23922         was that the Framework only has two bits: Public and NonPublic,
23923         and NonPublic includes private and protected methods, but we need
23924         to enforce the FamANDAssem, FamOrAssem and Family. 
23925
23926 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
23927
23928         * statement.cs (GotoCase): Return true: Ammounts to giving up
23929         knowledge on whether we return or not, and letting the other case
23930         be responsible for it.
23931
23932 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
23933
23934         * driver.cs: Do not load directories for each file processed, only
23935         do it if there is a pattern.
23936
23937         * ecore.cs: Report readonly assigns here as well, as we might have
23938         been resolved only by MemberAccess.
23939
23940         (SimpleName.SimpleNameResolve): Also be useful for LValue
23941         resolution.   We need this to propagate assign to local readonly variables
23942
23943         * typemanager.cs: Use a ptrhashtable for the criteria, because we
23944         do not want to reuse potential criteria memory.
23945
23946         * class.cs (MyEventBuilder): Set reflected_type;
23947
23948         * ecore.cs (Constantify): Added support for constifying bools.
23949
23950         (RootContext.LookupType): Added a cache for values looked up in
23951         the declaration space.
23952
23953         * typemanager.cs (FindMembers): Now is a front-end to
23954         RealFindMembers, and provides a two-level hashtable-based cache to
23955         the request.  
23956
23957         15% performance improvement: from 22.5 to 19.2 seconds.
23958
23959         * expression.cs (IsParamsMethodApplicable): use foreach.
23960         (Invocation.DoResolve): ditto.
23961         (New.DoResolve): ditto.
23962         (ArrayCreation.DoResolve): ditto.
23963
23964         * ecore.cs (FindMostEncompassingType): use foreach.
23965
23966         * delegate.cs (NewDelegate.DoResolve): Use foreach
23967
23968         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23969         (RemoveMethods): use foreach.
23970
23971         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23972         nested foreach statements instead of for, and also break out of
23973         the inner loop once a match is found.
23974
23975         (Invocation.OverloadResolve): Use foreach, simplify the code. 
23976
23977 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
23978
23979         * cfold.cs (BinaryFold): During an enumeration evaluation context,
23980         we actually unwrap the expression to allow for extra information
23981         to be extracted. 
23982
23983         * expression.cs: Use Shr_Un on unsigned operations. 
23984
23985 2002-05-08  Ravi Pratap  <ravi@ximian.com>
23986
23987         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
23988         applicable operators was not being considered correctly. This closes
23989         the bug Miguel reported.
23990
23991 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23992
23993         * attribute.cs: check that the type derives from System.Attribute
23994         and report the correct error in that case (moved the duplicate code to
23995         its own method, too).
23996
23997 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23998
23999         * attribute.cs: lookup attribute type name as the spec says: first the
24000         bare attribute name and then name + "Attribute" (nant compiles with
24001         mcs after this fix).
24002
24003 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24004
24005         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24006         Because of the way we parse things, we should try to see if a
24007         UIntConstant can fit in an integer.
24008
24009 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24010
24011         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24012         when we are in an explicit context.
24013
24014         (ConvertReferenceExplicit): When converting from Iface type S to Class
24015         T make sure the rules are implemented as an OR.
24016
24017         * parameter.cs (ParameterType): Make it a property for now although the
24018         purpose really isn't anything immediate.
24019
24020         * expression.cs (Is*Applicable): Do better checking on the parameter type
24021         of a ref/out parameter. The ones from the system assemblies are already 
24022         marked with the correct type so we don't need to do any correction.
24023
24024         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24025         the object type is standard too so include that.
24026
24027 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24028
24029         * ecore.cs (StandardConversionExists): Augment with missing code:
24030         deal with IntConstant, LongConstants and Enumerations.
24031
24032         * assign.cs: Report the error, instead of failing silently
24033
24034         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24035         typecontainer that they are declared, because the
24036         typecontainer/namespace will have the list of using clauses that
24037         need to be applied.
24038
24039         Assembly Attributes were escaping the normal registration
24040         mechanism. 
24041
24042         (EmitCode): Apply attributes within an EmitContext that represents
24043         the container they were declared on.
24044
24045         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24046
24047 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24048
24049         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24050         Revamp completely - make much cleaner as we now operate only
24051         on a set of Types.
24052
24053         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24054         to implement the logic detailed in the spec more correctly.
24055
24056         (UserDefinedConversion): Update accordingly.
24057
24058 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24059
24060         * statement.cs: Return flow analysis information up.
24061
24062         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24063         and the default.
24064
24065         (token): Do not consume an extra character before calling
24066         decimal_digits.
24067
24068 2002-05-06  Piers Haken <piersh@friskit.com>
24069
24070         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24071
24072 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24073
24074         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24075         EmitContext during the instance constructor initializer
24076         resolution, to stop access to instance variables.
24077
24078         This is mandated by the spec, last paragraph of the `constructor
24079         initializers' section. 
24080
24081 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24082
24083         * cs-parser.jay, class.cs (Accessor): new class used to represent
24084         an accessor (get or set).  In the past we used `null' to represent
24085         a missing accessor.  But this is ambiguous because there was no
24086         way to tell in abstract indexers/properties if one of them was
24087         specified.
24088
24089         Now there is a way of addressing that.
24090
24091         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24092         instead of FindMembers.
24093
24094         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24095         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24096
24097         * attribute.cs: Treat indexers and properties as the same in terms
24098         of applying attributes
24099
24100         * ecore.cs (FindMostEncompassedType): Use statically initialized
24101         EmptyExpressions()s like we do elsewhere to avoid creating useless
24102         objects (and we take this out of the tight loop).
24103
24104         (GetConversionOperators): Move the code to extract the actual
24105         operators to a separate routine to clean things up.
24106
24107 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24108
24109         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24110         events are always registered FieldBuilders.
24111
24112         * class.cs (FieldBase): New class shared by Fields 
24113
24114         * delegate.cs: If we are a toplevel delegate, use our full name.
24115         If we are a nested delegate, then only use our tail name.
24116
24117 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24118
24119         * expression.cs (IsApplicable): Ensure that we add the "&" to
24120         ref/out types before comparing it with the type of the argument.
24121
24122         (IsParamsMethodApplicable): Ditto.
24123
24124         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24125         silly me ;-)
24126
24127         * delegate.cs : Handle the case when we have more than one applicable
24128         method. Flag an error only when we finish checking all.
24129
24130 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
24131
24132         * expression.cs: Add support for boolean static initializers.
24133
24134 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
24135
24136         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24137
24138         * parameter.cs (ComputeParameterTypes,
24139         ComputeAndDefineParameterTypes): Better error handling: now we
24140         clear the `types' cache if we fail during any of the type lookups.
24141         We also return the status code correctly to our caller
24142
24143         * delegate.cs: If we fail to define a delegate, abort the extra
24144         steps. 
24145
24146         * expression.cs (Binary.ResolveOperator): for
24147         operator==(object,object) and operator !=(object, object) we also
24148         have to verify that there is an implicit conversion from one to
24149         the other.
24150
24151         (ArrayAccess.DoResolve): Array Access can operate on
24152         non-variables. 
24153
24154 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
24155
24156         * assign.cs (CompoundAssign): A new class used as a "flag" that
24157         the assignment actually is happening as part of a compound
24158         assignment operator.
24159
24160         During compound assignment, a few new rules exist to enable things
24161         like:
24162
24163         byte b |= 1 + 2
24164
24165         From the spec:
24166
24167         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24168         to the type of x) if y is implicitly convertible to the type of x,
24169         and the operator is a builtin operator and the return type of the
24170         operator is explicitly convertible to the type of x. 
24171
24172         * rootcontext.cs: Reset warning level to 2.  4 catches various
24173         "interesting" features in mcs, we must clean this up at some
24174         point, but currently am trying to kill other bugs ;-)
24175
24176         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24177         in container classes as well.  
24178
24179         * expression.cs (Binary.ResolveOperator): Handle string case
24180         before anything else (as operator overloading does emit an error
24181         before doing anything else).
24182
24183         This code could go away when we move to a table driven model, but
24184         i could not come up with a good plan last night.
24185
24186 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
24187
24188         * typemanager.cs (CSharpName): reimplementation using regex.
24189         * class.cs: added null check for fields in Emit
24190         * rootcontext.cs: set warninglevel to 4
24191
24192 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
24193
24194         * typemanager.cs (CSharpName): reimplemented with Lupus
24195         suggestion.
24196
24197 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
24198
24199         * statement.cs (If): correclty implement Resolve, because we were
24200         not catching sem errors in there.  The same process is needed
24201         everywhere else. 
24202         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24203
24204
24205         (Statement.Warning_DeadCodeFound): Factorize code.
24206         (While): Report dead code here too.
24207
24208         (Statement): Added Resolve virtual method to allow
24209         for resolution split from the emit code.
24210
24211 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24212
24213         * statement.cs (EmitBoolExpression): No longer try to resolve the
24214         expression here.    
24215         (MakeBoolean): New utility function that resolve, implicitly
24216         converts to boolean and tags the expression. 
24217
24218
24219         (If, Do): Implement dead code elimination.
24220         (While): Implement loop inversion
24221
24222         (Do, While, For, If): Resolve the expression prior to calling our
24223         code generation.
24224
24225 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
24226
24227         * class.cs:
24228           - added method Report28 (warning: program has more than one entry point)
24229           - added method IsEntryPoint, implements paragraph 10.1 of the spec
24230           - modified method Method.Define, the part at the end of the method
24231
24232         * rootcontext.cs: added static public Location EntryPointLocation;
24233           
24234         * ../errors/cs0028.cs : Add test case for the above warning.              
24235
24236         * typemanager.cs:
24237           - modified method CSharpName to allow arrays of primitive type to
24238             be printed nicely (e.g. instead of System.Int32[][] it now prints
24239             int[][])
24240           - added method CSharpSignature: returns the signature of a method
24241             in string format to be used in reporting errors, warnings, etc.
24242
24243         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24244         with String.Empty.
24245
24246 2002-04-26  Ravi Pratap  <ravi@ximian.com>
24247
24248         * delegate.cs (Define): Fix extremely silly bug where I was
24249         setting the type of the 'object' parameter of the BeginInvoke
24250         method to System.IAsyncResult instead of System.Object ;-)
24251
24252 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24253
24254         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24255         here. 
24256
24257         (Constructor.Emit): return if we fail to initialize the
24258         constructor.  Another door closed!  
24259
24260         * expression.cs (New.DoResolve): Improve error message (from -6 to
24261         1501).  Use DeclaredOnly lookup to find the exact constructor.
24262
24263         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24264         loop.  This is useful.
24265
24266         * cs-parser.jay: Adjust the default parameters so that destructors
24267         have the proper signature.
24268
24269 2002-04-26  Martin Baulig  <martin@gnome.org>
24270
24271         * driver.cs (LoadAssembly): If `assembly' contains any characters
24272         which are only valid in path names and not in assembly names
24273         (currently slash, backslash and point), use Assembly.LoadFrom ()
24274         instead of Assembly.Load () on the `assembly' (before iteration
24275         over the link_paths).
24276
24277 2002-04-26  Martin Baulig  <martin@gnome.org>
24278
24279         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24280
24281 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
24282
24283         * class.cs (Property): use the new typemanager.MemberLookup
24284
24285         (TypeContainer.MemberLookup): Implement using the
24286         TypeManager.MemberLookup now. 
24287
24288         * typemanager.cs: Make MemberLookup a function of the TypeManager,
24289         and return MemberInfos, so that these can be used without an
24290         EmitContext (what we had before).
24291
24292 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
24293
24294         * expression.cs: Fix the case where the argument to params if the
24295         type of the params.  I omitted handling this before.   Fixed
24296
24297 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24298
24299         * driver.cs: Call BootCorlib_PopulateCoreType
24300
24301         * class.cs (Property.CheckBase): Check for properties only, not
24302         for all members. 
24303
24304         * interface.cs: Temporary hack: try/catch around the
24305         CustomAttributeBuilder, because I am getting an exception that I
24306         do not understand.
24307
24308         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24309         types whose definitions are required to be there (attributes are
24310         defined before standard types).
24311
24312         Compute definitions as we boot the various types, as they are used
24313         immediately (value_type class will need object_type, but if we do
24314         not initialize object_type, we will pass a null, which will let
24315         the runtime pick the System.Object from the existing corlib, which
24316         is not what we want).
24317
24318 2002-04-22  Patrik Torstensson <totte@labs2.com>
24319
24320         * cs-tokenizer.cs: fixed a number of trim() issues.
24321
24322 2002-04-22  Ravi Pratap  <ravi@ximian.com>
24323
24324         * expression.cs (Argument.Type): Ensure that we return the correct
24325         type when we have out or ref parameters [in which case we 
24326         append a "&"].
24327
24328 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24329
24330         * class.cs (Property, Indexer): Allow extern modifier in there. 
24331
24332         * typemanager.cs (InitBaseTypes): Initializes object_type and
24333         value_type, since those will be used early on during the bootstrap
24334         process to compile corlib.
24335
24336         (InitCoreTypes): Move code from here to InitBaseTypes.
24337
24338 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
24339
24340         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24341         single-dimension arrays as using the ldlen opcode.  
24342
24343         Daniel Lewis discovered this optimization.  
24344
24345         * typemanager.cs: Add signature for System.Array::get_Length
24346
24347 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24348
24349         * statement.cs: report the error when the foreach does not apply to an
24350         array nor a collection.
24351
24352 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
24353
24354         * expression.cs: Add implicit conversions to the operator ~.
24355
24356         * constant.cs (DecimalConstant.Emit): Emit decimal value.
24357
24358         * typemanager.cs: Locate the decimal constructor.
24359
24360 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24361
24362         * attribute.cs: use the new property of TypeOf.
24363         * expression.cs: added 'get' property around typearg.
24364
24365         These changes fix a build breaker reported by NickD. Is this the
24366         correct way to fix?  If not, please, revert my changes and make it
24367         work :-).
24368
24369 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
24370
24371         * attribute.cs: Add support for typeof in attribute invocations.
24372         I am not sure that this is right though.
24373
24374 2002-04-14  Duncan Mak  <duncan@ximian.com>
24375
24376         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24377         Binary.Operator.Division case.
24378
24379 2002-04-13  Ravi Pratap  <ravi@ximian.com>
24380
24381         * class.cs (DefineType): Ensure that we do a proper check on
24382         attribute types and also register it with the TypeManager.
24383
24384         (TypeContainer.Targets): The default for attribute types is
24385         AttributeTargets.All.
24386
24387         * attribute.cs (ApplyAttributes): Registering the attribute type
24388         is done elsewhere, not when we discover we have a Usage attribute.
24389
24390 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24391
24392         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24393         and get rid of is_delegate parameter.
24394
24395         * everywhere : update.
24396
24397 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24398
24399         * cs-parser.jay (compilation_unit): Revamp completely to use
24400         some new ideas that I got from Rhys' grammar to solve the problems
24401         with assembly level attributes.
24402
24403         (outer_declaration): New grammar production.
24404
24405         (attribute_sections): Add.
24406
24407         (opt_attributes): Base on attribute_sections
24408
24409         (namespace_declaration): Allow opt_attributes to tackle the case
24410         when we have assembly level attributes - we are clever in this
24411         regard now ;-)
24412
24413         * attribute.cs (ApplyAttributes): Do not worry about assembly 
24414         attributes in the non-global context.
24415
24416         * rootcontext.cs (AddGlobalAttributes): Go back to using this
24417         instead of SetGlobalAttributes.
24418
24419         * class.cs, rootcontext.cs : Ensure we define and generate 
24420         attribute types before anything else.
24421
24422         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24423         and flag the new error -20 for the case when the attribute type
24424         does not have valid targets specified. csc does not catch this.
24425
24426         * ../errors/errors.txt : update for error # -20
24427
24428 2002-04-11  Ravi Pratap  <ravi@ximian.com>
24429
24430         * support.cs (InternalParameters.ParameterModifier): Do some null
24431         checking and return sane values.
24432
24433         * class.cs (Method.Define): If we are a PInvoke method, ensure
24434         that we are static and extern. Report error # 601
24435
24436         * ../errors/cs0601.cs : Add test case for the above error.
24437
24438 2002-04-07  Ravi Pratap  <ravi@ximian.com>
24439
24440         * rootcontext.cs (attribute_types): We need to keep type of
24441         all attribute types separately and emit code for them first.
24442
24443         (RegisterAttribute) : Implement.
24444
24445         * class.cs (DefineType): Check if the current Type is a custom
24446         attribute type and register it accordingly.
24447
24448         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24449         adding the first attribute twice and rename to
24450
24451         (SetGlobalAttributes): this.
24452
24453         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24454         lookups.
24455
24456         * attribute.cs (ApplyAttributes): Take an additional argument telling us
24457         if we are processing global arguments. Hmm, I am unsure of this.
24458
24459 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24460
24461         * expression.cs: added static array of strings to avoid calling
24462         Enum.ToString () for Operator in Binary. Significant recover of
24463         performance.
24464
24465 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
24466
24467         * class.cs (FindMembers): Allow the Builders of the various
24468         members to be null.  If they are skip them.  This only happens
24469         during the PInvoke declaration.
24470
24471 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
24472
24473         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24474         failure, so we do not keep going afterwards.
24475
24476         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24477         wanted to pass `false' as the `is_delegate' argument.  If this is
24478         the case, why not use delegate_type == null to mean `is_delegate =
24479         false' and anything else as is_delegate = true.
24480
24481 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
24482
24483         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24484         code for the section, not the beginning of the tests.
24485
24486 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
24487
24488         * cfold.cs: Handle operator + (Enum x, Underlying x) 
24489
24490         * expression.cs (Binary): same.  Warn about errors where we have
24491         Enum/Enum in operator + as well.
24492
24493 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
24494
24495         * statement.cs:
24496                 - added support for switch(bool)
24497                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
24498                 - add TableSwitchEmit() to handle table-based switch statements
24499
24500 2002-04-05  Ravi Pratap  <ravi@ximian.com>
24501
24502         * expression.cs (Invocation.OverloadResolve): Factor out code which
24503         does parameter compatibility checking with arguments so that we can 
24504         re-use the code even from Delegate.VerifyApplicability
24505
24506         (VerifyArgumentsCompat): Move above code here.
24507
24508         * delegate.cs (VerifyApplicability): Get rid of duplicate code
24509         and instead make a call to the above method.
24510
24511 2002-03-31  Ravi Pratap  <ravi@ximian.com>
24512
24513         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
24514         We use it to keep track of classes which are attribute types.
24515
24516 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
24517
24518         * delegate.cs (Delegate.Define): Correctly define the types in the
24519         presence of fixed and array parameters.
24520
24521         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
24522         doing FindMembers.
24523
24524         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
24525         include NonPublic after the first iteration.
24526
24527         * class.cs (Indexer.CheckBase): Only check if both parents are
24528         non-null. 
24529
24530         * cs-parser.jay (accessor_body): If empty, set to null.
24531
24532         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
24533         same code path here to resolve constants names that we did have in
24534         MemberAccess.DoResolve.  There is too much code duplicated here.
24535
24536 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
24537
24538         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
24539
24540         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
24541         to MakeUnionSet.
24542
24543         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
24544         tokens, numbers and strings.
24545
24546         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
24547         parenthesis.
24548
24549         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
24550         asyncronous parameters and the regular parameters.  
24551
24552         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
24553         specify the target directory.
24554
24555         * expression.cs: (This.DoResolve): Simplify
24556         (As.Emit): Optimize, do not generate IsInst if the expression is
24557         always of the given type.
24558
24559         (Is.DoResolve): Bug fix, we were reporting both always/never for
24560         the is expression.
24561
24562         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
24563         creating too many unnecessary arrays.
24564
24565 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
24566
24567         * class.cs (EmitFieldInitializer): Use Assign expression to assign
24568         fields instead of rolling our own initializer.   Takes care of all
24569         implicit conversions, and drops unnecessary static checks/argument.
24570
24571 2002-03-31  Dick Porter  <dick@ximian.com>
24572
24573         * driver.cs: use the GetDirectories() return values properly, and
24574         use "/" as path separator.
24575
24576 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
24577
24578         * expression.cs (Unary): Optimize - - expr into expr.
24579         (Binary): Optimize a + (-b) into a -b.
24580
24581         * codegen.cs (CodeGen): Made all methods static.
24582
24583 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
24584
24585         * rootcontext.cs: 
24586
24587         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
24588         TypeBuilder property.
24589
24590         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
24591         instead. 
24592
24593         * tree.cs: Removed the various RecordXXXX, and replaced with a
24594         single RecordDecl.  Removed all the accessor methods, and just
24595         left a single access point Type 
24596
24597         * enum.cs: Rename DefineEnum to DefineType.
24598
24599         * decl.cs: New abstract method `DefineType' used to unify the
24600         Defines for Enumerations, Interfaces, TypeContainers and
24601         Delegates.
24602
24603         (FindType): Moved LookupInterfaceOrClass here.  Moved the
24604         LookupBaseClasses method that used to live in class.cs and
24605         interface.cs here, and renamed to FindType.
24606
24607         * delegate.cs: Implement DefineType.  Take advantage of the
24608         refactored pattern for locating the parent builder without taking
24609         the parent_builder argument (which we know does not work if we are
24610         nested, and triggering a toplevel definition).
24611
24612 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24613
24614         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
24615         accessibility of a member has changed during override and report
24616         an error if so.
24617
24618         * class.cs (Method.Define, Property.Define): Only complain on
24619         overrides if the method is private, any other accessibility is
24620         fine (and since we just checked the permission is the same, we are
24621         good to go).
24622
24623         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
24624         and elif are processed always.  The other pre-processing
24625         directives are only processed if we are "taking" the path
24626
24627 2002-03-29  Martin Baulig  <martin@gnome.org>
24628
24629         * class.cs (Method.Emit): Only emit symbolic debugging info if the
24630         current location is not Null.
24631
24632         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
24633         a separate method so we can profile it.
24634
24635         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
24636         `span.Seconds' are just seconds, but no minutes or hours.
24637         (MainDriver): Profile the CodeGen.SaveSymbols calls.
24638
24639 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24640
24641         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
24642         Remove the gratuitous set of Final:
24643
24644                                 // If an interface implementation, then we can set Final.
24645                                 if (((flags & MethodAttributes.Abstract) == 0) &&
24646                                     implementing.DeclaringType.IsInterface)
24647                                         flags |= MethodAttributes.Final;
24648
24649         I do not know what I was smoking when I used that.
24650
24651
24652         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
24653         step into fixing the name resolution issues for delegates and
24654         unifying the toplevel name resolution.
24655
24656 2002-03-28  Martin Baulig  <martin@gnome.org>
24657
24658         * class.cs (Method.Emit): If we have a symbol writer, call its
24659         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
24660         tell it about the current method.
24661
24662         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
24663         writer that we're going to emit the first byte of IL code for a new
24664         statement (a new source line).
24665         (EmitContext.EmitTopBlock): If we have a symbol writer, call
24666         EmitContext.Mark() before emitting any code.
24667
24668         * location.cs (SymbolDocument): Return null when we're Null.
24669
24670         * statement.cs (Statement): Moved the `Location loc' variable here.
24671         (Statement.EmitBoolExpression): If we have a symbol writer, call
24672         ec.Mark() before emitting any code to tell it that we're at the
24673         beginning of a new statement.
24674         (StatementExpression): Added `Location' argument to the constructor.
24675         (Block): Added public readonly variable `StartLocation' and public
24676         variable `EndLocation'.  The latter is to be set using SetEndLocation().
24677         (Block): Added constructor which takes a start and end location.
24678         (Block.SetEndLocation): New method. This sets the end location.
24679         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
24680         local variables we create.
24681         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
24682         each statement and do also mark the begin and end of the block.
24683
24684         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
24685         tell it the current lexer.Location, use Location.Null for the end of the
24686         block.
24687         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
24688         current block, set its end location using SetEndLocation().
24689         (statement_expression): StatementExpression constructor now takes the
24690         lexer.Location as additional argument.
24691         (for_statement, declare_local_variables): Likewise.
24692         (declare_local_variables): When creating a new implicit block, use the
24693         new Block constructor and pass it the lexer.Location.
24694
24695 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24696
24697         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
24698         members also on the parent interfaces recursively.
24699
24700 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
24701
24702         * report.cs: Use new formats, since Gonzalo finished the missing
24703         bits. 
24704
24705         * expression.cs (Binary.ResolveOperator): added missing operator|
24706         operator& and operator^ for bool/bool.
24707
24708         * cs-parser.jay: CheckDef now takes a Location argument that is
24709         used to report errors more precisly (instead of reporting the end
24710         of a definition, we try to track something which is a lot closer
24711         to the source of the problem).
24712
24713         * cs-tokenizer.cs: Track global token use, so we can properly flag
24714         the use of #define/#undef after the first token has been seen.
24715
24716         Also, rename the reportXXXX to Error_DescriptiveName
24717
24718         * decl.cs (DeclSpace.IsTopLevel): Move property here from
24719         TypeContainer, so that Enum and Interface can use this too.
24720
24721         * class.cs (TypeContainer.LookupInterfaceOrClass,
24722         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
24723         `builder' argument.  Typically this was used to pass the parent
24724         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
24725         the definition).  
24726
24727         The problem is that a nested class could trigger the definition of
24728         a toplevel class, and the builder would be obviously wrong in that
24729         case. 
24730
24731         So we drop this argument, and we compute dynamically the
24732         TypeBuilder/ModuleBuilder (the correct information was available
24733         to us anyways from DeclSpace.Parent)
24734
24735         * interface.cs (Interface.DefineInterface): Drop builder
24736         parameter cleanup like class.cs
24737
24738         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
24739         like class.cs
24740
24741         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
24742         values. 
24743
24744         (Try.Emit): Propagate the returns value from the statement.
24745
24746         (Return.Emit): Even if we are leavning 
24747
24748         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
24749
24750         * modifiers.cs: Fix the computation of MethodAttributes flags.
24751
24752 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
24753
24754         * driver.cs: allow compilation of files that start with '/'.
24755         Add a default case when checking the argument of --target.
24756
24757 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
24758
24759         * interface.cs: Implement the same search algorithm for types in
24760         the interface code.
24761
24762         * delegate.cs: Do not allow multiple definition.
24763
24764         * Recovered ChangeLog that got accidentally amputated
24765
24766         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
24767
24768         * rootcontext.cs: Load manually enum to allow core classes to
24769         contain enumerations.
24770
24771         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
24772         Update to new static methods in TypeManager.
24773
24774         * typemanager.cs (GetMethod, GetConstructor): Use our
24775         implementation of FindMembers to find the members, since during
24776         corlib compilation, the types are TypeBuilders and GetMethod and
24777         GetConstructor do not work.
24778
24779         Make all methods in TypeManager static.
24780
24781         (InitCodeHelpers): Split the functionality from
24782         the InitCodeTypes function.
24783
24784         * driver.cs: Call InitCodeHelpers after we have populated the
24785         types. 
24786
24787         * cs-parser.jay (delegate_declaration): we did not used to compute
24788         the delegate name correctly for void delegates.
24789
24790 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
24791
24792         * rootcontext.cs (RootContext): Init the interface_resolve_order
24793         and type_container_resolve_order always.
24794
24795         (ResolveCore, BootstrapCorlib_ResolveClass,
24796         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
24797         compiler when compiling with --nostdlib
24798
24799         * class.cs (TypeContainer.DefineType): Check that our parent is
24800         not null.  This test is most important when we are bootstraping
24801         the core types.
24802
24803         * codegen.cs: Split out the symbol writing code.
24804
24805 2002-03-25  Martin Baulig  <martin@gnome.org>
24806
24807         * driver.cs (-g): Made -g an alias for --debug.
24808
24809 2002-03-24  Martin Baulig  <martin@gnome.org>
24810
24811         * codegen.cs (SymbolWriter): New public variable. Returns the
24812         current symbol writer.
24813         (CodeGen): Added `bool want_debugging_support' argument to the
24814          constructor. If true, tell the ModuleBuild that we want debugging
24815         support and ask it for the ISymbolWriter.
24816         (Save): If we have a symbol writer, call it's Close() method after
24817         saving the assembly.
24818
24819         * driver.c (--debug): New command line argument to create a
24820         debugger information file.
24821
24822         * location.cs (SymbolDocument): New public property. Returns an
24823         ISymbolDocumentWriter object for the current source file or null
24824         if we don't have a symbol writer.
24825
24826 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
24827
24828         * driver.cs (LoadAssembly): Correctly return when all the paths
24829         have been tried and not before.
24830
24831         * statement.cs (Switch.Emit): return the actual coverage for this
24832         statement (returns/not-returns)
24833
24834         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
24835         switch of the statement if we are the last switch section.  That
24836         kills two problems: try/catch problems (we used to emit an empty
24837         nop at the end) and switch statements where all branches would
24838         return. 
24839
24840 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
24841
24842         * driver.cs: Add default assemblies (the equivalent to the
24843         Microsoft CSC.RSP file)
24844
24845         * cs-tokenizer.cs: When updating `cols and setting it to zero,
24846         also update tokens_seen and set it to false.
24847
24848         * driver.cs: Implement --recurse for Mike.
24849
24850         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
24851         correctly splitting out the paths.
24852
24853 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
24854
24855         * interface.cs (Interface.PopulateProperty): Instead of using
24856         `parent' as the declaration space for the set parameters, use
24857         `this' 
24858
24859         * support.cs (InternalParameters): InternalParameters constructor
24860         takes a DeclSpace instead of a TypeContainer.
24861
24862         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
24863         types are being initialized, load the address of it before calling
24864         the function.  
24865
24866         (New): Provide a mechanism to disable the generation of local
24867         value type temporaries when the caller will be providing us with
24868         an address to store it.
24869
24870         (ArrayCreation.EmitDynamicInitializers): Use it.
24871
24872 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
24873
24874         * expression.cs (Invocation.EmitArguments): Only probe for array
24875         property if there is more than one argument.  Sorry about that.
24876
24877         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
24878         empty param arrays.
24879
24880         * class.cs (Method.LabelParameters): Fix incorrect code path that
24881         prevented the `ParamArrayAttribute' from being applied to the
24882         params attribute.
24883
24884 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
24885
24886         * support.cs (ReflectionParameters): Correctly compute whether the
24887         last argument is a params array.  Fixes the problem with
24888         string.Split ('a')
24889
24890         * typemanager.cs: Make the assemblies array always be non-null
24891         (empty, but non-null)
24892
24893         * tree.cs (RecordDecl): New function that abstracts the recording
24894         of names.  This reports error 101, and provides a pointer to the
24895         previous declaration.  Fixes a crash in the compiler.
24896
24897         * cs-parser.jay (constructor_declaration): Update to new grammar,
24898         and provide a constructor_body that can be empty.
24899
24900 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
24901
24902         * driver.cs: Add support for --resources.
24903
24904         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
24905         Make all types for the various array helper methods be integer.
24906
24907         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
24908         CheckState to ConvCast.
24909
24910         (ConvCast): Now it takes a `checked' state argument, to avoid
24911         depending on the emit context for the conversion, and just using
24912         the resolve time setting.
24913
24914         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
24915         instead of Invocation.EmitArguments.  We do not emit the original
24916         arguments, instead we emit those which have been converted to
24917         unsigned int expressions.
24918
24919         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
24920
24921         * codegen.cs: ditto.
24922
24923         * expression.cs (LocalVariableReference): Drop the use of the
24924         Store function that depended on the variable index.
24925
24926         * statement.cs (VariableInfo): Drop the `Idx' property from this
24927         class, as this is not taking into account the indexes for
24928         temporaries tat we generate during the execution, getting the
24929         indexes wrong.
24930
24931         * class.cs: First emit class initializers, then call the parent
24932         constructor. 
24933
24934         * expression.cs (Binary): Fix opcode emision.
24935         (UnaryMutator.EmitCode): Support checked code generation
24936
24937         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24938         matches for events for both the Static and Instance scans,
24939         pointing to the same element.   Fix that.
24940
24941 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
24942
24943         * rootcontext.cs (ResolveTree): Always set the
24944         interface_resolve_order, because nested interfaces will be calling
24945         into us.
24946
24947         * class.cs (GetInterfaceOrClass): Track the same resolution
24948         process used by TypeManager.LookupType.  This fixes the nested
24949         type lookups in class declarations (separate path from
24950         LookupType). 
24951
24952         (TypeContainer.DefineType): Also define nested interfaces.
24953         (TypeContainer.RegisterOrder): New public function used to
24954         register the order in which child interfaces need to be closed.
24955
24956         Nested interfaces need to be closed after their parents have been
24957         created. 
24958
24959         * interface.cs (InterfaceAttr): Put all the logic for computing
24960         the interface attribute here. 
24961
24962         (DefineInterface): Register our interface order with the
24963         RootContext or with the TypeContainer depending on the case.
24964
24965 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24966
24967         * cs-parser.jay: rework foreach statement to work with the new
24968         changes to the policy on SimpleNames.
24969
24970         * report.cs: support Stacktrace on warnings as well.
24971
24972         * makefile: drop --unsafe and /unsafe from the compile.
24973
24974 2002-03-13  Ravi Pratap  <ravi@ximian.com>
24975
24976         * ecore.cs (StandardConversionExists): Modify to take an Expression
24977         as the first parameter. Ensure we do null -> reference type conversion
24978         checking.
24979
24980         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24981         temporary Expression objects.
24982
24983 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24984
24985         * interface.cs: workaround bug in method overloading resolution
24986         (there is already a bugzilla bug for it).
24987
24988 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24989
24990         We could also solve this problem by having a separate path for
24991         performing type lookups, instead of DoResolve, we could have a
24992         ResolveType entry point, and only participating pieces of the
24993         production (simplename, deref, array) would implement this. 
24994
24995         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24996         signal SimpleName to only resolve type names and not attempt to
24997         resolve anything else.
24998
24999         * expression.cs (Cast): Set the flag.
25000
25001         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25002
25003         * class.cs: Only report 108 if there is no `new' modifier.
25004
25005         * cs-parser.jay: rework foreach statement to work with the new
25006         changes to the policy on SimpleNames.
25007
25008         * report.cs: support Stacktrace on warnings as well.
25009
25010         * makefile: drop --unsafe and /unsafe from the compile.
25011
25012 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25013
25014         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25015         lookups here, instead of doing that at parse time.  This means
25016         that our grammar will not introduce `LocalVariableReferences' as
25017         expressions at this point.  That solves the problem of code like
25018         this:
25019
25020         class X {
25021            static void Main ()
25022            { int X = 1;
25023             { X x = null }}}
25024
25025         This is only half the fix.  The full fix requires parameters to
25026         also be handled in this way.
25027
25028         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25029         makes the use more obvious of the DeclSpace.  The
25030         ec.TypeContainer.TypeBuilder is now only used to pull the
25031         TypeBuilder for it.
25032
25033         My theory is that I can get rid of the TypeBuilder completely from
25034         the EmitContext, and have typecasts where it is used (from
25035         DeclSpace to where it matters).  
25036
25037         The only pending problem is that the code that implements Aliases
25038         is on TypeContainer, and probably should go in DeclSpace.
25039
25040         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25041         lookups here, instead of doing that at parse time.  This means
25042         that our grammar will not introduce `LocalVariableReferences' as
25043         expressions at this point.  That solves the problem of code like
25044         this:
25045
25046         class X {
25047            static void Main ()
25048            { int X = 1;
25049             { X x = null }}}
25050
25051         This is only half the fix.  The full fix requires parameters to
25052         also be handled in this way.
25053
25054         * class.cs (Property.DefineMethod): When implementing an interface
25055         method, set newslot, when implementing an abstract method, do not
25056         set the flag (before we tried never setting it, or always setting
25057         it, which is the difference).
25058         (Indexer.DefineMethod): same.
25059         (Method.DefineMethod): same.
25060
25061         * ecore.cs: Only set the status used flag if we get back a Field.
25062
25063         * attribute.cs: Temporary hack, so Paolo can keep working.
25064
25065 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25066
25067         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25068         the unmanaged type in the case we have a MarshalAs attribute.
25069
25070         (Resolve): Handle the case when we are parsing the special MarshalAs
25071         attribute [we need to store the unmanaged type to use later]
25072
25073         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25074         MarshalAs Attribute.
25075
25076         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25077         on parameters and accordingly set the marshalling info.
25078
25079 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25080
25081         * class.cs: Optimizing slightly by removing redundant code after
25082         we switched to the `NoTypes' return value.
25083         (Property.DefineMethod): use NoTypes here too.
25084
25085         This fixes the bug I introduced in my last batch of changes.
25086
25087 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25088
25089         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25090
25091         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25092         Enums since those are types too. 
25093
25094         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25095
25096         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25097         thanks to a call during the lookup process.
25098
25099 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25100
25101         * statement.cs (Foreach): Lots of work to accomodate a particular
25102         kind of foreach statement that I had not kept in mind.  It is
25103         possible to have foreachs on classes that provide a GetEnumerator
25104         method that return objects that implement the "pattern" for using
25105         a foreach, there is no need to support GetEnumerator
25106         specifically. 
25107
25108         This is needed to compile nant.
25109
25110         * decl.cs: Only report 114 if the member is not `Finalize' and if
25111         the warning level is at least 2.
25112
25113         * class.cs: Moved the compare function from Method to
25114         MethodSignature. 
25115
25116         (MethodSignature.InheritableMemberSignatureCompare): Add new
25117         filter function that is used to extract inheritable methods from a
25118         class. 
25119
25120         (Method.Define): Use the new `inheritable_method_signature_filter'
25121         delegate
25122
25123         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25124         command. 
25125
25126 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25127
25128         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25129
25130         * cs-parser.jay: Add opt_semicolon to the interface declaration.
25131
25132         * expression.cs: Pass location information to
25133         ConvertImplicitStandard. 
25134
25135         * class.cs: Added debugging code to track return values from
25136         interfaces. 
25137
25138 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
25139
25140         * expression.cs (Is.DoResolve): If either side of the `is' is an
25141         interface, do not flag the warning.
25142
25143         * ecore.cs (ImplicitReferenceConversion): We need a separate test
25144         for interfaces
25145
25146         * report.cs: Allow for --fatal to be used with --probe.
25147
25148         * typemanager.cs (NoTypes): Move the definition for the empty Type
25149         array here. 
25150
25151         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25152         properties. 
25153         (TypeContainer.DefineProxy): New function used to proxy to parent
25154         implementations when implementing interfaces.
25155         (TypeContainer.ParentImplements): used to lookup if our parent
25156         implements a public function that is required by an interface.
25157         (TypeContainer.VerifyPendingMethods): Hook this up.
25158
25159         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25160         `modules' and `assemblies' arraylists into arrays.  We only grow
25161         these are the very early start up of the program, so this improves
25162         the speedof LookupType (nicely measured).
25163
25164         * expression.cs (MakeByteBlob): Replaced unsafe code with
25165         BitConverter, as suggested by Paolo.
25166
25167         * cfold.cs (ConstantFold.Binary): Special case: perform constant
25168         folding of string concatenation, but if either side is a string,
25169         and the other is not, then return null, and let the runtime use
25170         the concatenation on the string plus the object (using
25171         `Object.ToString'). 
25172
25173 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
25174
25175         Constant Folding has been implemented now.
25176
25177         * expression.cs (Unary.Reduce): Do not throw an exception, catch
25178         the error instead on types that are not supported in one's
25179         complement. 
25180
25181         * constant.cs (Constant and all children): New set of functions to
25182         perform implict and explicit conversions.
25183
25184         * ecore.cs (EnumConstant): Implement the new functions to perform
25185         conversion by proxying to the child expression.
25186
25187         * codegen.cs: (ConstantCheckState): Constant evaluation has its
25188         own separate setting that can not be turned off from the command
25189         line using --unchecked or --checked and is only controlled using
25190         the checked/unchecked statements and expressions.  This setting is
25191         used by the constant folder to flag errors.
25192
25193         * expression.cs (CheckedExpr, UncheckedExpr): Set the
25194         ConstantCheckState as well.   
25195
25196         During Resolve, they also have to flag the state, because the
25197         constant folder runs completely in the Resolve phase.
25198
25199         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25200         well.
25201
25202 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25203
25204         * cfold.cs: New file, this file contains the constant folder.
25205
25206         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25207         argument to track whether we are using the resulting address to
25208         load or store a value and provide better error messages. 
25209
25210         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25211         new AddressOf arguments.
25212
25213         * statement.cs (Foreach.EmitCollectionForeach): Update
25214
25215         * expression.cs (Argument.Emit): Call AddressOf with proper
25216         arguments to track usage.
25217
25218         (New.DoEmit): Call AddressOf with new arguments.
25219
25220         (Unary.Emit): Adjust AddressOf call.
25221
25222 2002-03-01  Ravi Pratap  <ravi@ximian.com>
25223
25224         * cs-parser.jay (member_access): Change the case for pre-defined types
25225         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
25226         this suggestion.
25227
25228         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25229         a method body.
25230
25231         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25232         essentially like methods and apply attributes like MethodImplOptions to them too.
25233
25234         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25235         not being null.
25236
25237         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25238         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25239         is the DeclSpace.
25240
25241         * Update code everywhere accordingly.
25242
25243         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25244
25245         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25246
25247 2002-02-28  Ravi Pratap  <ravi@ximian.com>
25248
25249         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25250         try performing lookups against those instead of jumping straight into using
25251         the 'using' clauses.
25252
25253         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25254
25255         (LookupType): Perform lookups in implicit parents too.
25256
25257         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25258         sequence as RootContext.LookupType. 
25259
25260         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
25261         the various cases of namespace lookups into this method.
25262
25263 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25264
25265         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25266         in positional arguments)
25267
25268         * class.cs (Operator): Update the AllowedModifiers to contain
25269         extern. 
25270
25271         * cs-parser.jay: Update operator declaration to allow for the
25272         operator body to be empty.
25273
25274         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25275         values. 
25276
25277 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
25278
25279         * class.cs (Method.Emit): Label parameters.
25280
25281         * driver.cs: Return 1 or 0 as the program exit code.
25282
25283 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
25284
25285         * expression.cs: Special case the `null' object when trying to
25286         auto-compute the type, as anything can be explicitly converted to
25287         that. 
25288
25289         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25290         spotting this Paolo.
25291
25292         (Expression.ImplicitNumericConversion): Perform comparissions of
25293         the type using the underlying type in the case of an enumeration
25294         rather than using the enumeration type for the compare.
25295
25296         Cope with the underlying == type case, which is not possible to
25297         catch before. 
25298
25299         (Expression.ConvertNumericExplicit): Perform comparissions of
25300         the type using the underlying type in the case of an enumeration
25301         rather than using the enumeration type for the compare.
25302
25303         * driver.cs: If the user does not supply an extension, assume .exe
25304
25305         * cs-parser.jay (if_statement): Rewrote so that we can track the
25306         location for the if statement.
25307
25308         * expression.cs (Binary.ConstantFold): Only concat strings when
25309         the operation is "+", not everything ;-)
25310
25311         * statement.cs (Statement.EmitBoolExpression): Take a location
25312         argument. 
25313         (If, While, Do): Track location.
25314
25315         * expression.cs (Binary.ResolveOperator): In the object + string
25316         case, I was missing a call to ConvertImplicit
25317
25318 2002-02-25  Ravi Pratap  <ravi@ximian.com>
25319
25320         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25321         Location arguments. Ensure we use RootContext.LookupType to do our work
25322         and not try to do a direct Type.GetType and ModuleBuilder.GetType
25323
25324         * interface.cs (PopulateMethod): Handle the type of the parameter being
25325         null gracefully.
25326
25327         * expression.cs (Invocation.BetterFunction): Handle the case when we 
25328         have a params method with no fixed arguments and a call is made with no
25329         arguments.
25330
25331 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
25332
25333         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25334         the verbatim-string-literal
25335
25336         * support.cs (InternalParameters.ParameterModifier): handle null
25337         fixed parameters.
25338         (InternalParameters.ParameterType): ditto.
25339
25340         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25341         duplicating the name of the variable parameter.
25342         (GetParameterByName): Fix bug where we were not looking up array
25343         paramters if they were the only present (thanks Paolo!).
25344         (GetParameterInfo): We only have an empty set of types if both
25345         fixed and array are set to null.
25346         (GetParameterInfo-idx): Handle FixedParameter == null
25347
25348         * cs-parser.jay: Handle the case where there is no catch
25349         statements (missing null test).
25350
25351 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
25352
25353         * driver.cs (MainDriver): Be conservative on our command line
25354         handling.
25355
25356         Catch DirectoryNotFoundException when calling GetFiles.
25357
25358         (SplitPathAndPattern): Used to split the input specification into
25359         a path and a pattern that we can feed to Directory.GetFiles.
25360
25361 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
25362
25363         * statement.cs (Fixed): Implement the last case of the Fixed
25364         statement (string handling).
25365
25366         * expression.cs (StringPtr): New class used to return a char * to
25367         a string;  Used by the Fixed statement.
25368
25369         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
25370
25371         * expression.cs (Binary.ResolveOperator): Remove redundant
25372         MemberLookup pn parent type.
25373         Optimize union call, we do not need a union if the types are the same.
25374         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25375         type.
25376
25377         Specialize the use of MemberLookup everywhere, instead of using
25378         the default settings. 
25379
25380         (StackAlloc): Implement stackalloc keyword.
25381
25382         * cs-parser.jay: Add rule to parse stackalloc.
25383
25384         * driver.cs: Handle /h, /help, /?
25385
25386         * expression.cs (MakeByteBlob): Removed the hacks we had in place
25387         before we supported unsafe code.
25388
25389         * makefile: add --unsafe to the self compilation of mcs.
25390
25391 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
25392
25393         * expression.cs (PointerArithmetic): New class that is used to
25394         perform pointer arithmetic.
25395         (Binary.Resolve): Handle pointer arithmetic
25396         Handle pointer comparission.
25397         (ArrayPtr): Utility expression class that is used to take the
25398         address of an array.
25399
25400         (ElementAccess): Implement array access for pointers
25401
25402         * statement.cs (Fixed): Implement fixed statement for arrays, we
25403         are missing one more case before we are done.
25404
25405         * expression.cs (Indirection): Implement EmitAssign and set the
25406         ExprClass to Variable.  This allows pointer dereferences to be
25407         treated as variables, and to have values assigned to them.
25408
25409         * ecore.cs (Expression.StoreFromPtr): New utility function to
25410         store values dereferencing.
25411
25412 2002-02-20  Ravi Pratap  <ravi@ximian.com>
25413
25414         * expression.cs (Binary.ResolveOperator): Ensure that we are
25415         not trying to operate on a void type - this fixes the reported
25416         bug.
25417
25418         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25419         the parent implementation is sealed.
25420
25421         * ../errors/cs0239.cs : Add.
25422
25423         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25424
25425         * typemanager.cs (unverifiable_code_type): Corresponds to 
25426         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25427         which have unsafe code in them.
25428
25429         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
25430         unsafe context.
25431
25432 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
25433
25434         * cs-tokenizer.cs: Add support for @"litreal strings"
25435
25436         Make tokenizer accept pre-processor directives
25437         on any column (remove the old C-like limitation). 
25438
25439         * rootcontext.cs (EmitCode): Emit any global attributes.
25440         (AddGlobalAttributes): Used to keep track of assembly attributes. 
25441
25442         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25443
25444         * cs-parser.jay: Add support for global attributes.  
25445
25446 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
25447
25448         * expression.cs (Indirection): New helper class.  Unary will
25449         create Indirection classes to be able to implement the
25450         IMemoryLocation interface on it.
25451
25452 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
25453
25454         * cs-parser.jay (fixed_statement): reference the right statement.
25455
25456         * statement.cs (Fixed.Emit): Finish implementing the fixed
25457         statement for the &x case.
25458
25459 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
25460
25461         * class.cs (Property.Define, Method.Define): Remove newslot when
25462         `implementing'.  
25463
25464         * modifiers.cs: My use of NewSlot when `Abstract' was set was
25465         wrong.  NewSlot should only be used if the `new' keyword is present.
25466
25467         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25468         locating our system dir.  Sorry about this.
25469
25470 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25471
25472         * driver.cs (GetSystemDir): Compute correctly the location of our
25473         system assemblies.  I was using the compiler directory instead of
25474         the library directory.
25475
25476 2002-02-13  Ravi Pratap  <ravi@ximian.com>
25477
25478         * expression.cs (BetterFunction): Put back in what Miguel commented out
25479         since it is the correct fix. The problem is elsewhere ;-)
25480
25481         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25482         parameters of the parms method are themselves compatible or not !
25483
25484         (StandardConversionExists): Fix very dangerous bug where we were forgetting
25485         to check that a class implements an interface before saying that an implicit
25486         conversion was allowed. Use ImplementsInterface to do the checking.
25487
25488 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25489
25490         * class.cs (Method.Define): Track whether we are an explicit
25491         implementation or not.  And only call DefineMethodOverride if we
25492         are an explicit implementation.
25493
25494         (Property.DefineMethod): Ditto.
25495
25496 2002-02-11  Ravi Pratap  <ravi@ximian.com>
25497
25498         * expression.cs (BetterFunction): Catch hideous bug which was
25499          preventing us from detecting ambiguous calls due to implicit casts i.e
25500         cs0121.
25501
25502 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
25503
25504         * support.cs (Pair): Remove un-needed method.  I figured why I was
25505         getting the error in cs-parser.jay, the variable in a foreach loop
25506         is readonly, and the compiler does not really treat this as a variable.
25507
25508         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
25509         instead of EQUALS in grammar.  
25510
25511         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
25512
25513         * expression.cs (Unary.DoResolve): Check whether the argument is
25514         managed or not.
25515
25516 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
25517
25518         * support.cs: Api for Pair to set a value.  Despite the fact that
25519         the variables are public the MS C# compiler refuses to compile
25520         code that accesses the field if the variable is part of a foreach
25521         statement. 
25522
25523         * statement.cs (Fixed): Begin implementation of the fixed
25524         statement.
25525
25526         (Block.AddVariable): Return the VariableInfo on success and null
25527         on failure instead of true/false. 
25528
25529         * cs-parser.jay (foreach): Catch errors on variables already
25530         defined (we were ignoring this value before) and properly unwind
25531         the block hierarchy
25532
25533         (fixed_statement): grammar for the fixed statement.
25534
25535 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
25536
25537         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
25538         pointer types to be incretemented.
25539
25540         (SizeOf): Implement.
25541
25542         * cs-parser.jay (pointer_member_access): Implement
25543         expr->IDENTIFIER production.
25544
25545         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
25546         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
25547         on safe contexts.
25548
25549         (Unary): Implement indirection.
25550
25551         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
25552         use in non-unsafe context).
25553
25554         (SimpleName.DoResolve): Check for pointers in field access on safe
25555         contexts. 
25556
25557         (Expression.LoadFromPtr): Factor the load-indirect code in this
25558         function.  This was duplicated in UnboxCast and ParameterReference
25559
25560 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
25561
25562         * expression.cs (ComposedCast): report an error if a pointer cast
25563         is used in a safe region.
25564
25565         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
25566         pointer type casts in unsafe context.
25567
25568         * codegen.cs (EmitContext): Set up IsUnsafe.
25569
25570         * cs-parser.jay (non_expression_type): Add productions for pointer
25571         casts. 
25572
25573         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
25574         code.  We should not use force into static mode if the method is
25575         not virtual.  Fixes bug in MIS
25576
25577         * statement.cs (Do.Emit, While.Emit, For.Emit,
25578         Statement.EmitBoolExpression): Add support to Do and While to
25579         propagate infinite loop as `I do return' semantics.
25580
25581         Improve the For case to also test for boolean constants.
25582
25583         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
25584         to the list of attributes we can add.
25585
25586         Remove `EmitContext' argument.
25587
25588         * class.cs (Method.Define): Apply parameter attributes.
25589         (Constructor.Define): Apply parameter attributes.
25590         (MethodCore.LabelParameters): Move here the core of labeling
25591         parameters. 
25592
25593         * support.cs (ReflectionParameters.ParameterModifier,
25594         InternalParameters.ParameterModifier): Use IsByRef on the type and
25595         only return the OUT bit for these parameters instead of in/out/ref
25596         flags.
25597
25598         This is because I miss-understood things.  The ParameterInfo.IsIn
25599         and IsOut represent whether the parameter has the [In] and [Out]
25600         attributes set.  
25601
25602 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
25603
25604         * ecore.cs (FieldExpr.Emit): Release temporaries.
25605
25606         * assign.cs (LocalTemporary.Release): new function.
25607
25608         * codegen.cs (EmitContext.GetTemporaryStorage,
25609         EmitContext.FreeTemporaryStorage): Rework the way we deal with
25610         temporary storage.  Now we can "put back" localbuilders when we
25611         are done with them
25612
25613 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
25614
25615         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
25616         need to make a copy of the variable to generate verifiable code.
25617
25618 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
25619
25620         * driver.cs: Compute dynamically the system directory.
25621
25622         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
25623         Slower, but more generally useful.  Used by the abstract
25624         registering implementation. 
25625
25626         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
25627         the rules for the special rule on Type/instances.  First check if
25628         we have the same name, and if so, try that special static path
25629         rather than the instance path.
25630
25631 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
25632
25633         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
25634         for, while and if.
25635
25636         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
25637         Enum, ValueType, Delegate or Array for non-corlib compiles.
25638
25639         * cs-tokenizer.cs: Catch long identifiers (645)
25640
25641         * typemanager.cs (IndexerPropetyName): Ravi never tested this
25642         piece of code.
25643
25644         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
25645         fix, we were returning too early, so we were not registering
25646         pending methods from abstract classes.
25647
25648         Do not register pending methods if the class is abstract.
25649
25650         * expression.cs (Conditional.DoResolve): Report circular implicit
25651         conversions when we neecd to compute it for conditional
25652         expressions. 
25653
25654         (Is.DoResolve): If the expression is always of the provided type,
25655         flag warning 183.  If the expression can not ever be of the
25656         provided type flag warning 184.
25657
25658         * class.cs: Catch 169 as well.
25659
25660         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
25661         read. 
25662
25663 2002-01-18  Nick Drochak  <ndrochak@gol.com>
25664
25665         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
25666
25667 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
25668
25669         * interface.cs: (PopulateMethod): Check for pointers being defined
25670         only if the unsafe context is active.
25671         (PopulateProperty): ditto.
25672         (PopulateIndexer): ditto.
25673
25674         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
25675         specified.  If pointers are present, make sure that they are
25676         present in an unsafe context.
25677         (Constructor, Constructor.Define): ditto.
25678         (Field, Field.Define): ditto.
25679         (Property, Property.Define): ditto.
25680         (Event, Event.Define): ditto.
25681
25682         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
25683         hashtable if there are classes or structs defined.
25684
25685         * expression.cs (LocalVariableReference.DoResolve): Simplify this
25686         code, as the constant resolution moved.
25687
25688         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
25689         the metadata, so we can flag error 133. 
25690
25691         * decl.cs (MemberCore.UnsafeOK): New function to test that a
25692         pointer is being declared in an unsafe context.
25693
25694 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
25695
25696         * modifiers.cs (Modifiers.Check): Require a Location argument.
25697         Report error 227 for Unsafe use.
25698
25699         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
25700
25701         * statement.cs (For.Emit): If the test is null, then report that
25702         we do `return', as we wont reach anything afterwards.
25703
25704         (Switch.SwitchGoverningType): Track the expression that matched
25705         the conversion.
25706
25707         * driver.cs: Allow negative numbers as an error code to flag.
25708
25709         * cs-parser.jay: Handle 1551.
25710
25711         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
25712
25713 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
25714
25715         * cs-parser.jay: Report 1518 (type declaration can only contain
25716         class, struct, interface, enum or delegate)
25717
25718         (switch_label): Report 1523 (keywords `case' or `default' must
25719         preced code)
25720
25721         (opt_switch_sections): Report 1522 (empty switch)
25722
25723         * driver.cs: Report 1515 (response file specified multiple times)
25724         Report 1516 (Source file specified multiple times).
25725
25726         * expression.cs (Argument.Resolve): Signal 1510
25727
25728         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
25729         access not allowed in static code)
25730
25731 2002-01-11  Ravi Pratap  <ravi@ximian.com>
25732
25733         * typemanager.cs (IsPointerType): Utility method which we are going
25734         to need a lot.
25735
25736         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
25737         the object type, so we take care of that.
25738
25739         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
25740
25741         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
25742         added to non-params parameters :-)
25743
25744         * typemanager.cs (CSharpName): Include 'void' type too. 
25745
25746         (void_ptr_type): Include in the set of core types.
25747
25748         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
25749         duplicating code.
25750
25751         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
25752         an unsafe context.
25753
25754         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
25755         completely forgotten about it.
25756
25757 2002-01-10  Ravi Pratap  <ravi@ximian.com>
25758
25759         * cs-parser.jay (pointer_type): Add. This begins our implementation
25760         of parsing rules for unsafe code.
25761
25762         (unsafe_statement): Implement.
25763
25764         (embedded_statement): Modify to include the above.
25765
25766         * statement.cs (Unsafe): Implement new class for unsafe blocks.
25767
25768         * codegen.cs (EmitContext.InUnsafe): Add. This determines
25769         if the current context is an unsafe one.
25770
25771         * cs-parser.jay (local_variable_pointer_type): Since local variable types
25772         are handled differently, we need separate rules for them.
25773
25774         (local_variable_declaration): Update to use local_variable_pointer_type
25775         to allow variable declarations of unmanaged pointer types.
25776
25777         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
25778         in unsafe contexts.
25779
25780         * ../errors/cs0214.cs : Add.
25781
25782 2002-01-16  Nick Drochak  <ndrochak@gol.com>
25783
25784         * makefile: remove 'response' file when cleaning.
25785
25786 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
25787
25788         * cs-parser.jay: Report 1524.
25789
25790 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
25791
25792         * typemanager.cs (RegisterMethod): drop checking if we have
25793         registered this from here
25794
25795 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
25796
25797         * class.cs (Method.EmitDestructor): Implement calling our base
25798         destructor. 
25799
25800         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
25801         value of InFinally.
25802
25803         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
25804         this routine and will wrap the call in a try/catch block.  Deal
25805         with the case.
25806
25807 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
25808
25809         * ecore.cs (Expression.MemberLookup): instead of taking a
25810         parameter `same_type' that was used to tell whether we could
25811         access private members we compute our containing type from the
25812         EmitContext.
25813
25814         (FieldExpr): Added partial support for volatile fields.  This does
25815         not work for volatile fields exposed from assemblies, as I can not
25816         figure out how to extract the modreq from it.
25817
25818         Updated all the source files to use this.
25819
25820         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
25821         because it is referenced by MemberLookup very often. 
25822
25823 2002-01-09  Ravi Pratap  <ravi@ximian.com>
25824
25825         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
25826         TypeBuilder.GetCustomAttributes to retrieve what we need.
25827
25828         Get rid of redundant default_member_attr_type as this is the same as
25829         default_member_type which already exists.
25830
25831         * interface.cs, attribute.cs : Update accordingly.
25832
25833 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
25834
25835         * typemanager.cs: Enable IndexerPropertyName again.  It does not
25836         work for TYpeBuilders though.  Ravi, can you please fix this?
25837
25838         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
25839
25840         * expression.cs (Argument.Emit): Handle the case of ref objects
25841         being passed to ref functions;  
25842
25843         (ParameterReference.EmitLoad): Loads the content of the pointer
25844         without dereferencing.
25845
25846 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
25847
25848         * cs-tokenizer.cs: Implemented the pre-processing expressions.
25849
25850 2002-01-08  Ravi Pratap  <ravi@ximian.com>
25851
25852         * class.cs (Indexer.DefineMethod): Incorporate the interface
25853         type in the name of the method if we are doing explicit interface
25854         implementation.
25855
25856         * expression.cs (ConversionExists): Remove as it is completely obsolete.
25857
25858         (BetterConversion): Fix extremely trivial bug where we were referring to
25859         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
25860         again !
25861
25862         * ../errors/bug16.cs : Add although we have fixed it.
25863
25864 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
25865
25866         * expression.cs (BaseIndexer): Begin implementation.
25867
25868         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
25869
25870         * cs-parser.jay (indexer_declarator): Use qualified_identifier
25871         production directly to remove a shift/reduce, and implement
25872         explicit interface implementation.
25873
25874         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
25875         after a floating point suffix.
25876
25877         * expression.cs (DoNumericPromotions): Improved the conversion for
25878         uint/uint.  If we have a constant, we avoid doing a typecast to a
25879         larger type.
25880
25881         * class.cs (Indexer): Implement explicit interface implementation
25882         for indexers.
25883
25884 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25885
25886         * class.cs: make the default instance constructor public and hidebysig.
25887
25888 2001-01-03  Ravi Pratap  <ravi@ximian.com>
25889
25890         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
25891         so we can call it from elsewhere.
25892
25893         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
25894         we emit it internally if the class has a defined indexer; otherwise the user
25895         emits it by decorating the class definition with the DefaultMemberAttribute.
25896
25897         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
25898         attribute is not used on a type which defines an indexer.
25899
25900         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
25901         character when we skip whitespace.
25902
25903         * ../errors/cs0646.cs : Add.
25904
25905 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
25906
25907         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
25908         again. 
25909
25910         * makefile: Add practical target `mcs3.exe' which builds the third
25911         generation compiler. 
25912
25913         * expression.cs (New): Fix structures constructor calling.
25914
25915         * class.cs (Property, Method, Indexer): Emit Final flag on the
25916         method if we are an interface implementation and we are not
25917         abstract. 
25918
25919         * ecore.cs (PropertyExpr): New public field `IsBase', tells
25920         whether this property is referencing a `base' method.
25921
25922         * expression.cs (Invocation.EmitCall): take an extra argument:
25923         is_base, this is used to determine whether the `call' or
25924         `callvirt' opcode should be used.
25925
25926
25927         * delegate.cs: update EmitCall.
25928
25929         * class.cs (Method.Define): Set NewSlot for the cases where we are
25930         not implementing an interface method.
25931
25932         (Property.Define): ditto.
25933
25934 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
25935
25936         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
25937         'r'.  Allows mcs to parse itself fully.
25938
25939 2002-01-02  Ravi Pratap  <ravi@ximian.com>
25940
25941         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25942         of the number of initializers that require the InitializeArray method.
25943
25944         (CheckIndices): Store the Expression in all cases - not the plain value. Also
25945         update the above field where necessary.
25946
25947         (MakeByteBlob): Update accordingly.
25948
25949         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
25950         greater than 2.
25951
25952         (EmitDynamicInitializers): Update in accordance with the new optimization.
25953
25954         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25955         same OpCode applies.
25956
25957         * cs-parser.jay : Fix some glaring errors I introduced.
25958
25959 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
25960
25961         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25962         so that we can check for name clashes there too.
25963
25964         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25965         for interface indexers.
25966
25967         * interfaces.cs (Define): Emit the default member attribute.
25968
25969         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25970         variable was being referred to while setting the value ;-)
25971
25972 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
25973
25974         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25975         byte-by-byte information when we know the data is zero.
25976
25977         Make the block always a multiple of 4, because
25978         DefineInitializedData has a bug.
25979
25980         * assign.cs: Fix, we should assign from the temporary, not from
25981         the source. 
25982
25983         * expression.cs (MakeByteBlob): Fix my incorrect code.
25984
25985 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
25986
25987         * typemanager.cs (EnumToUnderlying): This function is used to get
25988         the underlying type from an enumeration, because it does not
25989         always work. 
25990
25991         * constant.cs: Use the I4_S form for values between -128 and 127.
25992
25993         * statement.cs (Block.LookupLabel): Looks up a label.
25994         (Block): Drop support for labeled blocks.
25995
25996         (LabeledStatement): New kind of statement that represents a label
25997         only.
25998
25999         (Goto): Finally implement this bad boy.
26000
26001         * cs-parser.jay: Update to reflect new mechanism to implement
26002         labels.
26003
26004 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26005
26006         * codegen.cs (EmitContext.This): a codegen property that keeps the
26007         a single instance of this instead of creating many different this
26008         instances. 
26009
26010         * delegate.cs (Delegate.DoResolve): Update to use the property;
26011
26012         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26013
26014         * expression.cs (BaseAccess.DoResolve): Ditto.
26015
26016 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26017
26018         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26019         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26020
26021         (InitCoreTypes): Update accordingly.
26022
26023         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26024         so we can quickly store the state.
26025
26026         (ApplyAttributes): Set the correct implementation flags
26027         for InternalCall methods.
26028
26029 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26030
26031         * expression.cs (EmitCall): if a method is not virtual, then do
26032         not use callvirt on it.
26033
26034         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26035         user defined stuff) requires the use of stobj, which takes an
26036         address on the stack instead of an array and an index.  So emit
26037         the Ldelema operation for it.
26038
26039         (EmitStoreOpcode): Use stobj for valuetypes.
26040
26041         (UnaryMutator.EmitCode): Use the right 1 value depending on
26042         whether we are dealing with int64/uint64, float or doubles.
26043
26044         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26045         constructors that I implemented last night.
26046
26047         (Constructor.IsDefault): Fix to work properly for static
26048         constructors.
26049
26050         * cs-parser.jay (CheckDef): report method signature errors.
26051         Update error number 103 to be 132.
26052
26053         * decl.cs: New AdditionResult enumeration value: MethodExists.
26054         Although we do this check for methods later on in the semantic
26055         analysis, catching repeated default constructors is so easy that
26056         we catch these here. 
26057
26058         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26059         promotions code.
26060
26061         (ParameterReference.EmitAssign, Emit): handle
26062         bools as bytes.
26063
26064         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26065         (ArrayAccess.EmitStoreOpcode): ditto.
26066
26067         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26068
26069         * expression.cs (MakeByteBlob): Complete all the missing types
26070         (uint, short, ushort, byte, sbyte)
26071
26072         * class.cs: Only init instance field initializers on instance
26073         constructors. 
26074
26075         Rename `constructors' to instance_constructors. 
26076
26077         (TypeContainer.AddConstructor): Only add constructors to the list
26078         if it is not static.
26079
26080         Make sure that we handle default_static_constructor independently
26081         everywhere where we handle instance_constructors
26082
26083 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26084
26085         * class.cs: Do not lookup or create a base initializer for a
26086         static constructor.
26087
26088         (ConstructorInitializer.Resolve): use the proper type to lookup
26089         for constructors.
26090
26091         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26092
26093         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26094         in DeclSpace. 
26095
26096         * decl.cs: CloseType is now an virtual method, the default
26097         implementation just closes this type.
26098
26099 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26100
26101         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26102         to PreserveSig by default. Also emit HideBySig on such methods.
26103
26104         Basically, set the defaults to standard values.
26105
26106         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26107         argument, if candidate is better, it can't be worse than the best !
26108
26109         (Invocation): Re-write bits to differentiate between methods being
26110         applicable in their expanded form and their normal form - for params
26111         methods of course.
26112
26113         Get rid of use_standard everywhere as only standard conversions are allowed
26114         in overload resolution. 
26115
26116         More spec conformance.
26117
26118 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26119
26120         * driver.cs: Add --timestamp, to see where the compiler spends
26121         most of its time.
26122
26123         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26124         `this' in static code.
26125
26126         (SimpleName.DoResolve): Implement in terms of a helper function
26127         that allows static-references to be passed upstream to
26128         MemberAccess.
26129
26130         (Expression.ResolveWithSimpleName): Resolve specially simple
26131         names when called by MemberAccess to implement the special
26132         semantics. 
26133
26134         (Expression.ImplicitReferenceConversion): Handle conversions from
26135         Null to reference types before others, as Null's type is
26136         System.Object. 
26137
26138         * expression.cs (Invocation.EmitCall): Handle the special case of
26139         calling methods declared on a reference type from a ValueType
26140         (Base classes System.Object and System.Enum)
26141
26142         (MemberAccess.Resolve): Only perform lookups on Enumerations if
26143         the left hand side is a TypeExpr, not on every enumeration. 
26144
26145         (Binary.Resolve): If types are reference types, then do a cast to
26146         object on operators != and == of both arguments.
26147
26148         * typemanager.cs (FindMembers): Extract instance and static
26149         members if requested.
26150
26151         * interface.cs (PopulateProperty): Use void_type instead of null
26152         as the return type for the setter method.
26153
26154         (PopulateIndexer): ditto.
26155
26156 2001-12-27  Ravi Pratap  <ravi@ximian.com>
26157
26158         * support.cs (ReflectionParameters): Fix minor bug where we
26159         were examining the wrong parameter for the ParamArray attribute.
26160
26161         Cope with requests for the type of the parameter at position
26162         greater than the params parameter's. We now return the element
26163         type of the params array as that makes more sense.
26164
26165         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
26166         accordingly as we no longer have to extract the element type
26167         ourselves.
26168
26169         (Invocation.OverloadResolve): Update.
26170
26171 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26172
26173         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26174         against IEnumerator, test whether the return value is a descendant
26175         of the IEnumerator interface.
26176
26177         * class.cs (Indexer.Define): Use an auxiliary method to implement
26178         the other bits of the method definition.  Begin support for
26179         explicit interface implementation.
26180
26181         (Property.DefineMethod): Use TypeManager.void_type instead of null
26182         for an empty return value.
26183
26184 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
26185
26186         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26187         dealing with a FieldExpr which is composed of a FieldBuilder, in
26188         the code path we did extract the constant, but we should have
26189         obtained the underlying value to be able to cast it (otherwise we
26190         end up in an infinite loop, this is what Ravi was running into).
26191
26192         (ArrayCreation.UpdateIndices): Arrays might be empty.
26193
26194         (MemberAccess.ResolveMemberAccess): Add support for section
26195         14.5.4.1 that deals with the special case of E.I when E is a type
26196         and something else, that I can be a reference to a static member.
26197
26198         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26199         handle a particular array type to create byte blobs, it is just
26200         something we dont generate byteblobs for.
26201
26202         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26203         arguments. 
26204
26205         * location.cs (Push): remove the key from the hashtable that we
26206         are about to add.   This happens for empty files.
26207
26208         * driver.cs: Dispose files after we have parsed them.
26209
26210         (tokenize): new function that only runs the tokenizer on its
26211         input, for speed testing.
26212
26213 2001-12-26  Ravi Pratap  <ravi@ximian.com>
26214
26215         * class.cs (Event.Define): Define the private field only if there
26216         are no accessors defined.
26217
26218         * expression.cs (ResolveMemberAccess): If there is no associated
26219         field with the event, that means we have an event defined with its
26220         own accessors and we should flag error cs0070 since transforming
26221         ourselves into a field is not valid in that case.
26222
26223         * ecore.cs (SimpleName.DoResolve): Same as above.
26224
26225         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26226         and charset to sane values.
26227
26228 2001-12-25  Ravi Pratap  <ravi@ximian.com>
26229
26230         * assign.cs (DoResolve): Perform check on events only if they 
26231         are being accessed outside the declaring type.
26232
26233         * cs-parser.jay (event_declarations): Update rules to correctly
26234         set the type of the implicit parameter etc.
26235
26236         (add_accessor, remove_accessor): Set current local parameters.
26237
26238         * expression.cs (Binary): For delegate addition and subtraction,
26239         cast the return value from the method into the appropriate delegate
26240         type.
26241
26242 2001-12-24  Ravi Pratap  <ravi@ximian.com>
26243
26244         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26245         of these as the workaround is unnecessary.
26246
26247         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26248         delegate data - none of that is needed at all.
26249
26250         Re-write bits to extract the instance expression and the delegate method
26251         correctly.
26252
26253         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
26254         on delegates too.
26255
26256         * attribute.cs (ApplyAttributes): New method to take care of common tasks
26257         of attaching attributes instead of duplicating code everywhere.
26258
26259         * everywhere : Update code to do attribute emission using the above method.
26260
26261 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26262
26263         * expression.cs (IsParamsMethodApplicable): if there are not
26264         parameters, return immediately.
26265
26266         * ecore.cs: The 0 literal can be implicity converted to an enum
26267         type. 
26268
26269         (SimpleName.DoResolve): First lookup the type, then lookup the
26270         members. 
26271
26272         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26273         want to get its address.  If the InstanceExpression is not
26274         addressable, store the result in a temporary variable, then get
26275         the address of it.
26276
26277         * codegen.cs: Only display 219 errors on warning level or above. 
26278
26279         * expression.cs (ArrayAccess): Make it implement the
26280         IMemoryLocation interface.
26281
26282         (Binary.DoResolve): handle the operator == (object a, object b)
26283         and operator != (object a, object b) without incurring into a
26284         BoxedCast (because 5 != o should never be performed).
26285
26286         Handle binary enumerator operators.
26287
26288         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26289         value type, otherwise use Ldelem_ref.
26290
26291         Use precomputed names;
26292
26293         (AddressOf): Implement address of
26294
26295         * cs-parser.jay (labeled_statement): Fix recursive block
26296         addition by reworking the production.
26297
26298         * expression.cs (New.DoEmit): New has a special case:
26299                 
26300                  If we are dealing with a ValueType, we have a few
26301                  situations to deal with:
26302                 
26303                     * The target of New is a ValueType variable, that is
26304                       easy, we just pass this as the variable reference
26305                 
26306                     * The target of New is being passed as an argument,
26307                       to a boxing operation or a function that takes a
26308                       ValueType.
26309                 
26310                       In this case, we need to create a temporary variable
26311                       that is the argument of New.
26312
26313
26314 2001-12-23  Ravi Pratap  <ravi@ximian.com>
26315
26316         * rootcontext.cs (LookupType): Check that current_type is not null before
26317         going about looking at nested types.
26318
26319         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26320         not implement the IAssignMethod interface any more.
26321
26322         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26323         where we tranform them into FieldExprs if they are being resolved from within
26324         the declaring type.
26325
26326         * ecore.cs (SimpleName.DoResolve): Do the same here.
26327
26328         * assign.cs (DoResolve, Emit): Clean up code considerably. 
26329
26330         * ../errors/bug10.cs : Add.
26331
26332         * ../errors/cs0070.cs : Add.
26333
26334         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26335
26336         * assign.cs : Get rid of EventIsLocal everywhere.
26337
26338 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26339
26340         * ecore.cs (ConvertIntLiteral): finished the implementation.
26341
26342         * statement.cs (SwitchLabel): Convert the value we are using as a
26343         key before looking up the table.
26344
26345 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26346
26347         * codegen.cs (EmitTopBlock): Require a Location argument now.
26348
26349         * cs-parser.jay (constructor_declarator): We need to setup
26350         current_local_parameters before we parse the
26351         opt_constructor_initializer, to allow the variables to be bound
26352         to the constructor arguments.
26353
26354         * rootcontext.cs (LookupType): First lookup nested classes in our
26355         class and our parents before we go looking outside our class.
26356
26357         * expression.cs (ConstantFold): Extract/debox the values at the
26358         beginnning. 
26359
26360         * rootcontext.cs (EmitCode): Resolve the constants first before we
26361         resolve the types.  This is not really needed, but it helps debugging.
26362
26363         * statement.cs: report location.
26364
26365         * cs-parser.jay: pass location to throw statement.
26366
26367         * driver.cs: Small bug fix.
26368
26369         * report.cs: Updated format to be 4-zero filled digits.
26370
26371 2001-12-22  Ravi Pratap  <ravi@ximian.com>
26372
26373         * expression.cs (CheckIndices): Fix minor bug where the wrong
26374         variable was being referred to ;-)
26375
26376         (DoEmit): Do not call EmitStaticInitializers when the 
26377         underlying type is System.Object.
26378
26379 2001-12-21  Ravi Pratap  <ravi@ximian.com>
26380
26381         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26382         and do the usual workaround for SRE.
26383
26384         * class.cs (MyEventBuilder.EventType): New member to get at the type
26385         of the event, quickly.
26386
26387         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26388
26389         * assign.cs (Assign.DoResolve): Handle the case when the target
26390         is an EventExpr and perform the necessary checks.
26391
26392         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26393         interface.
26394
26395         (SimpleName.MemberStaticCheck): Include check for EventExpr.
26396
26397         (EventExpr): Set the type in the constructor itself since we 
26398         are meant to be born fully resolved.
26399
26400         (EventExpr.Define): Revert code I wrote earlier.
26401                 
26402         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26403         instance expression is null. The instance expression is a This in that case
26404         or a null, depending on whether it is a static method or not.
26405
26406         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26407         refers to more than one method.
26408
26409         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26410         and accordingly flag errors.
26411
26412 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26413
26414         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26415
26416 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26417
26418         * location.cs (ToString): Provide useful rutine.
26419
26420 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26421
26422         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26423         objects, return the actual integral boxed.
26424
26425         * statement.cs (SwitchLabel): define an ILLabel for each
26426         SwitchLabel. 
26427
26428         (Switch.CheckSwitch): If the value is a Literal, extract
26429         the underlying literal.
26430
26431         Also in the unused hashtable we had, add the SwitchLabel so we can
26432         quickly look this value up.
26433
26434         * constant.cs: Implement a bunch of new constants.  Rewrite
26435         Literal based on this.  Made changes everywhere to adapt to this.
26436
26437         * expression.cs (Expression.MakeByteBlob): Optimize routine by
26438         dereferencing array only once, and also copes with enumrations.
26439
26440         bytes are two bytes wide, not one.
26441
26442         (Cast): Perform constant conversions.
26443
26444         * ecore.cs (TryImplicitIntConversion): Return literals instead of
26445         wrappers to the literals here.
26446
26447         * expression.cs (DoNumericPromotions): long literals can converted
26448         to ulong implicity (this is taken care of elsewhere, but I was
26449         missing this spot).
26450
26451         * ecore.cs (Expression.Literalize): Make the return type Literal,
26452         to improve type checking.
26453
26454         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26455
26456 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26457
26458         * literal.cs: Revert code from ravi that checked the bounds.  The
26459         bounds are sane by the definition of the type itself. 
26460
26461         * typemanager.cs: Fix implementation of ImplementsInterface.  We
26462         need to actually look up in our parent hierarchy for interfaces
26463         implemented. 
26464
26465         * const.cs: Use the underlying type for enumerations
26466
26467         * delegate.cs: Compute the basename for the delegate creation,
26468         that should fix the delegate test case, and restore the correct
26469         Type Lookup semantics in rootcontext
26470
26471         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
26472         referencing a nested type with the Reflection API is using the "+"
26473         sign. 
26474
26475         * cs-parser.jay: Do not require EOF token at the end.
26476
26477 2001-12-20  Ravi Pratap  <ravi@ximian.com>
26478
26479         * rootcontext.cs (LookupType): Concatenate type names with
26480         a '.' instead of a '+' The test suite passes again.
26481
26482         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26483         field of the enumeration.
26484
26485         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26486         the case when the member is an EventExpr.
26487
26488         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
26489         static has an associated instance expression.
26490
26491         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
26492
26493         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
26494
26495         * class.cs (Event.Define): Register event and perform appropriate checks
26496         for error #111.
26497
26498         We define the Add and Remove methods even if the use provides none because
26499         in that case, we provide default implementations ourselves.
26500
26501         Define a private field of the type of the event. This is done by the CSC compiler
26502         and we should be doing it too ;-)
26503
26504         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
26505         More methods we use in code we generate.
26506
26507         (multicast_delegate_type, delegate_type): Two separate types since the distinction
26508         is important.
26509
26510         (InitCoreTypes): Update accordingly for the above.
26511
26512         * class.cs (Event.Emit): Generate code for default accessors that we provide
26513
26514         (EmitDefaultMethod): Do the job in the above.
26515
26516         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
26517         appropriate place.
26518
26519 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26520
26521         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
26522         builders even if we were missing one.
26523
26524         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
26525         pass the Basename as our class name instead of the Name.  The
26526         basename will be correctly composed for us.
26527
26528         * parameter.cs (Paramters): Now takes a Location argument.
26529
26530         * decl.cs (DeclSpace.LookupType): Removed convenience function and
26531         make all the code call directly LookupType in RootContext and take
26532         this chance to pass the Location information everywhere.
26533
26534         * Everywhere: pass Location information.
26535
26536 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
26537
26538         * class.cs (Constructor.Define): Updated way of detecting the
26539         length of the parameters.
26540
26541         (TypeContainer.DefineType): Use basename as the type name for
26542         nested types.
26543
26544         (TypeContainer.Define): Do not recursively define types here, as
26545         definition is taken care in order by the RootContext.
26546
26547         * tree.cs: Keep track of namespaces in a per-file basis.
26548
26549         * parameter.cs (Parameter.ComputeSignature): Update to use
26550         DeclSpace. 
26551
26552         (Parameters.GetSignature): ditto.
26553
26554         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
26555         instead of a TypeContainer.
26556
26557         (Interface.SemanticAnalysis): Use `this' instead of our parent to
26558         resolve names.  Because we need to be resolve in our context, not
26559         our parents.
26560
26561         * driver.cs: Implement response files.
26562
26563         * class.cs (TypeContainer.DefineType): If we are defined, do not
26564         redefine ourselves.
26565
26566         (Event.Emit): Emit the code for add/remove handlers.
26567         (Event.Define): Save the MethodBuilders for add/remove.
26568
26569         * typemanager.cs: Use pair here too.
26570
26571         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
26572         DictionaryEntry requires the first argument to be non-null.  
26573
26574         (enum_declaration): Compute full name for registering the
26575         enumeration.
26576
26577         (delegate_declaration): Instead of using
26578         formal_parameter_list, use opt_formal_parameter_list as the list
26579         can be empty.
26580
26581         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
26582         (EventParsing): New property that controls whether `add' and
26583         `remove' are returned as tokens or identifiers (for events);
26584
26585 2001-12-19  Ravi Pratap  <ravi@ximian.com>
26586
26587         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
26588         use MyEventBuilder only and let it wrap the real builder for us.
26589
26590         (MyEventBuilder): Revamp constructor etc.
26591
26592         Implement all operations that we perform on EventBuilder in precisely the same
26593         way here too.
26594
26595         (FindMembers): Update to use the EventBuilder member.
26596
26597         (Event.Emit): Update accordingly.
26598
26599 2001-12-18  Ravi Pratap  <ravi@ximian.com>
26600
26601         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
26602         by calling the appropriate methods.
26603
26604         (GetCustomAttributes): Make stubs as they cannot possibly do anything
26605         useful.
26606
26607         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
26608
26609 2001-12-17  Ravi Pratap  <ravi@ximian.com>
26610
26611         * delegate.cs (Delegate.Populate): Check that the return type
26612         and various parameters types are indeed accessible.
26613
26614         * class.cs (Constructor.Define): Same here.
26615
26616         (Field.Define): Ditto.
26617
26618         (Event.Define): Ditto.
26619
26620         (Operator.Define): Check that the underlying Method defined itself
26621         correctly - so it's MethodBuilder should not be null.
26622
26623         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
26624         expression happens to be null.
26625
26626         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
26627         members but as of now we don't seem to be able to do anything really useful with it.
26628
26629         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
26630         not the EventBuilder.
26631
26632 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
26633
26634         * cs-tokenizer.cs: Add support for defines.
26635         Add support for #if, #elif, #else, #endif
26636
26637         (eval_var): evaluates a variable.
26638         (eval): stubbed for evaluating functions.
26639
26640         * cs-parser.jay: Pass the defines information
26641
26642         * driver.cs: Add --define command line option.
26643
26644         * decl.cs: Move MemberCore here.
26645
26646         Make it the base class for DeclSpace.  This allows us to catch and
26647         report 108 and 109 for everything now.
26648
26649         * class.cs (TypeContainer.Define): Extract all the members
26650         before populating and emit the warning 108 (new keyword required
26651         to override) instead of having each member implement this.
26652
26653         (MemberCore.Define): New abstract method, we will be using this in
26654         the warning reporting engine in Populate.
26655
26656         (Operator.Define): Adjust to new MemberCore protocol. 
26657
26658         * const.cs (Const): This does not derive from Expression, it is a
26659         temporary object we use to create fields, it is a MemberCore. 
26660
26661         * class.cs (Method.Define): Allow the entry point to be in a
26662         specific class.
26663
26664         * driver.cs: Rewrite the argument handler to clean it up a bit.
26665
26666         * rootcontext.cs: Made it just an auxiliary namespace feature by
26667         making everything static.
26668
26669         * driver.cs: Adapt code to use RootContext type name instead of
26670         instance variable.
26671
26672         * delegate.cs: Remove RootContext argument.
26673
26674         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
26675         argument. 
26676
26677         * class.cs (Event.Define): The lookup can fail.
26678
26679         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
26680
26681         * expression.cs: Resolve the this instance before invoking the code.
26682
26683 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
26684
26685         * cs-parser.jay: Add a production in element_access that allows
26686         the thing to become a "type" reference.  This way we can parse
26687         things like "(string [])" as a type.
26688
26689         Note that this still does not handle the more complex rules of
26690         casts. 
26691
26692
26693         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
26694
26695         * ecore.cs: (CopyNewMethods): new utility function used to
26696         assemble the list of methods from running FindMembers.
26697
26698         (MemberLookup): Rework FindMembers so that 
26699
26700 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
26701
26702         * class.cs (TypeContainer): Remove Delegates who fail to be
26703         defined.
26704
26705         * delegate.cs (Populate): Verify that we dont get null return
26706         values.   TODO: Check for AsAccessible.
26707
26708         * cs-parser.jay: Use basename to emit error 574 (destructor should
26709         have the same name as container class), not the full name.
26710
26711         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
26712         possible representation.  
26713
26714         Also implements integer type suffixes U and L.
26715
26716 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
26717
26718         * expression.cs (ArrayCreation.DoResolve): We need to do the
26719         argument resolution *always*.
26720
26721         * decl.cs: Make this hold the namespace.  Hold the root context as
26722         well.
26723         (LookupType): Move here.
26724
26725         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
26726
26727         * location.cs (Row, Name): Fixed the code, it was always returning
26728         references to the first file.
26729
26730         * interface.cs: Register properties defined through interfaces.
26731
26732         * driver.cs: Add support for globbing on the command line
26733
26734         * class.cs (Field): Make it derive from MemberCore as well.
26735         (Event): ditto.
26736
26737 2001-12-15  Ravi Pratap  <ravi@ximian.com>
26738
26739         * class.cs (Event::Define): Check that the type of the event is a delegate
26740         type else flag error #66.
26741
26742         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
26743         same.
26744
26745         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
26746         values of EntryPoint, CharSet etc etc.
26747
26748         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
26749
26750         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
26751         be null and we should ignore this. I am not sure if this is really clean. Apparently,
26752         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
26753         which needs this to do its work.
26754
26755         * ../errors/cs0066.cs : Add.
26756
26757 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
26758
26759         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
26760         helper functions.
26761
26762         * class.cs: (MethodSignature.MethodSignature): Removed hack that
26763         clears out the parameters field.
26764         (MemberSignatureCompare): Cleanup
26765
26766         (MemberCore): New base class used to share code between MethodCore
26767         and Property.
26768
26769         (RegisterRequiredImplementations) BindingFlags.Public requires
26770         either BindingFlags.Instace or Static.  Use instance here.
26771
26772         (Property): Refactored code to cope better with the full spec.
26773
26774         * parameter.cs (GetParameterInfo): Return an empty array instead
26775         of null on error.
26776
26777         * class.cs (Property): Abstract or extern properties have no bodies.
26778
26779         * parameter.cs (GetParameterInfo): return a zero-sized array.
26780
26781         * class.cs (TypeContainer.MethodModifiersValid): Move all the
26782         method modifier validation to the typecontainer so we can reuse
26783         this on properties.
26784
26785         (MethodCore.ParameterTypes): return an empty sized array of types.
26786
26787         (Property.Define): Test property modifier validity.
26788
26789         Add tests for sealed/override too.
26790
26791         (Method.Emit): abstract or extern methods have no bodies.
26792
26793 2001-12-14  Ravi Pratap  <ravi@ximian.com>
26794
26795         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
26796         thing.
26797
26798         (Method::Define, ::Emit): Modify accordingly.
26799
26800         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
26801
26802         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
26803
26804         * makefile: Pass in /unsafe.
26805
26806 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
26807
26808         * class.cs (MakeKey): Kill routine.
26809
26810         * class.cs (TypeContainer.Define): Correctly define explicit
26811         method implementations (they require the full interface name plus
26812         the method name).
26813
26814         * typemanager.cs: Deply the PtrHashtable here and stop using the
26815         lame keys.  Things work so much better.
26816
26817         This of course broke everyone who depended on `RegisterMethod' to
26818         do the `test for existance' test.  This has to be done elsewhere.
26819
26820         * support.cs (PtrHashtable): A hashtable that avoid comparing with
26821         the object stupid Equals method (because, that like fails all over
26822         the place).  We still do not use it.
26823
26824         * class.cs (TypeContainer.SetRequiredInterface,
26825         TypeContainer.RequireMethods): Killed these two routines and moved
26826         all the functionality to RegisterRequiredImplementations.
26827
26828         (TypeContainer.RegisterRequiredImplementations): This routine now
26829         registers all the implementations required in an array for the
26830         interfaces and abstract methods.  We use an array of structures
26831         which can be computed ahead of time to reduce memory usage and we
26832         also assume that lookups are cheap as most classes will not
26833         implement too many interfaces.
26834
26835         We also avoid creating too many MethodSignatures.
26836
26837         (TypeContainer.IsInterfaceMethod): Update and optionally does not
26838         clear the "pending" bit if we find that there are problems with
26839         the declaration.
26840
26841         (TypeContainer.VerifyPendingMethods): Update to report errors of
26842         methods that look like implementations but are not.
26843
26844         (TypeContainer.Define): Add support for explicit interface method
26845         implementation. 
26846
26847 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
26848
26849         * typemanager.cs: Keep track of the parameters here instead of
26850         being a feature of the TypeContainer.
26851
26852         * class.cs: Drop the registration of parameters here, as
26853         InterfaceMethods are also interface declarations.
26854
26855         * delegate.cs: Register methods with the TypeManager not only with
26856         the TypeContainer.  This code was buggy.
26857
26858         * interface.cs: Full registation here.
26859
26860 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
26861
26862         * expression.cs: Remove reducer for binary expressions, it can not
26863         be done this way.
26864
26865         * const.cs: Put here the code that used to go into constant.cs
26866
26867         * constant.cs: Put here the code for constants, this is a new base
26868         class for Literals.
26869
26870         * literal.cs: Make Literal derive from Constant.
26871
26872 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
26873
26874         * statement.cs (Return.Emit): Report error 157 if the user
26875         attempts to return from a finally block.
26876
26877         (Return.Emit): Instead of emitting a return, jump to the end of
26878         the function.
26879
26880         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
26881         LocalBuilder to store the result of the function.  ReturnLabel is
26882         the target where we jump.
26883
26884
26885 2001-12-09  Radek Doulik  <rodo@ximian.com>
26886
26887         * cs-parser.jay: remember alias in current namespace
26888
26889         * ecore.cs (SimpleName::DoResolve): use aliases for types or
26890         namespaces
26891
26892         * class.cs (LookupAlias): lookup alias in my_namespace
26893
26894         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
26895         aliases hashtable
26896         (LookupAlias): lookup alias in this and if needed in parent
26897         namespaces
26898
26899 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
26900
26901         * support.cs: 
26902
26903         * rootcontext.cs: (ModuleBuilder) Made static, first step into
26904         making things static.  I need this to avoid passing the
26905         TypeContainer when calling ParameterType.
26906
26907         * support.cs (InternalParameters.ParameterType): Remove ugly hack
26908         that did string manipulation to compute the type and then call
26909         GetType.  Use Parameter.ParameterType instead.
26910
26911         * cs-tokenizer.cs: Consume the suffix for floating values.
26912
26913         * expression.cs (ParameterReference): figure out whether this is a
26914         reference parameter or not.  Kill an extra variable by computing
26915         the arg_idx during emission.
26916
26917         * parameter.cs (Parameters.GetParameterInfo): New overloaded
26918         function that returns whether a parameter is an out/ref value or not.
26919
26920         (Parameter.ParameterType): The type of the parameter (base,
26921         without ref/out applied).
26922
26923         (Parameter.Resolve): Perform resolution here.
26924         (Parameter.ExternalType): The full type (with ref/out applied).
26925
26926         * statement.cs (Using.Emit, Using.EmitExpression): Implement
26927         support for expressions on the using statement.
26928
26929 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
26930
26931         * statement.cs (Using.EmitLocalVariableDecls): Split the
26932         localvariable handling of the using statement.
26933
26934         (Block.EmitMeta): Keep track of variable count across blocks.  We
26935         were reusing slots on separate branches of blocks.
26936
26937         (Try.Emit): Emit the general code block, we were not emitting it. 
26938
26939         Check the type of the declaration to be an IDisposable or
26940         something that can be implicity converted to it. 
26941
26942         Emit conversions if required.
26943
26944         * ecore.cs (EmptyExpression): New utility class.
26945         (Expression.ImplicitConversionExists): New utility function.
26946
26947 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
26948
26949         * statement.cs (Using): Implement.
26950
26951         * expression.cs (LocalVariableReference): Support read only variables.
26952
26953         * statement.cs: Remove the explicit emit for the Leave opcode.
26954         (VariableInfo): Add a readonly field.
26955
26956 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
26957
26958         * ecore.cs (ConvCast): new class used to encapsulate the various
26959         explicit integer conversions that works in both checked and
26960         unchecked contexts.
26961
26962         (Expression.ConvertNumericExplicit): Use new ConvCast class to
26963         properly generate the overflow opcodes.
26964
26965 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26966
26967         * statement.cs: The correct type for the EmptyExpression is the
26968         element_type, not the variable type.  Ravi pointed this out.
26969
26970 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26971
26972         * class.cs (Method::Define): Handle PInvoke methods specially
26973         by using DefinePInvokeMethod instead of the usual one.
26974
26975         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26976         above to do the task of extracting information and defining the method.
26977
26978 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26979
26980         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26981         of the condition for string type.
26982
26983         (Emit): Move that here. 
26984
26985         (ArrayCreation::CheckIndices): Keep string literals in their expression
26986         form.
26987
26988         (EmitDynamicInitializers): Handle strings appropriately.
26989
26990 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26991
26992         * codegen.cs (EmitContext): Replace multiple variables with a
26993         single pointer to the current Switch statement.
26994
26995         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26996         EmitContext.
26997
26998 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26999
27000         * statement.cs 
27001
27002         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27003         default'.
27004
27005         (Foreach.Emit): Foreach on arrays was not setting
27006         up the loop variables (for break/continue).
27007
27008         (GotoCase): Semi-implented.
27009
27010 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27011
27012         * attribute.cs (CheckAttribute): Handle system attributes by using
27013         Attribute.GetAttributes to examine information we need.
27014
27015         (GetValidPlaces): Same here.
27016
27017         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27018
27019         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27020
27021         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27022
27023         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27024
27025         (Method::Emit): Handle the case when we are a PInvoke method.
27026
27027 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27028
27029         * expression.cs: Use ResolveWithSimpleName on compound names.
27030
27031 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27032
27033         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27034         before trying to reduce it.
27035
27036         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27037
27038         * constant.cs (LookupConstantValue): Implement.
27039
27040         (EmitConstant): Use the above in emitting the constant.
27041
27042         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27043         that are user-defined by doing a LookupConstantValue on them.
27044
27045         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27046         too, like above.
27047
27048 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27049
27050         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27051
27052         (BaseAccess.DoResolve): Implement.
27053
27054         (MemberAccess.DoResolve): Split this routine into a
27055         ResolveMemberAccess routine that can be used independently
27056
27057 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27058
27059         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27060         As that share bits of the implementation.  Is returns a boolean,
27061         while As returns the Type that is being probed.
27062
27063 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27064
27065         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27066         instead of a Literal - much easier.
27067
27068         (EnumInTransit): Remove - utterly useless :-)
27069
27070         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27071
27072         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27073
27074         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27075         chain when we have no associated expression.
27076
27077 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27078
27079         * constant.cs (Define): Use Location while reporting the errror.
27080
27081         Also emit a warning when 'new' is used and there is no inherited
27082         member to hide.
27083
27084         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27085         populated.
27086
27087         (LookupEnumValue): Implement to lookup an enum member's value and define it
27088         if necessary.
27089
27090         (Populate): Re-write accordingly to use the above routine.
27091
27092 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27093
27094         * expression.cs (This): Fix prototype for DoResolveLValue to
27095         override the base class DoResolveLValue.
27096
27097         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27098         declarations) 
27099
27100         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27101         (we need to load the address of the field here).  This fixes
27102         test-22. 
27103
27104         (FieldExpr.DoResolveLValue): Call the DoResolve
27105         function to initialize the Instance expression.
27106
27107         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27108         correctly the GetEnumerator operation on a value type.
27109
27110         * cs-parser.jay: Add more simple parsing error catches.
27111
27112         * statement.cs (Switch): Add support for string switches.
27113         Handle null specially.
27114
27115         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27116
27117 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27118
27119         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27120
27121         (declare_local_constant): New helper function.
27122
27123         * statement.cs (AddConstant): Keep a separate record of constants
27124
27125         (IsConstant): Implement to determine if a variable is a constant.
27126
27127         (GetConstantExpression): Implement.
27128
27129         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27130
27131         * statement.cs (IsVariableDefined): Re-write.
27132
27133 2001-11-27  Ravi Pratap  <ravi@ximian.com>
27134
27135         * class.cs (TypeContainer::FindMembers): Look for constants
27136         in the case when we are looking for MemberTypes.Field
27137
27138         * expression.cs (MemberAccess::DoResolve): Check that in the
27139         case we are a FieldExpr and a Literal, we are not being accessed
27140         by an instance reference.
27141
27142         * cs-parser.jay (local_constant_declaration): Implement.
27143
27144         (declaration_statement): Implement for constant declarations.
27145
27146 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
27147
27148         * statement.cs (Switch): Catch double defaults.
27149
27150         (Switch): More work on the switch() statement
27151         implementation.  It works for integral values now, need to finish
27152         string support.
27153
27154
27155 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27156
27157         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27158         integer literals into other integer literals.  To be used by
27159         switch. 
27160
27161 2001-11-24  Ravi Pratap  <ravi@ximian.com>
27162
27163         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27164         some memory.
27165
27166         (EmitDynamicInitializers): Cope with the above since we extract data
27167         directly from ArrayData now.
27168
27169         (ExpectInitializers): Keep track of whether initializers are mandatory
27170         or not.
27171
27172         (Bounds): Make it a hashtable to prevent the same dimension being 
27173         recorded for every element in that dimension.
27174
27175         (EmitDynamicInitializers): Fix bug which prevented the Set array method
27176         from being found.
27177
27178         Also fix bug which was causing the indices to be emitted in the reverse
27179         order.
27180
27181 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27182
27183         * expression.cs (ArrayCreation): Implement the bits that Ravi left
27184         unfinished.  They do not work, because the underlying code is
27185         sloppy.
27186
27187 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27188
27189         * cs-parser.jay: Remove bogus fixme.
27190
27191         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27192         on Switch statement.
27193
27194 2001-11-23  Ravi Pratap  <ravi@ximian.com>
27195
27196         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27197         the same. 
27198
27199         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27200         parameter. Apparently, any expression is allowed. 
27201
27202         (ValidateInitializers): Update accordingly.
27203
27204         (CheckIndices): Fix some tricky bugs thanks to recursion.
27205
27206         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
27207         I was being completely brain-dead.
27208
27209         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27210         and re-write acordingly.
27211
27212         (DelegateInvocation): Re-write accordingly.
27213
27214         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27215
27216         (MakeByteBlob): Handle types more correctly.
27217
27218         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27219         initialization from expressions but it is incomplete because I am a complete
27220         Dodo :-|
27221
27222 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27223
27224         * statement.cs (If.Emit): Fix a bug that generated incorrect code
27225         on If.  Basically, we have to return `true' (ie, we do return to
27226         our caller) only if both branches of the if return.
27227
27228         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27229         short-circuit operators, handle them as short circuit operators. 
27230
27231         (Cast.DoResolve): Resolve type.
27232         (Cast.Cast): Take an expression as the target type.
27233
27234         * cs-parser.jay (cast_expression): Remove old hack that only
27235         allowed a limited set of types to be handled.  Now we take a
27236         unary_expression and we resolve to a type during semantic
27237         analysis.
27238
27239         Use the grammar productions from Rhys to handle casts (this is
27240         not complete like Rhys syntax yet, we fail to handle that corner
27241         case that C# has regarding (-x), but we will get there.
27242
27243 2001-11-22  Ravi Pratap  <ravi@ximian.com>
27244
27245         * class.cs (EmitFieldInitializer): Take care of the case when we have a
27246         field which is an array type.
27247
27248         * cs-parser.jay (declare_local_variables): Support array initialization too.
27249
27250         * typemanager.cs (MakeKey): Implement.
27251
27252         (everywhere): Use the above appropriately.
27253
27254         * cs-parser.jay (for_statement): Update for array initialization while
27255         declaring variables.
27256
27257         * ecore.cs : The error message was correct, it's the variable's names that
27258         were misleading ;-) Make the code more readable.
27259
27260         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27261         the correct type etc.
27262
27263         (ConvertExplicit): Handle Enum types by examining the underlying type.
27264
27265 2001-11-21  Ravi Pratap  <ravi@ximian.com>
27266
27267         * parameter.cs (GetCallingConvention): Always return
27268         CallingConventions.Standard for now.
27269
27270 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27271
27272         * expression.cs (Binary.ResolveOperator): Update the values of `l'
27273         and `r' after calling DoNumericPromotions.
27274
27275         * ecore.cs: Fix error message (the types were in the wrong order).
27276
27277         * statement.cs (Foreach.ProbeCollectionType): Need to pass
27278         BindingFlags.Instance as well 
27279
27280         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27281         implicit int literal conversion in an empty cast so that we
27282         propagate the right type upstream.
27283
27284         (UnboxCast): new class used to unbox value types.
27285         (Expression.ConvertExplicit): Add explicit type conversions done
27286         by unboxing.
27287
27288         (Expression.ImplicitNumericConversion): Oops, forgot to test for
27289         the target type before applying the implicit LongLiterals to ULong
27290         literal cast.
27291
27292 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
27293
27294         * cs-parser.jay (for_statement): Reworked the way For works: now
27295         we declare manually any variables that are introduced in
27296         for_initializer to solve the problem of having out-of-band code
27297         emition (that is what got for broken).
27298
27299         (declaration_statement): Perform the actual variable declaration
27300         that used to be done in local_variable_declaration here.
27301
27302         (local_variable_declaration): Do not declare anything, just pass
27303         the information on a DictionaryEntry
27304
27305 2001-11-20  Ravi Pratap  <ravi@ximian.com>
27306
27307         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27308         re-write of the logic to now make it recursive.
27309
27310         (UpdateIndices): Re-write accordingly.
27311
27312         Store element data in a separate ArrayData list in the above methods.
27313
27314         (MakeByteBlob): Implement to dump the array data into a byte array.
27315
27316 2001-11-19  Ravi Pratap  <ravi@ximian.com>
27317
27318         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27319         into CheckIndices.
27320
27321         * constant.cs (Define): Implement.
27322
27323         (EmitConstant): Re-write fully.
27324
27325         Pass in location info.
27326
27327         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27328         respectively.
27329
27330         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27331         DictionaryEntry since we need location info too.
27332
27333         (constant_declaration): Update accordingly.
27334
27335         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27336         code into another method : UpdateIndices.
27337
27338 2001-11-18  Ravi Pratap  <ravi@ximian.com>
27339
27340         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27341         some type checking etc.
27342
27343 2001-11-17  Ravi Pratap  <ravi@ximian.com>
27344
27345         * expression.cs (ArrayCreation::ValidateInitializers): Implement
27346         bits to provide dimension info if the user skips doing that.
27347
27348         Update second constructor to store the rank correctly.
27349
27350 2001-11-16  Ravi Pratap  <ravi@ximian.com>
27351
27352         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27353         and try to implement.
27354
27355         * ../errors/cs0150.cs : Add.
27356
27357         * ../errors/cs0178.cs : Add.
27358
27359 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
27360
27361         * statement.cs: Implement foreach on multi-dimensional arrays. 
27362
27363         * parameter.cs (Parameters.GetParameterByName): Also lookup the
27364         name of the params argument.
27365
27366         * expression.cs: Use EmitStoreOpcode to get the right opcode while
27367         initializing the array.
27368
27369         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27370         we can use this elsewhere.
27371
27372         * statement.cs: Finish implementation of foreach for single
27373         dimension arrays.
27374
27375         * cs-parser.jay: Use an out-of-band stack to pass information
27376         around, I wonder why I need this.
27377
27378         foreach_block: Make the new foreach_block the current_block.
27379
27380         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27381         function used to return a static Parameters structure.  Used for
27382         empty parameters, as those are created very frequently.
27383
27384         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27385
27386 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27387
27388         * interface.cs : Default modifier is private, not public. The
27389         make verify test passes again.
27390
27391 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27392
27393         * support.cs (ReflectionParameters): Fix logic to determine
27394         whether the last parameter is a params one. Test 9 passes again.
27395
27396         * delegate.cs (Populate): Register the builders we define with
27397         RegisterParameterForBuilder. Test 19 passes again.
27398
27399         * cs-parser.jay (property_declaration): Reference $6 instead
27400         of $$ to get at the location.
27401
27402         (indexer_declaration): Similar stuff.
27403
27404         (attribute): Ditto.
27405
27406         * class.cs (Property): Register parameters for the Get and Set methods
27407         if they exist. Test 23 passes again.
27408
27409         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27410         call to EmitArguments as we are sure there aren't any params arguments. 
27411         Test 32 passes again.
27412
27413         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27414         IndexOutOfRangeException. 
27415
27416         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27417         Test 33 now passes again.
27418
27419 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
27420
27421         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27422         broke a bunch of things.  Will have to come up with a better way
27423         of tracking locations.
27424
27425         * statement.cs: Implemented foreach for single dimension arrays.
27426
27427 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27428
27429         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27430         an error.  This removes the lookup from the critical path.
27431
27432         * cs-parser.jay: Removed use of temporary_loc, which is completely
27433         broken. 
27434
27435 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
27436
27437         * support.cs (ReflectionParameters.ParameterModifier): Report
27438         whether the argument is a PARAMS argument or not.
27439
27440         * class.cs: Set the attribute `ParamArrayAttribute' on the
27441         parameter argument.
27442
27443         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27444         and cons_param_array_attribute (ConstructorInfo for
27445         ParamArrayAttribute)., 
27446
27447         * codegen.cs: Emit the return using the `Return' statement, that
27448         way we can report the error correctly for missing return values. 
27449
27450         * class.cs (Method.Emit): Clean up.
27451
27452         * expression.cs (Argument.Resolve): Take another argument: the
27453         location where this argument is used.  Notice that this is not
27454         part of the "Argument" class as to reduce the size of the
27455         structure (we know the approximate location anyways).
27456
27457         Test if the argument is a variable-reference, if not, then
27458         complain with a 206.
27459
27460         (Argument.Emit): Emit addresses of variables.
27461
27462         (Argument.FullDesc): Simplify.
27463
27464         (Invocation.DoResolve): Update for Argument.Resolve.
27465
27466         (ElementAccess.DoResolve): ditto.
27467
27468         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27469         method should be virtual, as this method is always virtual.
27470
27471         (NewDelegate.DoResolve): Update for Argument.Resolve.
27472
27473         * class.cs (ConstructorInitializer.DoResolve): ditto.
27474
27475         * attribute.cs (Attribute.Resolve): ditto.
27476
27477 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
27478
27479         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27480
27481         * expression.cs (ParameterReference): Drop IStackStorage and implement
27482         IAssignMethod instead. 
27483
27484         (LocalVariableReference): ditto.
27485
27486         * ecore.cs (FieldExpr): Drop IStackStorage and implement
27487         IAssignMethod instead. 
27488
27489 2001-11-13  Miguel de Icaza <miguel@ximian.com>
27490
27491         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
27492         enumerations that are used in heavily used structures derive from
27493         byte in a laughable and pathetic attempt to reduce memory usage.
27494         This is the kind of pre-optimzations that you should not do at
27495         home without adult supervision.
27496
27497         * expression.cs (UnaryMutator): New class, used to handle ++ and
27498         -- separatedly from the other unary operators.  Cleans up the
27499         code, and kills the ExpressionStatement dependency in Unary.
27500
27501         (Unary): Removed `method' and `Arguments' from this class, making
27502         it smaller, and moving it all to SimpleCall, so I can reuse this
27503         code in other locations and avoid creating a lot of transient data
27504         strucutres when not required.
27505
27506         * cs-parser.jay: Adjust for new changes.
27507
27508 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
27509
27510         * enum.cs (Enum.Populate): If there is a failure during
27511         definition, return
27512
27513         * cs-parser.jay (opt_enum_base): we used to catch type errors
27514         here, but this is really incorrect.  The type error should be
27515         catched during semantic analysis.
27516
27517 2001-12-11  Ravi Pratap  <ravi@ximian.com>
27518
27519         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
27520         current_local_parameters as expected since I, in my stupidity, had forgotten
27521         to do this :-)
27522
27523         * attribute.cs (GetValidPlaces): Fix stupid bug.
27524
27525         * class.cs (Method::Emit): Perform check on applicability of attributes.
27526
27527         (Constructor::Emit): Ditto.
27528
27529         (Field::Emit): Ditto.
27530
27531         (Field.Location): Store location information.
27532
27533         (Property, Event, Indexer, Operator): Ditto.
27534
27535         * cs-parser.jay (field_declaration): Pass in location for each field.
27536
27537         * ../errors/cs0592.cs : Add.
27538
27539 2001-11-12  Ravi Pratap  <ravi@ximian.com>
27540
27541         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
27542
27543         (InitCoreTypes): Update accordingly.
27544
27545         (RegisterAttrType, LookupAttr): Implement.
27546
27547         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
27548         info about the same.
27549
27550         (Resolve): Update to populate the above as necessary.
27551
27552         (Error592): Helper.
27553
27554         (GetValidPlaces): Helper to the above.
27555
27556         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
27557
27558         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
27559
27560 2001-11-12  Ravi Pratap  <ravi@ximian.com>
27561
27562         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
27563
27564         * ../errors/cs0617.cs : Add.
27565
27566 2001-11-11  Ravi Pratap  <ravi@ximian.com>
27567
27568         * enum.cs (Emit): Rename to Populate to be more consistent with what
27569         we expect it to do and when exactly it is called.
27570
27571         * class.cs, rootcontext.cs : Update accordingly.
27572
27573         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
27574         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
27575
27576         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
27577
27578         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
27579         of a fieldinfo using the above, when dealing with a FieldBuilder.
27580
27581 2001-11-10  Ravi Pratap  <ravi@ximian.com>
27582
27583         * ../errors/cs0031.cs : Add.
27584
27585         * ../errors/cs1008.cs : Add.
27586
27587         * ../errrors/cs0543.cs : Add.
27588
27589         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
27590         enum type.
27591
27592         (FindMembers): Implement.
27593
27594         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
27595         enums and delegates too.
27596
27597         (enum_types): Rename to builder_to_enum.
27598
27599         (delegate_types): Rename to builder_to_delegate.
27600
27601         * delegate.cs (FindMembers): Implement.
27602
27603 2001-11-09  Ravi Pratap  <ravi@ximian.com>
27604
27605         * typemanager.cs (IsEnumType): Implement.
27606
27607         * enum.cs (Emit): Re-write parts to account for the underlying type
27608         better and perform checking etc.
27609
27610         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
27611         of the underlying type.
27612
27613         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
27614         value
27615
27616         * enum.cs (error31): Helper to report error #31.
27617
27618         * cs-parser.jay (enum_declaration): Store location of each member too.
27619
27620         * enum.cs (member_to_location): New hashtable. 
27621
27622         (AddEnumMember): Update location hashtable.
27623
27624         (Emit): Use the location of each member while reporting errors.
27625
27626 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27627
27628         * cs-parser.jay: A for_initializer if is a
27629         local_variable_declaration really ammount to have an implicit
27630         block with the variable declaration and no initializer for for.
27631
27632         * statement.cs (For.Emit): Cope with null initializers.
27633
27634         This fixes the infinite loop on for initializers.
27635
27636 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
27637
27638         * enum.cs: More cleanup.
27639
27640         * ecore.cs: Remove dead code.
27641
27642         * class.cs (Property.Emit): More simplification.
27643         (Event.Emit): ditto.
27644
27645         Reworked to have less levels of indentation.
27646
27647 2001-11-08  Ravi Pratap  <ravi@ximian.com>
27648
27649         * class.cs (Property): Emit attributes.
27650
27651         (Field): Ditto.
27652
27653         (Event): Ditto.
27654
27655         (Indexer): Ditto.
27656
27657         (Operator): Ditto.
27658
27659         * enum.cs (Emit): Ditto.
27660
27661         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
27662         Enums too.
27663
27664         * class.cs (Field, Event, etc.): Move attribute generation into the
27665         Emit method everywhere.
27666
27667         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
27668         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
27669         as we had no way of defining nested enums !
27670
27671         * rootcontext.cs : Adjust code accordingly.
27672
27673         * typemanager.cs (AddEnumType): To keep track of enum types separately.
27674
27675 2001-11-07  Ravi Pratap  <ravi@ximian.com>
27676
27677         * expression.cs (EvalConstantExpression): Move into ecore.cs
27678
27679         * enum.cs (Enum): Rename some members and make them public and readonly
27680         according to our convention.
27681
27682         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
27683         nothing else.
27684
27685         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
27686
27687         (Enum::Emit): Write a simple version for now which doesn't try to compute
27688         expressions. I shall modify this to be more robust in just a while.
27689
27690         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
27691
27692         (TypeContainer::CloseType): Create the Enum types too.
27693
27694         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
27695
27696         * expression.cs (EvalConstantExpression): Get rid of completely.
27697
27698         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
27699         user-defined values and other cases.
27700
27701         (IsValidEnumLiteral): Helper function.
27702
27703         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
27704         out there in the case we had a literal FieldExpr.
27705
27706         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
27707
27708         (Literalize): Revamp a bit to take two arguments.
27709
27710         (EnumLiteral): New class which derives from Literal to wrap enum literals.
27711
27712 2001-11-06  Ravi Pratap  <ravi@ximian.com>
27713
27714         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
27715
27716         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
27717
27718         (Resolve): Use the above to ensure we have proper initializers.
27719
27720 2001-11-05  Ravi Pratap  <ravi@ximian.com>
27721
27722         * expression.cs (Expression::EvalConstantExpression): New method to 
27723         evaluate constant expressions.
27724
27725         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
27726
27727 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
27728
27729         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
27730         in an array.
27731
27732         (Binary.ResolveOperator): Handle operator != (object a, object b)
27733         and operator == (object a, object b);
27734
27735         (Binary.DoNumericPromotions): Indicate whether the numeric
27736         promotion was possible.
27737
27738         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
27739         Implement.  
27740
27741         Made the ArrayAccess implement interface IAssignMethod instead of
27742         IStackStore as the order in which arguments are passed reflects
27743         this.
27744
27745         * assign.cs: Instead of using expr.ExprClass to select the way of
27746         assinging, probe for the IStackStore/IAssignMethod interfaces.
27747
27748         * typemanager.cs: Load InitializeArray definition.
27749
27750         * rootcontext.cs (RootContext.MakeStaticData): Used to define
27751         static data that can be used to initialize arrays. 
27752
27753 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
27754
27755         * expression.cs: Handle operator== and operator!= for booleans.
27756
27757         (Conditioal.Reduce): Implement reducer for the ?: operator.
27758
27759         (Conditional.Resolve): Implement dead code elimination.
27760
27761         (Binary.Resolve): Catch string literals and return a new
27762         concatenated string.
27763
27764         (Unary.Reduce): Implement reduction of unary expressions.
27765
27766         * ecore.cs: Split out the expression core handling here.
27767
27768         (Expression.Reduce): New method used to perform constant folding
27769         and CSE.  This is needed to support constant-expressions. 
27770
27771         * statement.cs (Statement.EmitBoolExpression): Pass true and false
27772         targets, and optimize for !x.
27773
27774 2001-11-04  Ravi Pratap  <ravi@ximian.com>
27775
27776         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
27777         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
27778         set custom atttributes.
27779
27780         * literal.cs (Literal::GetValue): New abstract method to return the actual
27781         value of the literal, cast as an object.
27782
27783         (*Literal): Implement GetValue method.
27784
27785         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
27786         expressions to the arraylist but objects of type Argument.
27787
27788         * class.cs (TypeContainer::Emit): Emit our attributes too.
27789
27790         (Method::Emit, Constructor::Emit): Ditto.
27791
27792         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
27793         to be ignoring earlier.
27794
27795 2001-11-03  Ravi Pratap  <ravi@ximian.com>
27796
27797         * attribute.cs (AttributeSection::Define): Implement to do the business
27798         of constructing a CustomAttributeBuilder.
27799
27800         (Attribute): New trivial class. Increases readability of code.  
27801
27802         * cs-parser.jay : Update accordingly.
27803
27804         (positional_argument_list, named_argument_list, named_argument): New rules
27805
27806         (attribute_arguments): Use the above so that we are more correct.
27807
27808 2001-11-02  Ravi Pratap  <ravi@ximian.com>
27809
27810         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
27811         to perform all checks for a method with a params parameter.
27812
27813         (Invocation::OverloadResolve): Update to use the above method and therefore
27814         cope correctly with params method invocations.
27815
27816         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
27817         params too.
27818
27819         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
27820         constructors in our parent too because we can't afford to miss out on 
27821         protected ones ;-)
27822
27823         * attribute.cs (AttributeSection): New name for the class Attribute
27824
27825         Other trivial changes to improve readability.
27826
27827         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
27828         use the new class names.
27829
27830 2001-11-01  Ravi Pratap  <ravi@ximian.com>
27831
27832         * class.cs (Method::Define): Complete definition for params types too
27833
27834         (Indexer::Define): Ditto.
27835
27836         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
27837         Cope everywhere with a request for info about the array parameter.
27838
27839 2001-11-01  Ravi Pratap  <ravi@ximian.com>
27840
27841         * tree.cs (RecordNamespace): Fix up to check for the correct key.
27842
27843         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
27844         local_variable_type to extract the string corresponding to the type.
27845
27846         (local_variable_type): Fixup the action to use the new helper method.
27847
27848         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
27849         go.
27850
27851         * expression.cs : Clean out code which uses the above.
27852
27853 2001-10-31  Ravi Pratap  <ravi@ximian.com>
27854
27855         * typemanager.cs (RegisterMethod): Check if we already have an existing key
27856         and bale out if necessary by returning a false.
27857
27858         (RegisterProperty): Ditto.
27859
27860         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
27861         and print out appropriate error messages.
27862
27863         * interface.cs (everywhere): Ditto.
27864
27865         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
27866         location to constructor.
27867
27868         * class.cs (Property, Event, Indexer): Update accordingly.
27869
27870         * ../errors/cs111.cs : Added.
27871
27872         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
27873         of a method, as laid down by the spec.
27874
27875         (Invocation::OverloadResolve): Use the above method.
27876
27877 2001-10-31  Ravi Pratap  <ravi@ximian.com>
27878
27879         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
27880         now take a TypeContainer and a Parameters object.
27881
27882         (ParameterData): Modify return type of ParameterModifier method to be 
27883         Parameter.Modifier and not a string.
27884
27885         (ReflectionParameters, InternalParameters): Update accordingly.
27886
27887         * expression.cs (Argument::GetParameterModifier): Same here.
27888
27889         * support.cs (InternalParameters::ParameterType): Find a better way of determining
27890         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
27891         symbol in it at all so maybe this is only for now.
27892
27893 2001-10-30  Ravi Pratap  <ravi@ximian.com>
27894
27895         * support.cs (InternalParameters): Constructor now takes an extra argument 
27896         which is the actual Parameters class.
27897
27898         (ParameterDesc): Update to provide info on ref/out modifiers.
27899
27900         * class.cs (everywhere): Update call to InternalParameters to pass in
27901         the second argument too.
27902
27903         * support.cs (ParameterData): Add ParameterModifier, which is a method 
27904         to return the modifier info [ref/out etc]
27905
27906         (InternalParameters, ReflectionParameters): Implement the above.
27907
27908         * expression.cs (Argument::ParameterModifier): Similar function to return
27909         info about the argument's modifiers.
27910
27911         (Invocation::OverloadResolve): Update to take into account matching modifiers 
27912         too.
27913
27914         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
27915         a new SetFormalParameters object which we pass to InternalParameters.
27916
27917 2001-10-30  Ravi Pratap  <ravi@ximian.com>
27918
27919         * expression.cs (NewArray): Merge into the ArrayCreation class.
27920
27921 2001-10-29  Ravi Pratap  <ravi@ximian.com>
27922
27923         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
27924         NewUserdefinedArray into one as there wasn't much of a use in having
27925         two separate ones.
27926
27927         * expression.cs (Argument): Change field's name to ArgType from Type.
27928
27929         (Type): New readonly property which returns the proper type, taking into 
27930         account ref/out modifiers.
27931
27932         (everywhere): Adjust code accordingly for the above.
27933
27934         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
27935         whether we are emitting for a ref or out parameter.
27936
27937         * expression.cs (Argument::Emit): Use the above field to set the state.
27938
27939         (LocalVariableReference::Emit): Update to honour the flag and emit the
27940         right stuff.
27941
27942         * parameter.cs (Attributes): Set the correct flags for ref parameters.
27943
27944         * expression.cs (Argument::FullDesc): New function to provide a full desc.
27945
27946         * support.cs (ParameterData): Add method ParameterDesc to the interface.
27947
27948         (ReflectionParameters, InternalParameters): Implement the above method.
27949
27950         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27951         reporting errors.
27952
27953         (Invocation::FullMethodDesc): Ditto. 
27954
27955 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
27956
27957         * cs-parser.jay: Add extra production for the second form of array
27958         creation. 
27959
27960         * expression.cs (ArrayCreation): Update to reflect the above
27961         change. 
27962
27963         * Small changes to prepare for Array initialization.
27964
27965 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
27966
27967         * typemanager.cs (ImplementsInterface): interface might be null;
27968         Deal with this problem;
27969
27970         Also, we do store negative hits on the cache (null values), so use
27971         this instead of calling t.GetInterfaces on the type everytime.
27972
27973 2001-10-28  Ravi Pratap  <ravi@ximian.com>
27974
27975         * typemanager.cs (IsBuiltinType): New method to help determine the same.
27976
27977         * expression.cs (New::DoResolve): Get rid of array creation code and instead
27978         split functionality out into different classes.
27979
27980         (New::FormArrayType): Move into NewBuiltinArray.
27981
27982         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27983         quite useless.
27984
27985         (NewBuiltinArray): New class to handle creation of built-in arrays.
27986
27987         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27988         account creation of one-dimensional arrays.
27989
27990         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27991
27992         (NewUserdefinedArray::DoResolve): Implement.
27993
27994         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27995
27996         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27997         we maintain inside the TypeManager. This is necessary to perform lookups on the
27998         module builder.
27999
28000         (LookupType): Update to perform GetType on the module builders too.     
28001
28002         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28003
28004         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28005
28006 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28007
28008         * expression.cs (New::DoResolve): Implement guts of array creation.
28009
28010         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28011
28012 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28013
28014         * expression.cs: Fix bug I introduced lsat night that broke
28015         Delegates. 
28016
28017         (Expression.Resolve): Report a 246 error (can not resolve name)
28018         if we find a SimpleName in the stream.
28019
28020         (Expression.ResolveLValue): Ditto.
28021
28022         (Expression.ResolveWithSimpleName): This function is a variant of
28023         ResolveName, this one allows SimpleNames to be returned without a
28024         warning.  The only consumer of SimpleNames is MemberAccess
28025
28026 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28027
28028         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28029         might arrive here.  I have my doubts that this is correct.
28030
28031         * statement.cs (Lock): Implement lock statement.
28032
28033         * cs-parser.jay: Small fixes to support `lock' and `using'
28034
28035         * cs-tokenizer.cs: Remove extra space
28036
28037         * driver.cs: New flag --checked, allows to turn on integer math
28038         checking. 
28039
28040         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28041         Threading.Monitor.Exit 
28042
28043 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28044
28045         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28046         Expression Class to be IndexerAccess.
28047
28048         Notice that Indexer::DoResolve sets the eclass to Value.
28049
28050 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28051
28052         * class.cs (TypeContainer::Emit): Emit code for indexers.
28053
28054         * assign.cs (IAssignMethod): New interface implemented by Indexers
28055         and Properties for handling assignment.
28056
28057         (Assign::Emit): Simplify and reuse code. 
28058
28059         * expression.cs (IndexerAccess, PropertyExpr): Implement
28060         IAssignMethod, clean up old code. 
28061
28062 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28063
28064         * typemanager.cs (ImplementsInterface): New method to determine if a type
28065         implements a given interface. Provides a nice cache too.
28066
28067         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28068         method.
28069
28070         (ConvertReferenceExplicit): Ditto.
28071
28072         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28073         various methods, with correct names etc.
28074
28075         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28076         Operator.UnaryNegation.
28077
28078         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28079         we have a unary plus or minus operator.
28080
28081         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28082         UnaryMinus.
28083
28084         * everywhere : update accordingly.
28085
28086         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28087         respectively.
28088
28089         * class.cs (Method::Define): For the case where we are implementing a method
28090         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28091         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28092
28093 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28094
28095         * interface.cs (FindMembers): Implement to work around S.R.E
28096         lameness.
28097
28098         * typemanager.cs (IsInterfaceType): Implement.
28099
28100         (FindMembers): Update to handle interface types too.
28101
28102         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28103         use IsAssignableFrom as that is not correct - it doesn't work.
28104
28105         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28106         and accordingly override EmitStatement.
28107
28108         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28109         using the correct logic :-)
28110
28111 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28112
28113         * ../errors/cs-11.cs : Add to demonstrate error -11 
28114
28115 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28116
28117         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28118         then pass this as a hint to ResolveLValue.
28119
28120         * expression.cs (FieldExpr): Add Location information
28121
28122         (FieldExpr::LValueResolve): Report assignment to readonly
28123         variable. 
28124
28125         (Expression::ExprClassFromMemberInfo): Pass location information.
28126
28127         (Expression::ResolveLValue): Add new method that resolves an
28128         LValue. 
28129
28130         (Expression::DoResolveLValue): Default invocation calls
28131         DoResolve. 
28132
28133         (Indexers): New class used to keep track of indexers in a given
28134         Type. 
28135
28136         (IStackStore): Renamed from LValue, as it did not really describe
28137         what this did.  Also ResolveLValue is gone from this interface and
28138         now is part of Expression.
28139
28140         (ElementAccess): Depending on the element access type
28141
28142         * typemanager.cs: Add `indexer_name_type' as a Core type
28143         (System.Runtime.CompilerServices.IndexerNameAttribute)
28144
28145         * statement.cs (Goto): Take a location.
28146
28147 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28148
28149         * delegate.cs (Delegate::VerifyDelegate): New method to verify
28150         if two delegates are compatible.
28151
28152         (NewDelegate::DoResolve): Update to take care of the case when
28153         we instantiate a delegate from another delegate.
28154
28155         * typemanager.cs (FindMembers): Don't even try to look up members
28156         of Delegate types for now.
28157
28158 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28159
28160         * delegate.cs (NewDelegate): New class to take care of delegate
28161         instantiation.
28162
28163         * expression.cs (New): Split the delegate related code out into 
28164         the NewDelegate class.
28165
28166         * delegate.cs (DelegateInvocation): New class to handle delegate 
28167         invocation.
28168
28169         * expression.cs (Invocation): Split out delegate related code into
28170         the DelegateInvocation class.
28171
28172 2001-10-17  Ravi Pratap  <ravi@ximian.com>
28173
28174         * expression.cs (New::DoResolve): Implement delegate creation fully
28175         and according to the spec.
28176
28177         (New::DoEmit): Update to handle delegates differently.
28178
28179         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28180         because of which we were printing out arguments in reverse order !
28181
28182         * delegate.cs (VerifyMethod): Implement to check if the given method
28183         matches the delegate.
28184
28185         (FullDelegateDesc): Implement.
28186
28187         (VerifyApplicability): Implement.
28188
28189         * expression.cs (Invocation::DoResolve): Update to accordingly handle
28190         delegate invocations too.
28191
28192         (Invocation::Emit): Ditto.
28193
28194         * ../errors/cs1593.cs : Added.
28195
28196         * ../errors/cs1594.cs : Added.
28197
28198         * delegate.cs (InstanceExpression, TargetMethod): New properties.
28199
28200 2001-10-16  Ravi Pratap  <ravi@ximian.com>
28201
28202         * typemanager.cs (intptr_type): Core type for System.IntPtr
28203
28204         (InitCoreTypes): Update for the same.
28205
28206         (iasyncresult_type, asynccallback_type): Ditto.
28207
28208         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28209         correct.
28210
28211         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28212         too.
28213
28214         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28215         the builders for the 4 members of a delegate type :-)
28216
28217         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28218         type.
28219
28220         * expression.cs (New::DoResolve): Implement guts for delegate creation.
28221
28222         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28223
28224 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
28225
28226         * statement.cs (Break::Emit): Implement.   
28227         (Continue::Emit): Implement.
28228
28229         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28230         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28231         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28232         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
28233         end loop
28234
28235         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28236         properties that track the label for the current loop (begin of the
28237         loop and end of the loop).
28238
28239 2001-10-15  Ravi Pratap  <ravi@ximian.com>
28240
28241         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28242         use of emitting anything at all.
28243
28244         * class.cs, rootcontext.cs : Get rid of calls to the same.
28245
28246         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28247
28248         (Populate): Define the constructor correctly and set the implementation
28249         attributes.
28250
28251         * typemanager.cs (delegate_types): New hashtable to hold delegates that
28252         have been defined.
28253
28254         (AddDelegateType): Implement.
28255
28256         (IsDelegateType): Implement helper method.
28257
28258         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28259
28260         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28261         and accordingly handle it.
28262
28263         * delegate.cs (Populate): Take TypeContainer argument.
28264         Implement bits to define the Invoke method. However, I still haven't figured out
28265         how to take care of the native int bit :-(
28266
28267         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
28268         Qualify the name of the delegate, not its return type !
28269
28270         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28271         conversion.
28272
28273         (StandardConversionExists): Checking for array types turns out to be recursive.
28274
28275         (ConvertReferenceExplicit): Implement array conversion.
28276
28277         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28278
28279 2001-10-12  Ravi Pratap  <ravi@ximian.com>
28280
28281         * cs-parser.jay (delegate_declaration): Store the fully qualified
28282         name as it is a type declaration.
28283
28284         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
28285         readonly.
28286
28287         (DefineDelegate): Renamed from Define. Does the same thing essentially,
28288         as TypeContainer::DefineType.
28289
28290         (Populate): Method in which all the definition of the various methods (Invoke)
28291         etc is done.
28292
28293         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28294         see.
28295
28296         (CloseDelegate): Finally creates the delegate.
28297
28298         * class.cs (TypeContainer::DefineType): Update to define delegates.
28299         (Populate, Emit and CloseType): Do the same thing here too.
28300
28301         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28302         delegates in all these operations.
28303
28304 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
28305
28306         * expression.cs: LocalTemporary: a new expression used to
28307         reference a temporary that has been created.
28308
28309         * assign.cs: Handle PropertyAccess back here, so that we can
28310         provide the proper semantic access to properties.
28311
28312         * expression.cs (Expression::ConvertReferenceExplicit): Implement
28313         a few more explicit conversions. 
28314
28315         * modifiers.cs: `NEW' modifier maps to HideBySig.
28316
28317         * expression.cs (PropertyExpr): Make this into an
28318         ExpressionStatement, and support the EmitStatement code path. 
28319
28320         Perform get/set error checking, clean up the interface.
28321
28322         * assign.cs: recognize PropertyExprs as targets, and if so, turn
28323         them into toplevel access objects.
28324
28325 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
28326
28327         * expression.cs: PropertyExpr::PropertyExpr: use work around the
28328         SRE.
28329
28330         * typemanager.cs: Keep track here of our PropertyBuilders again to
28331         work around lameness in SRE.
28332
28333 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
28334
28335         * expression.cs (LValue::LValueResolve): New method in the
28336         interface, used to perform a second resolution pass for LValues. 
28337
28338         (This::DoResolve): Catch the use of this in static methods.
28339
28340         (This::LValueResolve): Implement.
28341
28342         (This::Store): Remove warning, assigning to `this' in structures
28343         is 
28344
28345         (Invocation::Emit): Deal with invocation of
28346         methods on value types.  We need to pass the address to structure
28347         methods rather than the object itself.  (The equivalent code to
28348         emit "this" for structures leaves the entire structure on the
28349         stack instead of a pointer to it). 
28350
28351         (ParameterReference::DoResolve): Compute the real index for the
28352         argument based on whether the method takes or not a `this' pointer
28353         (ie, the method is static).
28354
28355         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28356         value types returned from functions when we need to invoke a
28357         method on the sturcture.
28358
28359
28360 2001-10-11  Ravi Pratap  <ravi@ximian.com>
28361
28362         * class.cs (TypeContainer::DefineType): Method to actually do the business of
28363         defining the type in the Modulebuilder or Typebuilder. This is to take
28364         care of nested types which need to be defined on the TypeBuilder using
28365         DefineNestedMethod.
28366
28367         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
28368         methods in RootContext, only ported to be part of TypeContainer.
28369
28370         (TypeContainer::GetInterfaceOrClass): Ditto.
28371
28372         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28373
28374         * interface.cs (Interface::DefineInterface): New method. Does exactly
28375         what RootContext.CreateInterface did earlier, only it takes care of nested types 
28376         too.
28377
28378         (Interface::GetInterfaces): Move from RootContext here and port.
28379
28380         (Interface::GetInterfaceByName): Same here.
28381
28382         * rootcontext.cs (ResolveTree): Re-write.
28383
28384         (PopulateTypes): Re-write.
28385
28386         * class.cs (TypeContainer::Populate): Populate nested types too.
28387         (TypeContainer::Emit): Emit nested members too.
28388
28389         * typemanager.cs (AddUserType): Do not make use of the FullName property,
28390         instead just use the name argument passed in as it is already fully
28391         qualified.
28392
28393         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28394         to TypeContainer mapping to see if a type is user-defined.
28395
28396         * class.cs (TypeContainer::CloseType): Implement. 
28397
28398         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28399         the default constructor.
28400
28401         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28402         twice.
28403
28404         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28405
28406         * interface.cs (CloseType): Create the type here.
28407
28408         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28409         the hierarchy.
28410
28411         Remove all the methods which are now in TypeContainer.
28412
28413 2001-10-10  Ravi Pratap  <ravi@ximian.com>
28414
28415         * delegate.cs (Define): Re-write bits to define the delegate
28416         correctly.
28417
28418 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
28419
28420         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28421
28422         * expression.cs (ImplicitReferenceConversion): handle null as well
28423         as a source to convert to any reference type.
28424
28425         * statement.cs (Return): Perform any implicit conversions to
28426         expected return type.  
28427
28428         Validate use of return statement.  
28429
28430         * codegen.cs (EmitContext): Pass the expected return type here.
28431
28432         * class.cs (Method, Constructor, Property): Pass expected return
28433         type to EmitContext.
28434
28435 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
28436
28437         * expression.cs: Make DoResolve take an EmitContext instead of a
28438         TypeContainer.
28439
28440         Replaced `l' and `location' for `loc', for consistency.
28441
28442         (Error, Warning): Remove unneeded Tc argument.
28443
28444         * assign.cs, literal.cs, constant.cs: Update to new calling
28445         convention. 
28446
28447         * codegen.cs: EmitContext now contains a flag indicating whether
28448         code is being generated in a static method or not.
28449
28450         * cs-parser.jay: DecomposeQI, new function that replaces the old
28451         QualifiedIdentifier.  Now we always decompose the assembled
28452         strings from qualified_identifier productions into a group of
28453         memberaccesses.
28454
28455 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
28456
28457         * rootcontext.cs: Deal with field-less struct types correctly now
28458         by passing the size option to Define Type.
28459
28460         * class.cs: Removed hack that created one static field. 
28461
28462 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28463
28464         * statement.cs: Moved most of the code generation here. 
28465
28466 2001-10-09  Ravi Pratap  <ravi@ximian.com>
28467
28468         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28469         seem very right.
28470
28471         (ElementAccess): Remove useless bits for now - keep checks as the spec
28472         says.
28473
28474 2001-10-08  Ravi Pratap  <ravi@ximian.com>
28475
28476         * expression.cs (ElementAccess::DoResolve): Remove my crap code
28477         and start performing checks according to the spec.
28478
28479 2001-10-07  Ravi Pratap  <ravi@ximian.com>
28480
28481         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28482         rank_specifiers instead.
28483
28484         (rank_specifiers): Change the order in which the rank specifiers are stored
28485
28486         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
28487
28488         * expression.cs (ElementAccess): Implement the LValue interface too.
28489
28490 2001-10-06  Ravi Pratap  <ravi@ximian.com>
28491
28492         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
28493         except that user defined conversions are not included.
28494
28495         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
28496         perform the conversion of the return type, if necessary.
28497
28498         (New::DoResolve): Check whether we are creating an array or an object
28499         and accordingly do the needful.
28500
28501         (New::Emit): Same here.
28502
28503         (New::DoResolve): Implement guts of array creation.
28504
28505         (New::FormLookupType): Helper function.
28506
28507 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28508
28509         * codegen.cs: Removed most of the code generation here, and move the
28510         corresponding code generation bits to the statement classes. 
28511
28512         Added support for try/catch/finalize and throw.
28513
28514         * cs-parser.jay: Added support for try/catch/finalize.
28515
28516         * class.cs: Catch static methods having the flags override,
28517         virtual or abstract.
28518
28519         * expression.cs (UserCast): This user cast was not really doing
28520         what it was supposed to do.  Which is to be born in fully resolved
28521         state.  Parts of the resolution were being performed at Emit time! 
28522
28523         Fixed this code.
28524
28525 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
28526
28527         * expression.cs: Implicity convert the result from UserCast.
28528
28529 2001-10-05  Ravi Pratap  <ravi@ximian.com>
28530
28531         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
28532         prevented it from working correctly. 
28533
28534         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
28535         merely ConvertImplicit.
28536
28537 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
28538
28539         * typemanager.cs: Make the LookupTypeContainer function static,
28540         and not per-instance.  
28541
28542         * class.cs: Make static FindMembers (the one that takes a Type
28543         argument). 
28544
28545         * codegen.cs: Add EmitForeach here.
28546
28547         * cs-parser.jay: Make foreach a toplevel object instead of the
28548         inline expansion, as we need to perform semantic analysis on it. 
28549
28550 2001-10-05  Ravi Pratap  <ravi@ximian.com>
28551
28552         * expression.cs (Expression::ImplicitUserConversion): Rename to
28553         UserDefinedConversion.
28554
28555         (Expression::UserDefinedConversion): Take an extra argument specifying 
28556         whether we look for explicit user conversions too.
28557
28558         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
28559
28560         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
28561
28562         (ExplicitUserConversion): Make it a call to UserDefinedConversion
28563         with the appropriate arguments.
28564
28565         * cs-parser.jay (cast_expression): Record location too.
28566
28567         * expression.cs (Cast): Record location info.
28568
28569         (Expression::ConvertExplicit): Take location argument.
28570
28571         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
28572         to determine if we are doing explicit conversions.
28573
28574         (UserCast::Emit): Update accordingly.
28575
28576         (Expression::ConvertExplicit): Report an error if everything fails.
28577
28578         * ../errors/cs0030.cs : Add.
28579
28580 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
28581
28582         * modifiers.cs: If the ABSTRACT keyword is present, also set the
28583         virtual and newslot bits. 
28584
28585         * class.cs (TypeContainer::RegisterRequiredImplementations):
28586         Record methods we need.
28587
28588         (TypeContainer::MakeKey): Helper function to make keys for
28589         MethodBases, since the Methodbase key is useless.
28590
28591         (TypeContainer::Populate): Call RegisterRequiredImplementations
28592         before defining the methods.   
28593
28594         Create a mapping for method_builders_to_methods ahead of time
28595         instead of inside a tight loop.
28596
28597         (::RequireMethods):  Accept an object as the data to set into the
28598         hashtable so we can report interface vs abstract method mismatch.
28599
28600 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
28601
28602         * report.cs: Make all of it static.
28603
28604         * rootcontext.cs: Drop object_type and value_type computations, as
28605         we have those in the TypeManager anyways.
28606
28607         Drop report instance variable too, now it is a global.
28608
28609         * driver.cs: Use try/catch on command line handling.
28610
28611         Add --probe option to debug the error reporting system with a test
28612         suite. 
28613
28614         * report.cs: Add support for exiting program when a probe
28615         condition is reached.
28616
28617 2001-10-03  Ravi Pratap  <ravi@ximian.com>
28618
28619         * expression.cs (Binary::DoNumericPromotions): Fix the case when
28620         we do a forcible conversion regardless of type, to check if 
28621         ForceConversion returns a null.
28622
28623         (Binary::error19): Use location to report error.
28624
28625         (Unary::error23): Use location here too.
28626
28627         * ../errors/cs0019.cs : Check in.
28628
28629         * ../errors/cs0023.cs : Check in.
28630
28631         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
28632         case of a non-null MethodInfo object with a length of 0 !
28633
28634         (Binary::ResolveOperator): Flag error if overload resolution fails to find
28635         an applicable member - according to the spec :-)
28636         Also fix logic to find members in base types.
28637
28638         (Unary::ResolveOperator): Same here.
28639
28640         (Unary::report23): Change name to error23 and make first argument a TypeContainer
28641         as I was getting thoroughly confused between this and error19 :-)
28642
28643         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
28644         (::FindMostEncompassedType): Implement.
28645         (::FindMostEncompassingType): Implement.
28646         (::StandardConversionExists): Implement.
28647
28648         (UserImplicitCast): Re-vamp. We now need info about most specific
28649         source and target types so that we can do the necessary conversions.
28650
28651         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
28652         mathematical union with no duplicates.
28653
28654 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
28655
28656         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
28657         in order from base classes to child classes, so that we can in
28658         child classes look up in our parent for method names and
28659         attributes (required for handling abstract, virtual, new, override
28660         constructs: we need to instrospect our base class, and if we dont
28661         populate the classes in order, the introspection might be
28662         incorrect.  For example, a method could query its parent before
28663         the parent has any methods and would determine that the parent has
28664         no abstract methods (while it could have had them)).
28665
28666         (RootContext::CreateType): Record the order in which we define the
28667         classes.
28668
28669 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
28670
28671         * class.cs (TypeContainer::Populate): Also method definitions can
28672         fail now, keep track of this.
28673
28674         (TypeContainer::FindMembers): Implement support for
28675         DeclaredOnly/noDeclaredOnly flag.
28676
28677         (Constructor::Emit) Return the ConstructorBuilder.
28678
28679         (Method::Emit) Return the MethodBuilder. 
28680         Check for abstract or virtual methods to be public.
28681
28682         * rootcontext.cs (RootContext::CreateType): Register all the
28683         abstract methods required for the class to be complete and the
28684         interface methods that must be implemented. 
28685
28686         * cs-parser.jay: Report error 501 (method requires body if it is
28687         not marked abstract or extern).
28688
28689         * expression.cs (TypeOf::Emit): Implement.
28690
28691         * typemanager.cs: runtime_handle_type, new global type.
28692
28693         * class.cs (Property::Emit): Generate code for properties.
28694
28695 2001-10-02  Ravi Pratap  <ravi@ximian.com>
28696
28697         * expression.cs (Unary::ResolveOperator): Find operators on base type
28698         too - we now conform exactly to the spec.
28699
28700         (Binary::ResolveOperator): Same here.
28701
28702         * class.cs (Operator::Define): Fix minor quirk in the tests.
28703
28704         * ../errors/cs0215.cs : Added.
28705
28706         * ../errors/cs0556.cs : Added.
28707
28708         * ../errors/cs0555.cs : Added.
28709
28710 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
28711
28712         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
28713         single integer which is really efficient
28714
28715 2001-10-01  Ravi Pratap  <ravi@ximian.com>
28716
28717         *  expression.cs (Expression::ImplicitUserConversion): Use location
28718         even in the case when we are examining True operators.
28719  
28720         * class.cs (Operator::Define): Perform extensive checks to conform
28721         with the rules for operator overloading in the spec.
28722
28723         * expression.cs (Expression::ImplicitReferenceConversion): Implement
28724         some of the other conversions mentioned in the spec.
28725
28726         * typemanager.cs (array_type): New static member for the System.Array built-in
28727         type.
28728
28729         (cloneable_interface): For System.ICloneable interface.
28730
28731         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
28732         we start resolving the tree and populating types.
28733
28734         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
28735  
28736 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
28737
28738         * expression.cs (Expression::ExprClassFromMemberInfo,
28739         Expression::Literalize): Create literal expressions from
28740         FieldInfos which are literals.
28741
28742         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
28743         type casts, because they were wrong.  The test suite in tests
28744         caught these ones.
28745
28746         (ImplicitNumericConversion): ushort to ulong requires a widening
28747         cast. 
28748
28749         Int32 constant to long requires widening cast as well.
28750
28751         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
28752         for integers because the type on the stack is not i4.
28753
28754 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
28755
28756         * expression.cs (report118): require location argument. 
28757
28758         * parameter.cs: Do not dereference potential null value.
28759
28760         * class.cs: Catch methods that lack the `new' keyword when
28761         overriding a name.  Report warnings when `new' is used without
28762         anything being there to override.
28763
28764         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
28765
28766         * class.cs: Only add constructor to hashtable if it is non-null
28767         (as now constructors can fail on define).
28768
28769         (TypeManager, Class, Struct): Take location arguments.
28770
28771         Catch field instance initialization in structs as errors.
28772
28773         accepting_filter: a new filter for FindMembers that is static so
28774         that we dont create an instance per invocation.
28775
28776         (Constructor::Define): Catch errors where a struct constructor is
28777         parameterless 
28778
28779         * cs-parser.jay: Pass location information for various new
28780         constructs. 
28781
28782         * delegate.cs (Delegate): take a location argument.
28783
28784         * driver.cs: Do not call EmitCode if there were problesm in the
28785         Definition of the types, as many Builders wont be there. 
28786
28787         * decl.cs (Decl::Decl): Require a location argument.
28788
28789         * cs-tokenizer.cs: Handle properly hex constants that can not fit
28790         into integers, and find the most appropiate integer for it.
28791
28792         * literal.cs: Implement ULongLiteral.
28793
28794         * rootcontext.cs: Provide better information about the location of
28795         failure when CreateType fails.
28796
28797 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
28798
28799         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
28800         as well.
28801
28802         * expression.cs (Binary::CheckShiftArguments): Add missing type
28803         computation.
28804         (Binary::ResolveOperator): Add type to the logical and and logical
28805         or, Bitwise And/Or and Exclusive Or code paths, it was missing
28806         before.
28807
28808         (Binary::DoNumericPromotions): In the case where either argument
28809         is ulong (and most signed types combined with ulong cause an
28810         error) perform implicit integer constant conversions as well.
28811
28812 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
28813
28814         * expression.cs (UserImplicitCast): Method should always be
28815         non-null. 
28816         (Invocation::BetterConversion): Simplified test for IntLiteral.
28817
28818         (Expression::ImplicitNumericConversion): Split this routine out.
28819         Put the code that performs implicit constant integer conversions
28820         here. 
28821
28822         (Expression::Resolve): Become a wrapper around DoResolve so we can
28823         check eclass and type being set after resolve.
28824
28825         (Invocation::Badness): Remove this dead function
28826
28827         (Binary::ResolveOperator): Do not compute the expensive argumnets
28828         unless we have a union for it.
28829
28830         (Probe::Emit): Is needs to do an isinst and then
28831         compare against null.
28832
28833         (::CanConvert): Added Location argument.  If the Location argument
28834         is null (Location.Null), then we do not report errors.  This is
28835         used by the `probe' mechanism of the Explicit conversion.  We do
28836         not want to generate an error for something that the user
28837         explicitly requested to be casted.  But the pipeline for an
28838         explicit cast first tests for potential implicit casts.
28839
28840         So for now, if the Location is null, it means `Probe only' to
28841         avoid adding another argument.   Might have to revise this
28842         strategy later.
28843
28844         (ClassCast): New class used to type cast objects into arbitrary
28845         classes (used in Explicit Reference Conversions).
28846
28847         Implement `as' as well.
28848
28849         Reverted all the patches from Ravi below: they were broken:
28850
28851                 * The use of `level' as a mechanism to stop recursive
28852                   invocations is wrong.  That was there just to catch the
28853                   bug with a strack trace but not as a way of addressing
28854                   the problem.
28855
28856                   To fix the problem we have to *understand* what is going
28857                   on and the interactions and come up with a plan, not
28858                   just get things going.
28859
28860                 * The use of the type conversion cache that I proposed
28861                   last night had an open topic: How does this work across
28862                   protection domains.  A user defined conversion might not
28863                   be public in the location where we are applying the
28864                   conversion, a different conversion might be selected
28865                   (ie, private A->B (better) but public B->A (worse),
28866                   inside A, A->B applies, but outside it, B->A will
28867                   apply).
28868
28869                 * On top of that (ie, even if the above is solved),
28870                   conversions in a cache need to be abstract.  Ie, `To
28871                   convert from an Int to a Short use an OpcodeCast', not
28872                   `To convert from an Int to a Short use the OpcodeCast on
28873                   the variable 5' (which is what this patch was doing).
28874
28875 2001-09-28  Ravi Pratap  <ravi@ximian.com>
28876
28877         * expression.cs (Invocation::ConversionExists): Re-write to use
28878         the conversion cache
28879
28880         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
28881         cache all conversions done, not just user-defined ones.
28882
28883         (Invocation::BetterConversion): The real culprit. Use ConversionExists
28884         to determine if a conversion exists instead of acutually trying to 
28885         perform the conversion. It's faster too.
28886
28887         (Expression::ConvertExplicit): Modify to use ConversionExists to check
28888         and only then attempt the implicit conversion.
28889
28890 2001-09-28  Ravi Pratap  <ravi@ximian.com>
28891
28892         * expression.cs (ConvertImplicit): Use a cache for conversions
28893         already found. Check level of recursion and bail out if necessary.
28894
28895 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
28896
28897         * typemanager.cs (string_concat_string_string, string_concat_object_object):
28898         Export standard methods that we expect for string operations.
28899
28900         * statement.cs (Block::UsageWarning): Track usage of variables and
28901         report the errors for not used variables.
28902
28903         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
28904         operator. 
28905
28906 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
28907
28908         * codegen.cs: remove unnneded code 
28909
28910         * expression.cs: Removed BuiltinTypeAccess class
28911
28912         Fix the order in which implicit conversions are
28913         done.  
28914
28915         The previous fixed dropped support for boxed conversions (adding a
28916         test to the test suite now)
28917
28918         (UserImplicitCast::CanConvert): Remove test for source being null,
28919         that code is broken.  We should not feed a null to begin with, if
28920         we do, then we should track the bug where the problem originates
28921         and not try to cover it up here.
28922
28923         Return a resolved expression of type UserImplicitCast on success
28924         rather than true/false.  Ravi: this is what I was talking about,
28925         the pattern is to use a static method as a "constructor" for
28926         objects. 
28927
28928         Also, do not create arguments until the very last minute,
28929         otherwise we always create the arguments even for lookups that
28930         will never be performed. 
28931
28932         (UserImplicitCast::Resolve): Eliminate, objects of type
28933         UserImplicitCast are born in a fully resolved state. 
28934
28935         * typemanager.cs (InitCoreTypes): Init also value_type
28936         (System.ValueType). 
28937
28938         * expression.cs (Cast::Resolve): First resolve the child expression.
28939
28940         (LValue): Add new method AddressOf to be used by
28941         the `&' operator.  
28942
28943         Change the argument of Store to take an EmitContext instead of an
28944         ILGenerator, because things like FieldExpr need to be able to call
28945         their children expression to generate the instance code. 
28946
28947         (Expression::Error, Expression::Warning): Sugar functions for
28948         reporting errors.
28949
28950         (Expression::MemberLookup): Accept a TypeContainer instead of a
28951         Report as the first argument.
28952
28953         (Expression::ResolvePrimary): Killed.  I still want to improve
28954         this as currently the code is just not right.
28955
28956         (Expression::ResolveMemberAccess): Simplify, but it is still
28957         wrong. 
28958
28959         (Unary::Resolve): Catch errors in AddressOf operators.
28960
28961         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28962         index to a byte for the short-version, or the compiler will choose
28963         the wrong Emit call, which generates the wrong data.
28964
28965         (ParameterReference::Emit, ::Store): same.
28966
28967         (FieldExpr::AddressOf): Implement.
28968
28969         * typemanager.cs: TypeManager: made public variable instead of
28970         property.
28971
28972         * driver.cs: document --fatal.
28973
28974         * report.cs (ErrorMessage, WarningMessage): new names for the old
28975         Error and Warning classes.
28976
28977         * cs-parser.jay (member_access): Turn built-in access to types
28978         into a normal simplename
28979
28980 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28981
28982         * expression.cs (Invocation::BetterConversion): Fix to cope
28983         with q being null, since this was introducing a bug.
28984
28985         * expression.cs (ConvertImplicit): Do built-in conversions first.
28986
28987 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28988
28989         * expression.cs (UserImplicitCast::Resolve): Fix bug.
28990
28991 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28992
28993         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28994         I had introduced long ago (what's new ?).
28995
28996         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
28997         the work of all the checking. 
28998         (ConvertImplicit): Call CanConvert and only then create object if necessary.
28999         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29000
29001         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29002         that is the right way. 
29003
29004         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29005         overloading resolution. Use everywhere instead of cutting and pasting code.
29006
29007         (Binary::ResolveOperator): Use MakeUnionSet.
29008
29009         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29010         we have to convert to bool types. Not complete yet.
29011
29012 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29013
29014         * typemanager.cs (TypeManager::CSharpName): support ushort.
29015
29016         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29017         to provide an expression that performsn an implicit constant int
29018         conversion (section 6.1.6).
29019         (Expression::ConvertImplicitRequired): Reworked to include
29020         implicit constant expression conversions.
29021
29022         (Expression::ConvertNumericExplicit): Finished.
29023
29024         (Invocation::Emit): If InstanceExpression is null, then it means
29025         that we perform a call on this.
29026
29027 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29028
29029         * expression.cs (Unary::Emit): Remove some dead code.
29030         (Probe): Implement Resolve and Emit for `is'.
29031         (Expression::ConvertImplicitRequired): Attempt to do constant
29032         expression conversions here.  Maybe should be moved to
29033         ConvertImplicit, but I am not sure.
29034         (Expression::ImplicitLongConstantConversionPossible,
29035         Expression::ImplicitIntConstantConversionPossible): New functions
29036         that tell whether is it possible to apply an implicit constant
29037         expression conversion.
29038
29039         (ConvertNumericExplicit): Started work on explicit numeric
29040         conversions.
29041
29042         * cs-parser.jay: Update operator constants.
29043
29044         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29045         (Parameters::GetSignature): Hook up VerifyArgs here.
29046         (Parameters::VerifyArgs): Verifies that no two arguments have the
29047         same name. 
29048
29049         * class.cs (Operator): Update the operator names to reflect the
29050         ones that the spec expects (as we are just stringizing the
29051         operator names).
29052
29053         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29054         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29055         previous usage did only work for our methods.
29056         (Expression::ConvertImplicit): Handle decimal implicit numeric
29057         conversions as well.
29058         (Expression::InternalTypeConstructor): Used to invoke constructors
29059         on internal types for default promotions.
29060
29061         (Unary::Emit): Implement special handling for the pre/post
29062         increment/decrement for overloaded operators, as they need to have
29063         the same semantics as the other operators.
29064
29065         (Binary::ResolveOperator): ditto.
29066         (Invocation::ConversionExists): ditto.
29067         (UserImplicitCast::Resolve): ditto.
29068
29069 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29070
29071         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29072         operator, return after emitting body. Regression tests pass again !
29073
29074         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29075         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29076         (Invocation::OverloadResolve): Ditto.
29077         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29078
29079         * everywhere : update calls to the above methods accordingly.
29080
29081 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29082
29083         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29084
29085         * expression.cs (ExpressionStatement): New base class used for
29086         expressions that can appear in statements, so that we can provide
29087         an alternate path to generate expression that do not leave a value
29088         on the stack.
29089
29090         (Expression::Emit, and all the derivatives): We no longer return
29091         whether a value is left on the stack or not.  Every expression
29092         after being emitted leaves a single value on the stack.
29093
29094         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29095         facilties of ExpressionStatement if possible.
29096
29097         * cs-parser.jay: Update statement_expression.
29098
29099 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29100
29101         * driver.cs: Change the wording of message
29102
29103 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29104
29105         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29106         the type of the expression to the return type of the method if
29107         we have an overloaded operator match ! The regression tests pass again !
29108         (Unary::ResolveOperator): Ditto.
29109
29110         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29111         to find "op_Implicit", not "implicit" ;-)
29112         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29113         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29114
29115         * everywhere : Correct calls to the above accordingly.
29116
29117         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29118         (ConvertImplicit): Do user-defined conversion if it exists.
29119
29120 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29121
29122         * assign.cs: track location.
29123         (Resolve): Use implicit conversions on assignment.
29124
29125         * literal.cs: Oops.  Not good, Emit of short access values should
29126         pass (Bytes) or the wrong argument will be selected.
29127
29128         * expression.cs (Unary::Emit): Emit code for -expr.
29129
29130         (Unary::ResolveOperator): Handle `Substract' for non-constants
29131         (substract from zero from the non-constants).
29132         Deal with Doubles as well. 
29133
29134         (Expression::ConvertImplicitRequired): New routine that reports an
29135         error if no implicit conversion exists. 
29136
29137         (Invocation::OverloadResolve): Store the converted implicit
29138         expressions if we make them
29139
29140 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29141
29142         * class.cs (ConstructorInitializer): Take a Location argument.
29143         (ConstructorBaseInitializer): Same here.
29144         (ConstructorThisInitializer): Same here.
29145
29146         * cs-parser.jay : Update all calls accordingly.
29147
29148         * expression.cs (Unary, Binary, New): Take location argument.
29149         Update accordingly everywhere.
29150
29151         * cs-parser.jay : Update all calls to the above to take a location
29152         argument.
29153
29154         * class.cs : Ditto.
29155
29156 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29157
29158         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29159         (Invocation::BetterConversion): Same here
29160         (Invocation::ConversionExists): Ditto.
29161
29162         (Invocation::ConversionExists): Implement.
29163
29164 2001-09-22  Ravi Pratap  <ravi@ximian.com>
29165
29166         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29167         Also take an additional TypeContainer argument.
29168
29169         * All over : Pass in TypeContainer as argument to OverloadResolve.
29170
29171         * typemanager.cs (CSharpName): Update to check for the string type and return
29172         that too.
29173
29174         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29175         a given method.
29176
29177 2001-09-21  Ravi Pratap  <ravi@ximian.com>
29178
29179         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29180         (Invocation::BetterFunction): Implement.
29181         (Invocation::BetterConversion): Implement.
29182         (Invocation::ConversionExists): Skeleton, no implementation yet.
29183
29184         Okay, things work fine !
29185
29186 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
29187
29188         * typemanager.cs: declare and load enum_type, delegate_type and
29189         void_type. 
29190
29191         * expression.cs (Expression::Emit): Now emit returns a value that
29192         tells whether a value is left on the stack or not.  This strategy
29193         might be reveted tomorrow with a mechanism that would address
29194         multiple assignments.
29195         (Expression::report118): Utility routine to report mismatches on
29196         the ExprClass.
29197
29198         (Unary::Report23): Report impossible type/operator combination
29199         utility function.
29200
29201         (Unary::IsIncrementableNumber): Whether the type can be
29202         incremented or decremented with add.
29203         (Unary::ResolveOperator): Also allow enumerations to be bitwise
29204         complemented. 
29205         (Unary::ResolveOperator): Implement ++, !, ~,
29206
29207         (Invocation::Emit): Deal with new Emit convetion.
29208
29209         * All Expression derivatives: Updated their Emit method to return
29210         whether they leave values on the stack or not.
29211
29212         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29213         stack for expressions that are statements. 
29214
29215 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29216
29217         * expression.cs (LValue): New interface.  Must be implemented by
29218         LValue objects.
29219         (LocalVariableReference, ParameterReference, FieldExpr): Implement
29220         LValue interface.
29221
29222         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29223         interface for generating code, simplifies the code.
29224
29225 2001-09-20  Ravi Pratap  <ravi@ximian.com>
29226
29227         * expression.cs (everywhere): Comment out return statements in ::Resolve
29228         methods to avoid the warnings.
29229
29230 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29231
29232         * driver.cs (parse): Report error 2001 if we can not open the
29233         source file.
29234
29235         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29236         not resolve it.
29237
29238         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29239         object. 
29240
29241         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29242         otherwise nested blocks end up with the same index.
29243
29244         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29245
29246         * expression.cs:  Instead of having FIXMEs in the Resolve
29247         functions, throw exceptions so it is obvious that we are facing a
29248         bug. 
29249
29250         * cs-parser.jay (invocation_expression): Pass Location information.
29251
29252         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29253         Use a basename for those routines because .NET does not like paths
29254         on them. 
29255
29256         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29257         already defined.
29258
29259 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
29260
29261         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29262         are loading the correct data types (throws an exception if not).
29263         (TypeManager::InitCoreTypes): Use CoreLookupType
29264
29265         * expression.cs (Unary::ResolveOperator): return the child
29266         expression for expressions which are just +expr.
29267         (Unary::ResolveOperator): Return negative literals for -LITERAL
29268         expressions (otherwise they are Unary {Literal}).
29269         (Invocation::Badness): Take into account `Implicit constant
29270         expression conversions'.
29271
29272         * literal.cs (LongLiteral): Implement long literal class.
29273         (IntLiteral): export the `Value' of the intliteral. 
29274
29275 2001-09-19  Ravi Pratap  <ravi@ximian.com>
29276
29277         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29278
29279         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
29280         instead of 'Operator'
29281
29282         * expression.cs (Binary::ResolveOperator): Update accordingly.
29283         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29284         and 'Minus'
29285
29286         * cs-parser.jay (unary_expression): Update to use the new names.
29287
29288         * gen-treedump.cs (GetUnary): Same here.
29289
29290         * expression.cs (Unary::Resolve): Implement.
29291         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
29292         operators are found instead of making noise ;-)
29293         (Unary::ResolveOperator): New method to do precisely the same thing which
29294         Binary::ResolveOperator does for Binary expressions.
29295         (Unary.method, .Arguments): Add.
29296         (Unary::OperName): Implement.   
29297         (Unary::ForceConversion): Copy and Paste !
29298
29299         * class.cs (Operator::Define): Fix a small bug for the case when we have 
29300         a unary operator.
29301
29302         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29303         for the inbuilt operators. Only overloading works for now ;-)
29304
29305 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
29306
29307         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29308         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29309
29310         * expression.cs (This::Emit): Implement. 
29311         (This::Resolve): Implement.
29312         (TypeOf:Resolve): Implement.
29313         (Expression::ResolveSimpleName): Add an implicit this to instance
29314         field references. 
29315         (MemberAccess::Resolve): Deal with Parameters and Fields. 
29316         Bind instance variable to Field expressions.
29317         (FieldExpr::Instance): New field used to track the expression that
29318         represents the object instance.
29319         (FieldExpr::Resolve): Track potential errors from MemberLookup not
29320         binding 
29321         (FieldExpr::Emit): Implement.
29322
29323         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29324         the last instruction contains a return opcode to avoid generating
29325         the last `ret' instruction (this generates correct code, and it is
29326         nice to pass the peverify output).
29327
29328         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29329         initializer for static and instance variables.
29330         (Constructor::Emit): Allow initializer to be null in the case of
29331         static constructors.  Only emit initializer for instance
29332         constructors. 
29333
29334         (TypeContainer::FindMembers): Return a null array if there are no
29335         matches.
29336
29337         Also fix the code for the MemberTypes.Method branch, as it was not
29338         scanning that for operators (or tried to access null variables before).
29339
29340         * assign.cs (Assign::Emit): Handle instance and static fields. 
29341
29342         * TODO: Updated.
29343
29344         * driver.cs: Stop compilation if there are parse errors.
29345
29346         * cs-parser.jay (constructor_declaration): Provide default base
29347         initializer for non-static constructors.
29348         (constructor_declarator): Do not provide a default base
29349         initializers if none was specified.
29350         Catch the fact that constructors should not have parameters.
29351
29352         * class.cs: Do not emit parent class initializers for static
29353         constructors, that should be flagged as an error.
29354
29355 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29356
29357         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29358         Move back code into TypeContainer::Populate.
29359
29360 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29361
29362         * class.cs (TypeContainer::AddConstructor): Fix the check to
29363         compare against Name, not Basename. 
29364         (Operator::OpType): Change Plus and Minus to Add and Subtract.
29365
29366         * cs-parser.jay : Update accordingly.
29367
29368         * class.cs (TypeContainer::FindMembers): For the case where we are searching
29369         for methods, don't forget to look into the operators too.
29370         (RegisterMethodBuilder): Helper method to take care of this for
29371         methods, constructors and operators.
29372         (Operator::Define): Completely revamp.
29373         (Operator.OperatorMethod, MethodName): New fields.
29374         (TypeContainer::Populate): Move the registering of builders into
29375         RegisterMethodBuilder.
29376         (Operator::Emit): Re-write.
29377
29378         * expression.cs (Binary::Emit): Comment out code path to emit method
29379         invocation stuff for the case when we have a user defined operator. I am
29380         just not able to get it right !
29381
29382 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29383
29384         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29385         argument. 
29386
29387         (Expression::MemberLookup): Provide a version that allows to
29388         specify the MemberTypes and BindingFlags. 
29389
29390         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29391         so it was not fetching variable information from outer blocks.
29392
29393         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29394         Beforefieldinit as it was buggy.
29395
29396         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29397         that Ravi put here.  
29398
29399         * class.cs (Constructor::Emit): Only emit if block is not null.
29400         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29401         deal with this by semantically definining it as if the user had
29402         done it.
29403
29404         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29405         constructors as we now "emit" them at a higher level.
29406
29407         (TypeContainer::DefineDefaultConstructor): Used to define the
29408         default constructors if none was provided.
29409
29410         (ConstructorInitializer): Add methods Resolve and Emit. 
29411
29412         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29413
29414 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29415
29416         * class.cs (TypeContainer::EmitDefaultConstructor): Register
29417         the default constructor builder with our hashtable for methodbuilders
29418         to methodcores.
29419
29420         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29421         and argument_count is 0 in which case we have a match.
29422         (Binary::ResolveOperator): More null checking and miscellaneous coding
29423         style cleanup.
29424
29425 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29426
29427         * rootcontext.cs (IsNameSpace): Compare against null.
29428
29429         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29430
29431         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29432         and Unary::Operator.
29433
29434         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29435         accordingly.
29436
29437         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29438         we have overloaded operators.
29439         (Binary::ResolveOperator): Implement the part which does the operator overload
29440         resolution.
29441
29442         * class.cs (Operator::Emit): Implement.
29443         (TypeContainer::Emit): Emit the operators we have too.
29444
29445         * expression.cs (Binary::Emit): Update to emit the appropriate code for
29446         the case when we have a user-defined operator.
29447
29448 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29449
29450         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29451
29452 2001-09-16  Ravi Pratap  <ravi@ximian.com>
29453
29454         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29455         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29456         (Constructor::Emit): Implement.
29457         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29458         if we have no work to do. 
29459         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
29460         Emit method.
29461
29462         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29463         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29464
29465         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29466         of parent.parent.
29467
29468 2001-09-15  Ravi Pratap  <ravi@ximian.com>
29469
29470         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29471         in the source.
29472         (Tree::RecordNamespace): Method to do what the name says ;-)
29473         (Tree::Namespaces): Property to get at the namespaces hashtable.
29474
29475         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
29476         keep track.
29477
29478         * rootcontext.cs (IsNamespace): Fixed it :-)
29479
29480 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29481
29482         * class.cs (TypeContainer::FindMembers): Add support for
29483         constructors. 
29484         (MethodCore): New class that encapsulates both the shared aspects
29485         of a Constructor and a Method.  
29486         (Method, Constructor): Factored pieces into MethodCore.
29487
29488         * driver.cs: Added --fatal which makes errors throw exceptions.
29489         Load System assembly as well as part of the standard library.
29490
29491         * report.cs: Allow throwing exceptions on errors for debugging.
29492
29493         * modifiers.cs: Do not use `parent', instead use the real type
29494         container to evaluate permission settings.
29495
29496         * class.cs: Put Ravi's patch back in.  He is right, and we will
29497         have to cope with the
29498
29499 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29500
29501         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
29502         FamORAssem, not FamANDAssem.
29503
29504 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29505
29506         * driver.cs: Added --parse option that only parses its input files
29507         and terminates.
29508
29509         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
29510         incorrect.  IsTopLevel is not used to tell whether an object is
29511         root_types or not (that can be achieved by testing this ==
29512         root_types).  But to see if this is a top-level *class* (not
29513         necessarly our "toplevel" container). 
29514
29515 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29516
29517         * enum.cs (Enum::Define): Modify to call the Lookup method on the
29518         parent instead of a direct call to GetType.
29519
29520 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29521
29522         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
29523         Modifiers.TypeAttr. This should just be a call to that method.
29524
29525         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
29526         object so that we can determine if we are top-level or not.
29527
29528         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
29529         TypeContainer too.
29530
29531         * enum.cs (Enum::Define): Ditto.
29532
29533         * modifiers.cs (FieldAttr): Re-write.
29534
29535         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
29536         (TypeContainer::HaveStaticConstructor): New property to provide access
29537         to precisely that info.
29538
29539         * modifiers.cs (MethodAttr): Re-write.
29540         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
29541
29542         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
29543         of top-level types as claimed.
29544
29545 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
29546
29547         * expression.cs (MemberLookup): Fruitless attempt to lookup
29548         constructors.  Maybe I need to emit default constructors?  That
29549         might be it (currently .NET emits this for me automatically).
29550         (Invocation::OverloadResolve): Cope with Arguments == null.
29551         (Invocation::EmitArguments): new function, shared by the new
29552         constructor and us.
29553         (Invocation::Emit): Handle static and instance methods.  Emit
29554         proper call instruction for virtual or non-virtual invocations.
29555         (New::Emit): Implement.
29556         (New::Resolve): Implement.
29557         (MemberAccess:Resolve): Implement.
29558         (MethodGroupExpr::InstanceExpression): used conforming to the spec
29559         to track instances.
29560         (FieldExpr::Resolve): Set type.
29561
29562         * support.cs: Handle empty arguments.
29563                 
29564         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
29565         SimpleLookup): Auxiliary routines to help parse a qualifier
29566         identifier.  
29567
29568         Update qualifier_identifier rule.
29569
29570         * codegen.cs: Removed debugging messages.
29571
29572         * class.cs: Make this a global thing, this acts just as a "key" to
29573         objects that we might have around.
29574
29575         (Populate): Only initialize method_builders_to_methods once.
29576
29577         * expression.cs (PropertyExpr): Initialize type from the
29578         PropertyType. 
29579
29580         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
29581         Resolve pattern.  Attempt to implicitly convert value to boolean.
29582         Emit code.
29583
29584         * expression.cs: Set the type for the int32/int32 argument case.
29585         (Binary::ResolveOperator): Set the return type to boolean for
29586         comparission operators
29587
29588         * typemanager.cs: Remove debugging print code.
29589
29590         (Invocation::Resolve): resolve type.
29591
29592         * class.cs: Allocate a MemberInfo of the correct size, as the code
29593         elsewhere depends on the test to reflect the correct contents.
29594
29595         (Method::) Keep track of parameters, due to System.Reflection holes
29596
29597         (TypeContainer::Populate): Keep track of MethodBuilders to Method
29598         mapping here.
29599
29600         (TypeContainer::FindMembers): Use ArrayList and then copy an array
29601         of the exact size and return that.
29602
29603         (Class::LookupMethodByBuilder): New function that maps
29604         MethodBuilders to its methods.  Required to locate the information
29605         on methods because System.Reflection bit us again.
29606
29607         * support.cs: New file, contains an interface ParameterData and
29608         two implementations: ReflectionParameters and InternalParameters
29609         used to access Parameter information.  We will need to grow this
29610         as required.
29611
29612         * expression.cs (Invocation::GetParameterData): implement a cache
29613         and a wrapper around the ParameterData creation for methods. 
29614         (Invocation::OverloadResolve): Use new code.
29615
29616 2001-09-13  Ravi Pratap  <ravi@ximian.com>
29617
29618         * class.cs (TypeContainer::EmitField): Remove and move into 
29619         (Field::Define): here and modify accordingly.
29620         (Field.FieldBuilder): New member.
29621         (TypeContainer::Populate): Update accordingly.
29622         (TypeContainer::FindMembers): Implement.
29623
29624 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
29625
29626         * statement.cs: (VariableInfo::VariableType): New field to be
29627         initialized with the full type once it is resolved. 
29628
29629 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
29630
29631         * parameter.cs (GetParameterInfo): Use a type cache to compute
29632         things only once, and to reuse this information
29633
29634         * expression.cs (LocalVariableReference::Emit): Implement.
29635         (OpcodeCast::Emit): fix.
29636
29637         (ParameterReference::Resolve): Implement.
29638         (ParameterReference::Emit): Implement.
29639
29640         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
29641         that are expressions need to stay as Expressions.
29642
29643         * typemanager.cs (CSharpName): Returns the C# name of a type if
29644         possible. 
29645
29646         * expression.cs (Expression::ConvertImplicit): New function that
29647         implements implicit type conversions.
29648
29649         (Expression::ImplicitReferenceConversion): Implements implicit
29650         reference conversions.
29651
29652         (EmptyCast): New type for transparent casts.
29653
29654         (OpcodeCast): New type for casts of types that are performed with
29655         a sequence of bytecodes.
29656
29657         (BoxedCast): New type used for casting value types into reference
29658         types.  Emits a box opcode.
29659
29660         (Binary::DoNumericPromotions): Implements numeric promotions of
29661         and computation of the Binary::Type.
29662
29663         (Binary::EmitBranchable): Optimization.
29664
29665         (Binary::Emit): Implement code emission for expressions.
29666
29667         * typemanager.cs (TypeManager): Added two new core types: sbyte
29668         and byte.
29669
29670 2001-09-12  Ravi Pratap  <ravi@ximian.com>
29671
29672         * class.cs (TypeContainer::FindMembers): Method which does exactly
29673         what Type.FindMembers does, only we don't have to use reflection. No
29674         implementation yet.
29675
29676         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
29677         typecontainer objects as we need to get at them.
29678         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
29679
29680         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
29681         typecontainer object.
29682
29683         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
29684         of just a Report object.
29685
29686 2001-09-11  Ravi Pratap  <ravi@ximian.com>
29687
29688         * class.cs (Event::Define): Go back to using the prefixes "add_" and
29689         "remove_"
29690         (TypeContainer::Populate): Now define the delegates of the type too.
29691         (TypeContainer.Delegates): Property to access the list of delegates defined
29692         in the type.
29693
29694         * delegates.cs (Delegate::Define): Implement partially.
29695
29696         * modifiers.cs (TypeAttr): Handle more flags.
29697
29698 2001-09-11  Ravi Pratap  <ravi@ximian.com>
29699
29700         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
29701         and not <=
29702         (Operator::Define): Re-write logic to get types by using the LookupType method
29703         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
29704         (Indexer::Define): Ditto.
29705         (Event::Define): Ditto.
29706         (Property::Define): Ditto.
29707
29708 2001-09-10  Ravi Pratap  <ravi@ximian.com>
29709
29710         * class.cs (TypeContainer::Populate): Now define operators too. 
29711         (TypeContainer.Operators): New property to access the list of operators
29712         in a type.
29713         (Operator.OperatorMethodBuilder): New member to hold the method builder
29714         for the operator we are defining.
29715         (Operator::Define): Implement.
29716
29717 2001-09-10  Ravi Pratap  <ravi@ximian.com>
29718
29719         * class.cs (Event::Define): Make the prefixes of the accessor methods
29720         addOn_ and removeOn_ 
29721
29722         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
29723         of the location being passed in too. Ideally, this should go later since all
29724         error reporting should be done through the Report object.
29725
29726         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
29727         (Populate): Iterate thru the indexers we have and define them too.
29728         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
29729         for the get and set accessors.
29730         (Indexer::Define): Implement.
29731
29732 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
29733
29734         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
29735         my previous implementation, did not work.
29736
29737         * typemanager.cs: Add a couple of missing types (the longs).
29738
29739         * literal.cs: Use TypeManager.bool_type instead of getting it.
29740
29741         * expression.cs (EventExpr): New kind of expressions.
29742         (Expressio::ExprClassFromMemberInfo): finish
29743
29744 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
29745
29746         * assign.cs: Emit stores to static fields differently.
29747
29748 2001-09-08  Ravi Pratap  <ravi@ximian.com>
29749
29750         * Merge in changes and adjust code to tackle conflicts. Backed out my
29751         code in Assign::Resolve ;-) 
29752
29753 2001-09-08  Ravi Pratap  <ravi@ximian.com>
29754
29755         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
29756         instead Report.Error and also pass in the location.
29757         (CSharpParser::Lexer): New readonly property to return the reference
29758         to the Tokenizer object.
29759         (declare_local_variables): Use Report.Error with location instead of plain 
29760         old error.
29761         (CheckDef): Ditto.
29762
29763         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
29764         (Operator.CheckBinaryOperator): Ditto.
29765
29766         * cs-parser.jay (operator_declarator): Update accordingly.
29767
29768         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
29769         (CheckBinaryOperator): Same here.
29770
29771         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
29772         on the name without any prefixes of namespace names etc. This is because we
29773         already might have something already fully qualified like 
29774         'System.Console.WriteLine'
29775
29776         * assign.cs (Resolve): Begin implementation. Stuck ;-)
29777
29778 2001-09-07  Ravi Pratap  <ravi@ximian.com>
29779
29780         * cs-tokenizer.cs (location): Return a string which also contains
29781         the file name.
29782
29783         * expression.cs (ElementAccess): New class for expressions of the
29784         type 'element access.'
29785         (BaseAccess): New class for expressions of the type 'base access.'
29786         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
29787         respectively.
29788
29789         * cs-parser.jay (element_access): Implement action.
29790         (base_access): Implement actions.
29791         (checked_expression, unchecked_expression): Implement.
29792
29793         * cs-parser.jay (local_variable_type): Correct and implement.
29794         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
29795
29796         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
29797
29798         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
29799         name and the specifiers.
29800
29801         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
29802
29803         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
29804         making them all public ;-)
29805
29806         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
29807         class anyways.
29808
29809 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
29810
29811         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
29812         PropertyExprs.
29813         (FieldExpr, PropertyExprs): New resolved expressions.
29814         (SimpleName::MemberStaticCheck): Perform static checks for access
29815         to non-static fields on static methods. Maybe this should be
29816         generalized for MemberAccesses. 
29817         (SimpleName::ResolveSimpleName): More work on simple name
29818         resolution. 
29819
29820         * cs-parser.jay (primary_expression/qualified_identifier): track
29821         the parameter index.
29822
29823         * codegen.cs (CodeGen::Save): Catch save exception, report error.
29824         (EmitContext::EmitBoolExpression): Chain to expression generation
29825         instead of temporary hack.
29826         (::EmitStatementExpression): Put generic expression code generation.
29827
29828         * assign.cs (Assign::Emit): Implement variable assignments to
29829         local variables, parameters and fields.
29830
29831 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
29832
29833         * statement.cs (Block::GetVariableInfo): New method, returns the
29834         VariableInfo for a variable name in a block.
29835         (Block::GetVariableType): Implement in terms of GetVariableInfo
29836
29837         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
29838         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
29839
29840 2001-09-06  Ravi Pratap  <ravi@ximian.com>
29841
29842         * cs-parser.jay (operator_declaration): Continue on my quest : update
29843         to take attributes argument.
29844         (event_declaration): Ditto.
29845         (enum_declaration): Ditto.
29846         (indexer_declaration): Ditto.
29847
29848         * class.cs (Operator::Operator): Update constructor accordingly.
29849         (Event::Event): Ditto.
29850
29851         * delegate.cs (Delegate::Delegate): Same here.
29852
29853         * enum.cs (Enum::Enum): Same here.
29854
29855 2001-09-05  Ravi Pratap  <ravi@ximian.com>
29856
29857         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
29858
29859         * ../tests/cs0658.cs : New file to demonstrate error 0658.
29860
29861         * attribute.cs (Attributes): New class to encapsulate all attributes which were
29862         being passed around as an arraylist.
29863         (Attributes::AddAttribute): Method to add attribute sections.
29864
29865         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
29866         (struct_declaration): Update accordingly.
29867         (constant_declaration): Update.
29868         (field_declaration): Update.
29869         (method_header): Update.
29870         (fixed_parameter): Update.
29871         (parameter_array): Ditto.
29872         (property_declaration): Ditto.
29873         (destructor_declaration): Ditto.
29874
29875         * class.cs (Struct::Struct): Update constructors accordingly.
29876         (Class::Class): Ditto.
29877         (Field::Field): Ditto.
29878         (Method::Method): Ditto.
29879         (Property::Property): Ditto.
29880         (TypeContainer::OptAttribute): update property's return type.
29881
29882         * interface.cs (Interface.opt_attributes): New member.
29883         (Interface::Interface): Update to take the extra Attributes argument.
29884
29885         * parameter.cs (Parameter::Parameter): Ditto.
29886
29887         * constant.cs (Constant::Constant): Ditto.
29888
29889         * interface.cs (InterfaceMemberBase): New OptAttributes field.
29890         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
29891         the attributes as a parameter.
29892         (InterfaceProperty): Update constructor call.
29893         (InterfaceEvent): Ditto.
29894         (InterfaceMethod): Ditto.
29895         (InterfaceIndexer): Ditto.
29896
29897         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
29898         pass the attributes too.
29899         (interface_event_declaration): Ditto.
29900         (interface_property_declaration): Ditto.
29901         (interface_method_declaration): Ditto.
29902         (interface_declaration): Ditto.
29903
29904 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
29905
29906         * class.cs (Method::Define): Track the "static Main" definition to
29907         create an entry point. 
29908
29909         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
29910         EntryPoint if we find it. 
29911
29912         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
29913         (EmitContext::ig): Make this variable public.
29914
29915         * driver.cs: Make the default output file be the first file name
29916         with the .exe extension.  
29917
29918         Detect empty compilations
29919
29920         Handle various kinds of output targets.  Handle --target and
29921         rename -t to --dumper.
29922
29923         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
29924         methods inherited from Expression return now an Expression.  This
29925         will is used during the tree rewriting as we resolve them during
29926         semantic analysis.
29927
29928         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
29929         the spec.  Missing entirely is the information about
29930         accessability of elements of it.
29931
29932         (Expression::ExprClassFromMemberInfo): New constructor for
29933         Expressions that creates a fully initialized Expression based on
29934         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
29935         a Type.
29936
29937         (Invocation::Resolve): Begin implementing resolution of invocations.
29938
29939         * literal.cs (StringLiteral):  Implement Emit.
29940
29941 2001-09-05  Ravi Pratap  <ravi@ximian.com>
29942
29943         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29944         member.
29945
29946 2001-09-04  Ravi Pratap  <ravi@ximian.com>
29947
29948         * cs-parser.jay (attribute_arguments): Implement actions.
29949         (attribute): Fix bug in production. Implement action.
29950         (attribute_list): Implement.
29951         (attribute_target): Implement.
29952         (attribute_target_specifier, opt_target_specifier): Implement
29953         (CheckAttributeTarget): New method to check if the attribute target
29954         is valid.
29955         (attribute_section): Implement.
29956         (opt_attributes): Implement.
29957
29958         * attribute.cs : New file to handle attributes.
29959         (Attribute): Class to hold attribute info.
29960
29961         * cs-parser.jay (opt_attribute_target_specifier): Remove production
29962         (attribute_section): Modify production to use 2 different rules to 
29963         achieve the same thing. 1 s/r conflict down !
29964         Clean out commented, useless, non-reducing dimension_separator rules.
29965
29966         * class.cs (TypeContainer.attributes): New member to hold list
29967         of attributes for a type.
29968         (Struct::Struct): Modify to take one more argument, the attribute list.
29969         (Class::Class): Ditto.
29970         (Field::Field): Ditto.
29971         (Method::Method): Ditto.
29972         (Property::Property): Ditto.
29973
29974         * cs-parser.jay (struct_declaration): Update constructor call to
29975         pass in the attributes too.
29976         (class_declaration): Ditto.
29977         (constant_declaration): Ditto.
29978         (field_declaration): Ditto.
29979         (method_header): Ditto.
29980         (fixed_parameter): Ditto.
29981         (parameter_array): Ditto.
29982         (property_declaration): Ditto.
29983
29984         * constant.cs (Constant::Constant): Update constructor similarly.
29985         Use System.Collections.
29986
29987         * parameter.cs (Parameter::Parameter): Update as above.
29988
29989 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29990
29991         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29992         (TypeContainer.delegates): New member to hold list of delegates.
29993
29994         * cs-parser.jay (delegate_declaration): Implement the action correctly 
29995         this time as I seem to be on crack ;-)
29996
29997 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
29998
29999         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30000         tell whether an identifier represents a namespace.
30001
30002         * expression.cs (NamespaceExpr): A namespace expression, used only
30003         temporarly during expression resolution.
30004         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30005         utility functions to resolve names on expressions.
30006
30007 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30008
30009         * codegen.cs: Add hook for StatementExpressions. 
30010
30011         * class.cs: Fix inverted test for static flag in methods.
30012
30013 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30014
30015         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30016         to make it coincide with MS' number.
30017         (Operator::CheckBinaryOperator): Ditto.
30018
30019         * ../errors/errors.txt : Remove error numbers added earlier.
30020
30021         * ../errors/cs1019.cs : Test case for error # 1019
30022
30023         * ../errros/cs1020.cs : Test case for error # 1020
30024
30025         * cs-parser.jay : Clean out commented cruft.
30026         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30027         used anywhere - non-reducing rule.
30028         (namespace_declarations): Non-reducing rule - comment out.
30029
30030         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30031         with TypeContainer::AddEnum.
30032
30033         * delegate.cs : New file for delegate handling classes.
30034         (Delegate): Class for declaring delegates.
30035
30036         * makefile : Update.
30037
30038         * cs-parser.jay (delegate_declaration): Implement.
30039
30040 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30041
30042         * class.cs (Event::Define): Implement.
30043         (Event.EventBuilder): New member.
30044
30045         * class.cs (TypeContainer::Populate): Update to define all enums and events
30046         we have.
30047         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30048         readonly fields for all these cases ?
30049
30050 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30051
30052         * class.cs (Property): Revamp to use the convention of making fields readonly.
30053         Accordingly modify code elsewhere.
30054
30055         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30056         the Define method of the Property class.
30057
30058         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30059         trivial bug.
30060         (TypeContainer::Populate): Update to define all the properties we have. Also
30061         define all enumerations.
30062
30063         * enum.cs (Define): Implement.
30064
30065 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30066
30067         * cs-parser.jay (overloadable_operator): The semantic value is an
30068         enum of the Operator class.
30069         (operator_declarator): Implement actions.
30070         (operator_declaration): Implement.
30071
30072         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30073         validity of definitions.
30074         (Operator::CheckBinaryOperator): Static method to check for binary operators
30075         (TypeContainer::AddOperator): New method to add an operator to a type.
30076
30077         * cs-parser.jay (indexer_declaration): Added line to actually call the
30078         AddIndexer method so it gets added ;-)
30079
30080         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30081         already taken care of by the MS compiler ?  
30082
30083 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30084
30085         * class.cs (Operator): New class for operator declarations.
30086         (Operator::OpType): Enum for the various operators.
30087
30088 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30089
30090         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30091         ostensibly handle this in semantic analysis.
30092
30093         * cs-parser.jay (general_catch_clause): Comment out
30094         (specific_catch_clauses, specific_catch_clause): Ditto.
30095         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30096         (catch_args, opt_catch_args): New productions.
30097         (catch_clause): Rewrite to use the new productions above
30098         (catch_clauses): Modify accordingly.
30099         (opt_catch_clauses): New production to use in try_statement
30100         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30101         and re-write the code in the actions to extract the specific and
30102         general catch clauses by being a little smart ;-)
30103
30104         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30105         Hooray, try and catch statements parse fine !
30106
30107 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30108
30109         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30110         string from the hashtable of variables.
30111
30112         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30113         I end up making that mistake ;-)
30114         (catch_clauses): Fixed gross error which made Key and Value of the 
30115         DictionaryEntry the same : $1 !!
30116
30117 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30118
30119         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30120
30121         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30122         when the add and remove accessors are specified. 
30123
30124 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30125
30126         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30127         information about indexer_declarator.
30128         (indexer_declarator): Implement actions.
30129         (parsing_indexer): New local boolean used to keep track of whether
30130         we are parsing indexers or properties. This is necessary because 
30131         implicit_parameters come into picture even for the get accessor in the 
30132         case of an indexer.
30133         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30134
30135         * class.cs (Indexer): New class for indexer declarations.
30136         (TypeContainer::AddIndexer): New method to add an indexer to a type.
30137         (TypeContainer::indexers): New member to hold list of indexers for the
30138         type.
30139
30140 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30141
30142         * cs-parser.jay (add_accessor_declaration): Implement action.
30143         (remove_accessor_declaration): Implement action.
30144         (event_accessors_declaration): Implement
30145         (variable_declarators): swap statements for first rule - trivial.
30146
30147         * class.cs (Event): New class to hold information about event
30148         declarations.
30149         (TypeContainer::AddEvent): New method to add an event to a type
30150         (TypeContainer::events): New member to hold list of events.
30151
30152         * cs-parser.jay (event_declaration): Implement actions.
30153
30154 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30155
30156         * cs-parser.jay (dim_separators): Implement. Make it a string
30157         concatenating all the commas together, just as they appear.
30158         (opt_dim_separators): Modify accordingly
30159         (rank_specifiers): Update accordingly. Basically do the same
30160         thing - instead, collect the brackets here.
30161         (opt_rank_sepcifiers): Modify accordingly.
30162         (array_type): Modify to actually return the complete type string
30163         instead of ignoring the rank_specifiers.
30164         (expression_list): Implement to collect the expressions
30165         (variable_initializer): Implement. We make it a list of expressions
30166         essentially so that we can handle the array_initializer case neatly too.
30167         (variable_initializer_list): Implement.
30168         (array_initializer): Make it a list of variable_initializers
30169         (opt_array_initializer): Modify accordingly.
30170
30171         * expression.cs (New::NType): Add enumeration to help us
30172         keep track of whether we have an object/delegate creation
30173         or an array creation.
30174         (New:NewType, New::Rank, New::Indices, New::Initializers): New
30175         members to hold data about array creation.
30176         (New:New): Modify to update NewType
30177         (New:New): New Overloaded contructor for the array creation
30178         case.
30179
30180         * cs-parser.jay (array_creation_expression): Implement to call
30181         the overloaded New constructor.
30182
30183 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
30184
30185         * class.cs (TypeContainer::Constructors): Return member
30186         constructors instead of returning null.
30187
30188 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
30189
30190         * typemanager.cs (InitCoreTypes): Initialize the various core
30191         types after we have populated the type manager with the user
30192         defined types (this distinction will be important later while
30193         compiling corlib.dll)
30194
30195         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30196         on Expression Classification.  Now all expressions have a method
30197         `Resolve' and a method `Emit'.
30198
30199         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30200         generation from working.     Also add some temporary debugging
30201         code. 
30202
30203 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
30204
30205         * codegen.cs: Lots of code generation pieces.  This is only the
30206         beginning, will continue tomorrow with more touches of polish.  We
30207         handle the fundamentals of if, while, do, for, return.  Others are
30208         trickier and I need to start working on invocations soon.
30209
30210         * gen-treedump.cs: Bug fix, use s.Increment here instead of
30211         s.InitStatement. 
30212
30213         * codegen.cs (EmitContext): New struct, used during code
30214         emission to keep a context.   Most of the code generation will be
30215         here. 
30216
30217         * cs-parser.jay: Add embedded blocks to the list of statements of
30218         this block.  So code generation proceeds in a top down fashion.
30219
30220 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
30221
30222         * statement.cs: Add support for multiple child blocks.
30223
30224 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
30225
30226         * codegen.cs (EmitCode): New function, will emit the code for a
30227         Block of code given a TypeContainer and its ILGenerator. 
30228
30229         * statement.cs (Block): Standard public readonly optimization.
30230         (Block::Block constructors): Link children. 
30231         (Block::Child): Child Linker.
30232         (Block::EmitVariables): Emits IL variable declarations.
30233
30234         * class.cs: Drop support for MethodGroups here, delay until
30235         Semantic Analysis.
30236         (Method::): Applied the same simplification that I did before, and
30237         move from Properties to public readonly fields.
30238         (Method::ParameterTypes): Returns the parameter types for the
30239         function, and implements a cache that will be useful later when I
30240         do error checking and the semantic analysis on the methods is
30241         performed.
30242         (Constructor::GetCallingConvention): Renamed from CallingConvetion
30243         and made a method, optional argument tells whether this is a class
30244         or a structure to apply the `has-this' bit.
30245         (Method::GetCallingConvention): Implement, returns the calling
30246         convention. 
30247         (Method::Define): Defines the type, a second pass is performed
30248         later to populate the methods.
30249
30250         (Constructor::ParameterTypes): implement a cache similar to the
30251         one on Method::ParameterTypes, useful later when we do semantic
30252         analysis. 
30253
30254         (TypeContainer::EmitMethod):  New method.  Emits methods.
30255
30256         * expression.cs: Removed MethodGroup class from here.
30257
30258         * parameter.cs (Parameters::GetCallingConvention): new method.
30259
30260 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
30261
30262         * class.cs (TypeContainer::Populate): Drop RootContext from the
30263         argument. 
30264
30265         (Constructor::CallingConvention): Returns the calling convention.
30266         (Constructor::ParameterTypes): Returns the constructor parameter
30267         types. 
30268
30269         (TypeContainer::AddConstructor): Keep track of default constructor
30270         and the default static constructor.
30271
30272         (Constructor::) Another class that starts using `public readonly'
30273         instead of properties. 
30274
30275         (Constructor::IsDefault): Whether this is a default constructor. 
30276
30277         (Field::) use readonly public fields instead of properties also.
30278
30279         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30280         track of static constructors;  If none is used, turn on
30281         BeforeFieldInit in the TypeAttributes. 
30282
30283         * cs-parser.jay (opt_argument_list): now the return can be null
30284         for the cases where there are no arguments. 
30285
30286         (constructor_declarator): If there is no implicit `base' or
30287         `this', then invoke the default parent constructor. 
30288
30289         * modifiers.cs (MethodAttr): New static function maps a set of
30290         modifiers flags into a MethodAttributes enum
30291         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
30292         MethodAttr, TypeAttr to represent the various mappings where the
30293         modifiers are used.
30294         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
30295
30296 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
30297
30298         * parameter.cs (GetParameterInfo): Fix bug where there would be no
30299         method arguments.
30300
30301         * interface.cs (PopulateIndexer): Implemented the code generator
30302         for interface indexers.
30303
30304 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
30305
30306         * interface.cs (InterfaceMemberBase): Now we track the new status
30307         here.  
30308
30309         (PopulateProperty): Implement property population.  Woohoo!  Got
30310         Methods and Properties going today. 
30311
30312         Removed all the properties for interfaces, and replaced them with
30313         `public readonly' fields. 
30314
30315 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
30316
30317         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30318         initialize their hashtables/arraylists only when they are needed
30319         instead of doing this always.
30320
30321         * parameter.cs: Handle refs and out parameters.
30322
30323         * cs-parser.jay: Use an ArrayList to construct the arguments
30324         instead of the ParameterCollection, and then cast that to a
30325         Parameter[] array.
30326
30327         * parameter.cs: Drop the use of ParameterCollection and use
30328         instead arrays of Parameters.
30329
30330         (GetParameterInfo): Use the Type, not the Name when resolving
30331         types. 
30332
30333 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
30334
30335         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30336         and instead use public readonly fields.
30337
30338         * class.cs: Put back walking code for type containers.
30339
30340 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
30341
30342         * class.cs (MakeConstant): Code to define constants.
30343
30344         * rootcontext.cs (LookupType): New function.  Used to locate types 
30345
30346
30347 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
30348
30349         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
30350         this System.Reflection code is.  Kudos to Microsoft
30351
30352         * typemanager.cs: Implement a type cache and avoid loading all
30353         types at boot time.  Wrap in LookupType the internals.  This made
30354         the compiler so much faster.  Wow.  I rule!
30355
30356         * driver.cs: Make sure we always load mscorlib first (for
30357         debugging purposes, nothing really important).
30358
30359         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
30360         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
30361
30362         * rootcontext.cs: Lookup types on their namespace;  Lookup types
30363         on namespaces that have been imported using the `using' keyword.
30364
30365         * class.cs (TypeContainer::TypeAttr): Virtualize.
30366         (Class::TypeAttr): Return attributes suitable for this bad boy.
30367         (Struct::TypeAttr): ditto.
30368         Handle nested classes.
30369         (TypeContainer::) Remove all the type visiting code, it is now
30370         replaced with the rootcontext.cs code
30371
30372         * rootcontext.cs (GetClassBases): Added support for structs. 
30373
30374 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
30375
30376         * interface.cs, statement.cs, class.cs, parameter.cs,
30377         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30378         Drop use of TypeRefs, and use strings instead.
30379
30380 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
30381
30382         * rootcontext.cs: 
30383
30384         * class.cs (Struct::Struct): set the SEALED flags after
30385         checking the modifiers.
30386         (TypeContainer::TypeAttr): new property, returns the
30387         TypeAttributes for a class.  
30388
30389         * cs-parser.jay (type_list): Oops, list production was creating a
30390         new list of base types.
30391
30392         * rootcontext.cs (StdLib): New property.
30393         (GetInterfaceTypeByName): returns an interface by type name, and
30394         encapsulates error handling here.
30395         (GetInterfaces): simplified.
30396         (ResolveTree): Encapsulated all the tree resolution here.
30397         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30398         types. 
30399
30400         * driver.cs: Add support for --nostdlib, to avoid loading the
30401         default assemblies.
30402         (Main): Do not put tree resolution here. 
30403
30404         * rootcontext.cs: Beginning of the class resolution.
30405
30406 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
30407
30408         * rootcontext.cs: Provide better error reporting. 
30409
30410         * cs-parser.jay (interface_base): set our $$ to be interfaces.
30411
30412         * rootcontext.cs (CreateInterface): Handle the case where there
30413         are no parent interfaces.
30414
30415         (CloseTypes): Routine to flush types at the end.
30416         (CreateInterface): Track types.
30417         (GetInterfaces): Returns an array of Types from the list of
30418         defined interfaces.
30419
30420         * typemanager.c (AddUserType): Mechanism to track user types (puts
30421         the type on the global type hash, and allows us to close it at the
30422         end). 
30423
30424 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
30425
30426         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30427         RecordInterface instead.
30428
30429         * cs-parser.jay: Updated to reflect changes above.
30430
30431         * decl.cs (Definition): Keep track of the TypeBuilder type that
30432         represents this type here.  Not sure we will use it in the long
30433         run, but wont hurt for now.
30434
30435         * driver.cs: Smaller changes to accomodate the new code.
30436
30437         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30438         when done. 
30439
30440         * rootcontext.cs (CreateInterface):  New method, used to create
30441         the System.TypeBuilder type for interfaces.
30442         (ResolveInterfaces): new entry point to resolve the interface
30443         hierarchy. 
30444         (CodeGen): Property, used to keep track of the code generator.
30445
30446 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
30447
30448         * cs-parser.jay: Add a second production for delegate_declaration
30449         with `VOID'.
30450
30451         (enum_body): Put an opt_comma here instead of putting it on
30452         enum_body or enum_member_declarations so we can handle trailing
30453         commas on enumeration members.  Gets rid of a shift/reduce.
30454
30455         (type_list): Need a COMMA in the middle.
30456
30457         (indexer_declaration): Tell tokenizer to recognize get/set
30458
30459         * Remove old targets.
30460
30461         * Re-add the parser target.
30462
30463 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30464
30465         * cs-parser.jay: Add precendence rules for a number of operators
30466         ot reduce the number of shift/reduce conflicts in the grammar.
30467
30468 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
30469
30470         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30471         and put it here.
30472
30473         Get rid of old crufty code.
30474
30475         * rootcontext.cs: Use this to keep track of the parsed
30476         representation and the defined types available to the program. 
30477
30478         * gen-treedump.cs: adjust for new convention.
30479
30480         * type.cs: Split out the type manager, and the assembly builder
30481         from here. 
30482
30483         * typemanager.cs: the type manager will live here now.
30484
30485         * cil-codegen.cs: And the code generator here. 
30486
30487 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
30488
30489         * makefile: Fixed up for easy making.
30490
30491 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30492
30493         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
30494         the 
30495
30496         (unary_expression): Expand pre_increment_expression and
30497         post_decrement_expression to reduce a shift/reduce.
30498
30499 2001-07-11  Simon Cozens
30500
30501         * cs-tokenizer.cs: Hex numbers should begin with a 0.
30502
30503         Improve allow_keyword_as_indent name.
30504
30505 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
30506
30507         * Adjustments for Beta2. 
30508
30509 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
30510
30511         * decl.cs: Added `Define' abstract method.
30512         (InTransit): new property, used to catch recursive definitions. 
30513
30514         * interface.cs: Implement `Define'. 
30515
30516         * modifiers.cs: Map Modifiers.constants to
30517         System.Reflection.TypeAttribute flags.
30518
30519         * class.cs: Keep track of types and user-defined types.
30520         (BuilderInit): New method for creating an assembly
30521         (ResolveType): New function to launch the resolution process, only
30522         used by interfaces for now.
30523
30524         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
30525         that are inserted into the name space. 
30526
30527 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
30528
30529         * ARGH.  I have screwed up my tree so many times due to the use of
30530         rsync rather than using CVS.  Going to fix this at once. 
30531
30532         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
30533         load types.
30534
30535 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
30536
30537         * Experiment successful: Use System.Type rather that our own
30538         version of Type.  
30539
30540 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
30541
30542         * cs-parser.jay: Removed nsAliases from here.
30543
30544         Use new namespaces, handle `using XXX;' 
30545
30546         * namespace.cs: Reimplemented namespace handling, use a recursive
30547         definition of the class.  Now we can keep track of using clauses
30548         and catch invalid using clauses.
30549
30550 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
30551
30552         * gen-treedump.cs: Adapted for all the renaming.
30553
30554         * expression.cs (Expression): this class now has a Type property
30555         which returns an expression Type.
30556
30557         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
30558         `Type', as this has a different meaning now in the base
30559
30560 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
30561
30562         * interface.cs, class.cs: Removed from all the sources the
30563         references to signature computation, as we can not do method
30564         signature computation during the parsing time, as we are not
30565         trying to solve at that point distinguishing:
30566
30567         class X {
30568                 void a (Blah x) {}
30569                 void a (NS.Blah x) {}
30570         }
30571
30572         Which depending on the context might be valid or not, as we do not
30573         know if Blah is the same thing as NS.Blah at that point.
30574
30575         * Redid everything so the code uses TypeRefs now instead of
30576         Types.  TypeRefs are just temporary type placeholders, that need
30577         to be resolved.  They initially have a pointer to a string and the
30578         current scope in which they are used.  This is used later by the
30579         compiler to resolve the reference to an actual Type. 
30580
30581         * DeclSpace is no longer a CIR.Type, and neither are
30582         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
30583         are all DeclSpaces, but no Types. 
30584
30585         * type.cs (TypeRefManager): This implements the TypeRef manager,
30586         which keeps track of all the types that need to be resolved after
30587         the parsing has finished. 
30588
30589 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
30590
30591         * ARGH.  We are going to have to store `foreach' as a class rather
30592         than resolving it, as we need to verify error 1579 after name
30593         resolution.   *OR* we could keep a flag that says `This request to
30594         IEnumerator comes from a foreach statement' which we can then use
30595         to generate the error.
30596
30597 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
30598
30599         * class.cs (TypeContainer.AddMethod): we now add methods to the
30600         MethodGroup instead of the method hashtable.  
30601
30602         * expression.cs: Add MethodGroup abstraction, which gets us one
30603         step closer to the specification in the way we handle method
30604         declarations.  
30605
30606         * cs-parser.jay (primary_expression): qualified_identifier now
30607         tried to match up an identifier to a local variable reference or
30608         to a parameter reference.
30609
30610         current_local_parameters is now a parser global variable that
30611         points to the current parameters for the block, used during name
30612         lookup.
30613
30614         (property_declaration): Now creates an implicit `value' argument to
30615         the set accessor.
30616
30617 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
30618
30619         * parameter.cs: Do not use `param' arguments as part of the
30620         signature, per the spec.
30621
30622 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
30623
30624         * decl.cs: Base class for classes, structs and interfaces.  This
30625         is the "Declaration Space" 
30626
30627         * cs-parser.jay: Use CheckDef for checking declaration errors
30628         instead of having one on each function.
30629
30630         * class.cs: Factor out some code for handling error handling in
30631         accordance to the "Declarations" section in the "Basic Concepts"
30632         chapter in the ECMA C# spec.
30633
30634         * interface.cs: Make all interface member classes derive from
30635         InterfaceMemberBase.
30636
30637 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
30638
30639         * Many things: all interfaces are parsed and generated in
30640         gen-treedump.  Support for member variables, constructors,
30641         destructors, properties, constants is there.
30642
30643         Beginning of the IL backend, but very little done, just there for
30644         testing purposes. 
30645
30646 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
30647
30648         * cs-parser.jay: Fix labeled statement.
30649
30650         * cs-tokenizer.cs (escape): Escape " and ' always.
30651         ref_line, ref_name: keep track of the line/filename as instructed
30652         by #line by the compiler.
30653         Parse #line.
30654
30655 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
30656
30657         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
30658         to match the values in System.CodeDOM.
30659
30660         Divid renamed to Divide.
30661
30662         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
30663         statements. 
30664         (Statements.set): remove.
30665
30666         * System.CodeDOM/CodeCatchClause.cs: always have a valid
30667         statements. 
30668
30669         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
30670         falseStatements always have valid values. 
30671
30672         * cs-parser.jay: Use System.CodeDOM now.
30673